-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
45 lines (35 loc) · 1.1 KB
/
.gitlab-ci.yml
File metadata and controls
45 lines (35 loc) · 1.1 KB
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
43
44
45
stages:
- build
build-image:
stage: build
when: manual
image: docker:29.1.4
services:
- docker:29.1.4-dind-alpine3.23
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- APP_VERSION=`cat Cargo.toml | grep "version = " | head -1 | cut -d "=" -f2 | tr -d '"' | tr -d ' '`
- DOCKER_IMAGE=$CI_REGISTRY_IMAGE:$APP_VERSION
- DOCKER_BUILDKIT=1
- docker build --progress=plain -t $DOCKER_IMAGE -f Dockerfile .
- docker push $DOCKER_IMAGE
tags:
- linux
publish-image:
stage: build
needs: [build-image]
image: docker:29.1.4
services:
- docker:29.1.4-dind-alpine3.23
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- APP_VERSION=`cat Cargo.toml | grep "version = " | head -1 | cut -d "=" -f2 | tr -d '"' | tr -d ' '`
- DOCKER_IMAGE=$CI_REGISTRY_IMAGE:$APP_VERSION
- docker pull $DOCKER_IMAGE
- docker tag $DOCKER_IMAGE tinyops/pw:$APP_VERSION
- docker push tinyops/pw:$APP_VERSION
- docker rmi $DOCKER_IMAGE || true
tags:
- tinybull