Last active
June 18, 2023 05:47
-
-
Save dimMaryanto93/fd40c02b1cc0d4eccb7c03103397591b to your computer and use it in GitHub Desktop.
gitlab-ci cources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job1: | |
image: alpine:latest | |
script: "echo 'Hi my name is Dimas Maryanto'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build-job: | |
stage: build | |
variables: | |
MY_NAME: "Dimas Maryanto" | |
script: | |
- echo "Hello, my name is $MY_NAME ! \n i'm trying to learn CI/CD feature with Gitlab CI" | |
## other jobs here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## other job here | |
test-job1: | |
stage: test | |
script: | |
- echo "This job tests something" | |
only: | |
- /-release/ | |
test-job2: | |
stage: test | |
script: | |
- echo "This job tests something, but takes more time than test-job1." | |
- echo "After the echo commands complete, it runs the sleep command for 20 seconds" | |
- echo "which simulates a test that runs 20 seconds longer than test-job1" | |
- sleep 20 | |
when: manual | |
deploy-prod: | |
stage: deploy | |
rules: | |
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^hotfix/ | |
when: manual | |
- if: $CI_COMMIT_REF_SLUG == $CI_DEFAULT_BRANCH | |
when: always | |
- when: never | |
script: | |
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch." | |
environment: production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build-job: | |
stage: build | |
script: | |
- echo "Hello, $GITLAB_USER_LOGIN!" | |
test-job1: | |
stage: test | |
script: | |
- echo "This job tests something" | |
test-job2: | |
stage: test | |
script: | |
- echo "This job tests something, but takes more time than test-job1." | |
- echo "After the echo commands complete, it runs the sleep command for 20 seconds" | |
- echo "which simulates a test that runs 20 seconds longer than test-job1" | |
- sleep 20 | |
deploy-prod: | |
stage: deploy | |
script: | |
- echo "This job deploys something from the $CI_COMMIT_BRANCH branch." | |
environment: production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment