Skip to content

Commit

Permalink
ci: Utilize before_script in GitLab CI/CD. (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan authored Jan 28, 2024
1 parent c8ec825 commit 7c01ac7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ stages:
- ci
- release
default:
before_script:
- env | sort
image: ${CI_REGISTRY_IMAGE}:dev-py3.12
include: .gitlab/ci/**.yml
1 change: 0 additions & 1 deletion .gitlab/ci/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ ci:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- env | sort
- make dev
- make lint test doc build
stage: ci
6 changes: 2 additions & 4 deletions .gitlab/ci/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ doc:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- make dev-doc
- make doc
- make release-notes > release-notes.md
Expand All @@ -18,7 +17,6 @@ package:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- make publish
stage: release
pages:
Expand All @@ -31,7 +29,7 @@ pages:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- echo "Running the pages job."
stage: release
release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
Expand All @@ -43,5 +41,5 @@ release:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- echo "Running the release job."
stage: release
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ stages:
- ci
- release
default:
before_script:
- env | sort
image: ${CI_REGISTRY_IMAGE}:dev-py{{ default_py }}
include: .gitlab/ci/**.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ ci:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- env | sort
- make dev
- make lint test doc build
stage: ci
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ doc:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- make dev-doc
- make doc
- make release-notes > release-notes.md
Expand All @@ -18,7 +17,6 @@ package:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- make publish
stage: release
pages:
Expand All @@ -31,7 +29,7 @@ pages:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- echo "Running the pages job."
stage: release
release:
image: registry.gitlab.com/gitlab-org/release-cli:latest
Expand All @@ -43,5 +41,5 @@ release:
rules:
- if: $CI_COMMIT_TAG =~ /^v?(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-?(a|b|rc)(0|[1-9][0-9]*)?)?$/
script:
- env | sort
- echo "Running the release job."
stage: release

0 comments on commit 7c01ac7

Please sign in to comment.