diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-02-26 12:15:20 +0100 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-03-04 21:09:38 +0800 |
commit | f5579abc9aa059b7820dea5b66ead10ce4118b89 (patch) | |
tree | c8700368c0f2713cfbc3aac7e1f28f150bd704e6 | |
parent | 27417ccf3cd4c6e9318f8671c02400352dbdaa9f (diff) | |
download | gitlab-ce-f5579abc9aa059b7820dea5b66ead10ce4118b89.tar.gz |
Make it possible to easily deploy serverless functions
This commits add a job that is going to be triggered whenever someone
adds `[serverless deploy-functions]` text into their commit message.
This make it really simple to deploy functions in FaaS-only project.
-rw-r--r-- | lib/gitlab/ci/templates/Serverless.gitlab-ci.yml | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml b/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml index 3f7a8190e99..99a73826cf6 100644 --- a/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Serverless.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: - build - deploy -.serverless:build:dockerfile: +.serverless:build:image: variables: DOCKERFILE: "Dockerfile" stage: build @@ -14,7 +14,8 @@ stages: name: gcr.io/kaniko-project/executor:debug entrypoint: [""] only: - - master + refs: + - master script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/$DOCKERFILE --destination $CI_REGISTRY_IMAGE @@ -23,7 +24,8 @@ stages: stage: deploy image: gcr.io/triggermesh/tm@sha256:e3ee74db94d215bd297738d93577481f3e4db38013326c90d57f873df7ab41d5 only: - - master + refs: + - master environment: development script: - echo "$CI_REGISTRY_IMAGE" @@ -37,3 +39,10 @@ stages: - tm -n "$KUBE_NAMESPACE" set registry-auth gitlab-registry --registry "$CI_REGISTRY" --username "$CI_REGISTRY_USER" --password "$CI_JOB_TOKEN" --push - tm -n "$KUBE_NAMESPACE" set registry-auth gitlab-registry --registry "$CI_REGISTRY" --username "$CI_DEPLOY_USER" --password "$CI_DEPLOY_PASSWORD" --pull - tm -n "$KUBE_NAMESPACE" deploy --wait + +deploy-functions: + extends: .serverless:deploy:functions + environment: production + only: + variables: + - $CI_COMMIT_MESSAGE =~ /\[serverless deploy-functions\]/ |