forked from suyuan32/simple-admin-file
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
40 lines (35 loc) · 851 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
variables:
VERSION: 0.0.1
REPO: docker.io
stages:
- info
- build
- publish
- clean
info-job:
stage: info
script:
- echo "Start build version $VERSION"
- export VERSION=$VERSION
- export DOCKER_USERNAME=$DOCKER_USERNAME
- export DOCKER_PASSWORD=$DOCKER_PASSWORD
- export REPO=$REPO
build-job:
stage: build
script:
- echo "Compiling the code and build docker image..."
- make docker
- echo "Compile complete."
deploy-job:
stage: publish
environment: production
script:
- echo "Publish docker images..."
- make publish-docker
- echo "Docker images successfully published."
clean-job:
stage: clean
script:
# 删除所有 none 镜像 | delete all none images
- docker images |grep none|awk '{print $3}'|xargs docker rmi
- echo "Delete all none images successfully."