45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
|
# GitLab Serverless template
|
||
|
|
||
|
image: alpine:latest
|
||
|
|
||
|
stages:
|
||
|
- build
|
||
|
- deploy
|
||
|
|
||
|
.serverless:build:image:
|
||
|
variables:
|
||
|
DOCKERFILE: "Dockerfile"
|
||
|
stage: build
|
||
|
image:
|
||
|
name: gcr.io/kaniko-project/executor:debug
|
||
|
entrypoint: [""]
|
||
|
only:
|
||
|
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
|
||
|
|
||
|
.serverless:deploy:image:
|
||
|
stage: deploy
|
||
|
image: gcr.io/triggermesh/tm@sha256:e3ee74db94d215bd297738d93577481f3e4db38013326c90d57f873df7ab41d5
|
||
|
only:
|
||
|
refs:
|
||
|
- 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:build:functions:
|
||
|
stage: build
|
||
|
environment: development
|
||
|
image: registry.gitlab.com/gitlab-org/gitlabktl:latest
|
||
|
script: /usr/bin/gitlabktl serverless build
|
||
|
|
||
|
.serverless:deploy:functions:
|
||
|
stage: deploy
|
||
|
environment: development
|
||
|
image: registry.gitlab.com/gitlab-org/gitlabktl:latest
|
||
|
script: /usr/bin/gitlabktl serverless deploy
|