Created
January 25, 2019 11:02
-
-
Save zedtux/c28d660715d4a7f40bcf9f05a5b7e32d to your computer and use it in GitHub Desktop.
Gitlab AutoDevOps create_secret function extract
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
function create_secret() { | |
echo "Create secret..." | |
if [[ "$CI_PROJECT_VISIBILITY" == "public" ]]; then | |
return | |
fi | |
kubectl create secret -n "$KUBE_NAMESPACE" \ | |
docker-registry gitlab-registry \ | |
--docker-server="$CI_REGISTRY" \ | |
--docker-username="${CI_DEPLOY_USER:-$CI_REGISTRY_USER}" \ | |
--docker-password="${CI_DEPLOY_PASSWORD:-$CI_REGISTRY_PASSWORD}" \ | |
--docker-email="$GITLAB_USER_EMAIL" \ | |
-o yaml --dry-run | kubectl replace -n "$KUBE_NAMESPACE" --force -f - | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment