forked from group-butler/GroupButler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
42 lines (39 loc) · 876 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
stages:
- lint
- build
# - test
- deploy
lint:
stage: lint
script:
- docker run --rm -v $(pwd):/data yangm97/luacheck || [ "$?" -le "1" ]
build:
stage: build
variables:
IMAGE: $CI_REGISTRY_IMAGE
TAG: $CI_COMMIT_REF_SLUG
before_script:
- apk add --no-cache py-pip
- pip install docker-compose
script:
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker-compose build
- docker-compose push
only:
- staging
- production
deploy:
environment:
name: $CI_COMMIT_REF_SLUG
tags:
- manager
stage: deploy
variables:
IMAGE: $CI_REGISTRY_IMAGE
TAG: $CI_COMMIT_REF_SLUG
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker stack deploy --with-registry-auth $CI_COMMIT_REF_SLUG -c docker-compose.yml
only:
- staging
- production