From 1d31ac01aaa3ec82b6c7fd44c835b2ce601a0b4d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 30 Dec 2022 11:23:44 -0600 Subject: [PATCH 1/4] GitLab CI: use $CI_DEFAULT_BRANCH --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1b93f1ff..05c97e22b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -116,7 +116,7 @@ docs-deploy: - curl -X POST -F"token=$CI_JOB_TOKEN" -F'ref=master' https://gitlab.com/api/v4/projects/15685485/trigger/pipeline only: refs: - - develop + - $CI_DEFAULT_BRANCH changes: - "docs/**/*" interruptible: true @@ -144,7 +144,7 @@ pages: - public only: refs: - - develop + - $CI_DEFAULT_BRANCH interruptible: true docker: @@ -161,7 +161,7 @@ docker: - docker push $CI_REGISTRY_IMAGE only: refs: - - develop + - $CI_DEFAULT_BRANCH interruptible: true include: From 803b09f970db5e5a66e94661a15b2abe42be66f9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 30 Dec 2022 11:25:18 -0600 Subject: [PATCH 2/4] GitLab CI: fix before_script type --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 05c97e22b..89f8c8661 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,7 +85,8 @@ jest: nginx-test: stage: test image: nginx:latest - before_script: cp installation/mastodon.conf /etc/nginx/conf.d/default.conf + before_script: + - cp installation/mastodon.conf /etc/nginx/conf.d/default.conf script: nginx -t only: changes: From 178c41b3c35f616426445a431f0ecebf21ef3f2b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 30 Dec 2022 11:26:16 -0600 Subject: [PATCH 3/4] Danger: don't run on develop --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89f8c8661..2fb57b472 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -33,6 +33,9 @@ danger: # https://github.com/danger/danger-js/issues/1029#issuecomment-998915436 - export CI_MERGE_REQUEST_IID=${CI_OPEN_MERGE_REQUESTS#*!} - npx danger ci + except: + refs: + - $CI_DEFAULT_BRANCH allow_failure: true interruptible: true From 7c46c8da5251dcabc816148d4d545da1a6faec78 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 30 Dec 2022 11:39:08 -0600 Subject: [PATCH 4/4] GitLab CI: make jobs interruptible by default --- .gitlab-ci.yml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fb57b472..008550826 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,9 @@ image: node:18 variables: NODE_ENV: test +default: + interruptible: true + cache: &cache key: files: @@ -25,7 +28,6 @@ deps: cache: <<: *cache policy: push - interruptible: true danger: stage: test @@ -37,7 +39,6 @@ danger: refs: - $CI_DEFAULT_BRANCH allow_failure: true - interruptible: true lint-js: stage: test @@ -50,7 +51,6 @@ lint-js: - "**/*.tsx" - ".eslintignore" - ".eslintrc.js" - interruptible: true lint-sass: stage: test @@ -60,7 +60,6 @@ lint-sass: - "**/*.scss" - "**/*.css" - ".stylelintrc.json" - interruptible: true jest: stage: test @@ -83,7 +82,6 @@ jest: coverage_report: coverage_format: cobertura path: .coverage/cobertura-coverage.xml - interruptible: true nginx-test: stage: test @@ -94,7 +92,6 @@ nginx-test: only: changes: - "installation/mastodon.conf" - interruptible: true build-production: stage: test @@ -109,7 +106,6 @@ build-production: artifacts: paths: - static - interruptible: true docs-deploy: stage: deploy @@ -123,7 +119,6 @@ docs-deploy: - $CI_DEFAULT_BRANCH changes: - "docs/**/*" - interruptible: true review: stage: deploy @@ -133,7 +128,6 @@ review: script: - npx -y surge static $CI_COMMIT_REF_SLUG.git.soapbox.pub allow_failure: true - interruptible: true pages: stage: deploy @@ -149,7 +143,6 @@ pages: only: refs: - $CI_DEFAULT_BRANCH - interruptible: true docker: stage: deploy @@ -166,14 +159,7 @@ docker: only: refs: - $CI_DEFAULT_BRANCH - interruptible: true include: - template: Jobs/Dependency-Scanning.gitlab-ci.yml - - template: Security/License-Scanning.gitlab-ci.yml - -gemnasium-dependency_scanning: - interruptible: true - -license_scanning: - interruptible: true \ No newline at end of file + - template: Security/License-Scanning.gitlab-ci.yml \ No newline at end of file