Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-02-26 14:15:20 +0300
committerLin Jen-Shin <godfat@godfat.org>2019-03-04 16:09:38 +0300
commitf5579abc9aa059b7820dea5b66ead10ce4118b89 (patch)
treec8700368c0f2713cfbc3aac7e1f28f150bd704e6 /lib
parent27417ccf3cd4c6e9318f8671c02400352dbdaa9f (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/templates/Serverless.gitlab-ci.yml15
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\]/