Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
27417ccf
Commit
27417ccf
authored
Feb 25, 2019
by
Grzegorz Bizon
Committed by
Lin Jen-Shin
Mar 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Serverless CI/CD template
parent
f8b1ef92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
lib/gitlab/ci/templates/Serverless.gitlab-ci.yml
lib/gitlab/ci/templates/Serverless.gitlab-ci.yml
+39
-0
No files found.
lib/gitlab/ci/templates/Serverless.gitlab-ci.yml
0 → 100644
View file @
27417ccf
# GitLab Serverless template
image
:
alpine:latest
stages
:
-
build
-
deploy
.serverless:build:dockerfile:
variables
:
DOCKERFILE
:
"
Dockerfile"
stage
:
build
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
only
:
-
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
.serverless:deploy:image:
stage
:
deploy
image
:
gcr.io/triggermesh/tm@sha256:e3ee74db94d215bd297738d93577481f3e4db38013326c90d57f873df7ab41d5
only
:
-
master
environment
:
development
script
:
-
echo "$CI_REGISTRY_IMAGE"
-
tm -n "$KUBE_NAMESPACE" --config "$KUBECONFIG" deploy service "$CI_PROJECT_NAME" --from-image "$CI_REGISTRY_IMAGE" --wait
.serverless:deploy:functions:
stage
:
deploy
environment
:
development
image
:
gcr.io/triggermesh/tm:v0.0.9
script
:
-
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment