Created
October 15, 2020 04:07
-
-
Save wickedev/0ec9b6df789aabec8126e109f56b28f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
gitlab_ci () { | |
gitlab-runner exec docker "$1" \ | |
--cache-dir=/tmp/gitlab-cache \ | |
--docker-cache-dir=/tmp/gitlab-cache \ | |
--docker-volumes=/tmp/gitlab-cache \ | |
--docker-volumes="$PWD"/deploy:/deploy \ | |
--env=DOCKER_CONFIG_JSON=/deploy/config.json \ | |
--env=DEPLOY_KUBECONFIG=/deploy/kubeconfig \ | |
--env=CI_REGISTRY_IMAGE=harbor.blah.co.kr/blah/web \ | |
--env=CI_COMMIT_SHORT_SHA=local-"$(git_hash)" | |
} | |
git_hash() { | |
git rev-parse --short=8 HEAD | |
} | |
gitlab_ci "test" | |
gitlab_ci "build" | |
gitlab_ci "push image" | |
gitlab_ci "deploy" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment