From 984e9f32a54521bc83a102189f34dfb370da8ee8 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 19 Sep 2020 16:57:35 +0200 Subject: [PATCH 1/2] Split all scripts in travis build into individual jobs --- .travis.yml | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8d9c25c..e38c13a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,42 +6,42 @@ branches: only: - /.*/ -services: - - docker - cache: directories: - node_modules +node_js: + - '12.16.3' + jobs: fast_finish: true include: - - node_js: '12.16.3' - -install: - - npm ci - -before_script: - - echo "Building commit range ${TRAVIS_COMMIT_RANGE}" - - export MUTATION_FILES=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/main} --name-only | grep -E 'src\/(.*).(ts|tsx)$' | paste -sd ",") - -script: - - npm run lint - - npm run test:ci - - docker build -t shlink-web-client:test . - - npm run mutate:ci - -after_success: - - node_modules/.bin/ocular coverage/clover.xml - -# Before deploying, build dist file for current travis tag -before_deploy: npm run build ${TRAVIS_TAG#?} - -deploy: - - provider: releases - api_key: - secure: jBvPwC7EAbViaNR83rwMSt5XQDK0Iu9rgvEMa7GoyShbHcvUCCPd73Tu9quNpKi6NKsDY3INHgtch3vgonjGNGDGJ+yDyIBzXcvsAX2x3UcHpRbgY12uiINVmQxBI1+OVQB016Nm+cKC/i5Z36K4EmDbYfo+MrKndngM6AjcQFTwI8EwniIMaQgg4gNes//K8NhP5u0c3gwG+Q6jEGnq6uH3kcRgh6/epIZYpQyxjqWqKwF77sgcYj+X2Nf6XxtB5neuCi301UKLoLx8G0skh/Lm6KAIO4s9iIhIFa3UpoF21Ka0TxLpd2JxalLryCnFGlWWE6lxC9Htmc0TeRowJQlGdJXCskJ37xT9MljKY0fwNMu06VS/FUgykuCv+jP3zQu51pKu7Ew7+WeNPjautoOTu54VkdGyHcf2ThBNEyJQuiEwAQe4u7yAxY6R5ovEdvHBSIg4w1E5/Mxy5SMTCUlIAv6H7QQ1X9Z/zJm9HH5KeKz5tsHvQ/RIdSpgHXq/tC8o4Yup/LCFucXfrgvy/8pJoO1UpOlmvm62974NFfo0EG5YWwv6brUqz3QXpMjb8sWqgjltYMYJX3J7WZ34rIc+zt4NAmfhqgczaOC4pUGCiJ8jX3rMWIaQRn1AJ+5V337jL9fNDpTHny4phQjHrMJ1e0HZuNp0Xb5Q8wgqDPM= - file: "./dist/shlink-web-client_${TRAVIS_TAG#?}_dist.zip" - skip_cleanup: true - on: - tags: true + - name: 'Lint' + install: npm ci + script: npm run lint + - name: 'Unit tests' + install: npm ci + script: npm run test:ci + after_success: + - node_modules/.bin/ocular coverage/clover.xml + - name: 'Mutation tests' + install: npm ci + before_script: + - echo "Building commit range ${TRAVIS_COMMIT_RANGE}" + - export MUTATION_FILES=$(git diff ${TRAVIS_COMMIT_RANGE:-origin/main} --name-only | grep -E 'src\/(.*).(ts|tsx)$' | paste -sd ",") + script: npm run mutate:ci + - name: 'Build docker image' + services: + - docker + script: docker build -t shlink-web-client:test . + - name: 'Publish release' + if: tag IS present + before_deploy: npm run build ${TRAVIS_TAG#?} # Before deploying, build dist file for current travis tag + deploy: + - provider: releases + api_key: + secure: jBvPwC7EAbViaNR83rwMSt5XQDK0Iu9rgvEMa7GoyShbHcvUCCPd73Tu9quNpKi6NKsDY3INHgtch3vgonjGNGDGJ+yDyIBzXcvsAX2x3UcHpRbgY12uiINVmQxBI1+OVQB016Nm+cKC/i5Z36K4EmDbYfo+MrKndngM6AjcQFTwI8EwniIMaQgg4gNes//K8NhP5u0c3gwG+Q6jEGnq6uH3kcRgh6/epIZYpQyxjqWqKwF77sgcYj+X2Nf6XxtB5neuCi301UKLoLx8G0skh/Lm6KAIO4s9iIhIFa3UpoF21Ka0TxLpd2JxalLryCnFGlWWE6lxC9Htmc0TeRowJQlGdJXCskJ37xT9MljKY0fwNMu06VS/FUgykuCv+jP3zQu51pKu7Ew7+WeNPjautoOTu54VkdGyHcf2ThBNEyJQuiEwAQe4u7yAxY6R5ovEdvHBSIg4w1E5/Mxy5SMTCUlIAv6H7QQ1X9Z/zJm9HH5KeKz5tsHvQ/RIdSpgHXq/tC8o4Yup/LCFucXfrgvy/8pJoO1UpOlmvm62974NFfo0EG5YWwv6brUqz3QXpMjb8sWqgjltYMYJX3J7WZ34rIc+zt4NAmfhqgczaOC4pUGCiJ8jX3rMWIaQRn1AJ+5V337jL9fNDpTHny4phQjHrMJ1e0HZuNp0Xb5Q8wgqDPM= + file: "./dist/shlink-web-client_${TRAVIS_TAG#?}_dist.zip" + skip_cleanup: true + on: + tags: true From 5c639d241b5388aec1befc70590d08df6b5f3b67 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 19 Sep 2020 16:58:01 +0200 Subject: [PATCH 2/2] Disabled docker image build in arm archs, as it fails with node-sass --- CHANGELOG.md | 4 ++-- scripts/docker/build | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00add33b..018e7837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,13 +16,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), By default updates are immediately applied if real-time updates are enabled, to keep the behavior as it was. -* [#297](https://github.com/shlinkio/shlink-web-client/issues/297) Enabled docker image multi-arch support, by moving image building to github actions. - #### Changed * [#150](https://github.com/shlinkio/shlink-web-client/issues/150) The list of short URLs is now ordered by the creation date, showing newest results first. * [#248](https://github.com/shlinkio/shlink-web-client/issues/248) Numbers displayed application-wide are now prettified. * [#40](https://github.com/shlinkio/shlink-web-client/issues/40) Migrated project to TypeScript. +* [#297](https://github.com/shlinkio/shlink-web-client/issues/297) Moved docker image building to github actions. +* [#305](https://github.com/shlinkio/shlink-web-client/issues/305) Split travis build so that every step is run in a parallel job. #### Deprecated diff --git a/scripts/docker/build b/scripts/docker/build index e7b0c8a4..382ae98b 100755 --- a/scripts/docker/build +++ b/scripts/docker/build @@ -2,7 +2,8 @@ set -ex -PLATFORMS="linux/arm/v7,linux/arm64/v8,linux/amd64" +# PLATFORMS="linux/arm/v7,linux/arm64/v8,linux/amd64" +PLATFORMS="linux/amd64" DOCKER_IMAGE="shlinkio/shlink-web-client" if [[ "$GITHUB_REF" == *"main"* ]]; then