-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
80 lines (72 loc) · 2.2 KB
/
.gitlab-ci.yml
File metadata and controls
80 lines (72 loc) · 2.2 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
image: docker:28.2.2
services:
- name: docker:28.2.2-dind
command: [ "--tls=false", "--mtu=1240" ]
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: tcp://docker:2375
DOCKER_REGISTRY: registry.nosi.cv
DOCKER_PROJECT: igrp
IMAGE_NAME: igrp-application-center
IMAGE_NAME_FULL: "$DOCKER_REGISTRY/$DOCKER_PROJECT/$IMAGE_NAME"
IMAGE_TAG: latest
stages:
- build
- manifest
- deploy
.build-template:
tags:
- nosi-runner
only:
- main
before_script:
- apk add --no-cache curl bash
- docker login -u "$DOCKER_REGISTRY_USERNAME" -p "$DOCKER_REGISTRY_PASSWORD" "$DOCKER_REGISTRY"
build-arm64:
stage: build
extends: .build-template
script:
- docker buildx create --use --name amd64builder
- docker buildx inspect --bootstrap
- docker build --build-arg SPRING_PROFILES_ACTIVE=$SPRING_PROFILES_ACTIVE --platform linux/arm64 -t $IMAGE_NAME_FULL:arm64 --push --output=type=image,name="$IMAGE_NAME_FULL:arm64",push=true .
tags:
- arm64
only:
- main
build-amd64:
extends: .build-template
tags:
- nosi-runner
stage: build
script:
- docker buildx create --use --name amd64builder
- docker buildx inspect --bootstrap
- docker build --build-arg SPRING_PROFILES_ACTIVE=$SPRING_PROFILES_ACTIVE --platform linux/amd64 -t $IMAGE_NAME_FULL:amd64 --push --output=type=image,name="$IMAGE_NAME_FULL:amd64",push=true .
only:
- main
create-manifest:
stage: manifest
tags:
- nosi-runner
script:
- docker login -u "$DOCKER_REGISTRY_USERNAME" -p "$DOCKER_REGISTRY_PASSWORD" "$DOCKER_REGISTRY"
- docker manifest create "$IMAGE_NAME_FULL:$IMAGE_TAG" --amend "$IMAGE_NAME_FULL:amd64" --amend "$IMAGE_NAME_FULL:arm64"
- docker manifest push $IMAGE_NAME_FULL:$IMAGE_TAG
needs:
- build-amd64
- build-arm64
only:
- main
deploy_dev:
image: gcc:latest
stage: deploy
only:
- env-dev
script:
- |
curl -u "$DEPLOY_USER_DEV:$DEPLOY_PASSWORD_DEV" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
'https://manager.nosi.cv/v3/project/c-m-2dwvbm6l:p-ftmmp/workloads/deployment:integration-hub:igrp-application-center?action=redeploy'