-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
67 lines (58 loc) · 1.53 KB
/
.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
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
stages:
- build
- test
- build-docker-images
- deploy
cache:
key: one-key-to-rule-them-all
paths:
- ./.m2/repository
- ./node_modules
variables:
IMAGE_TAGGED: $CI_REGISTRY_IMAGE:$CI_PIPELINE_IID
# ------------------------------------------------------------------------------
lint:
image: clojure:temurin-17-alpine
script:
- clojure -Sdeps '{:mvn/local-repo "./.m2/repository"}' -M:clj-kondo --lint src
allow_failure: true
when: always
up-to-date?:
image: clojure:temurin-17-alpine
script:
- clojure -Sdeps '{:mvn/local-repo "./.m2/repository"}' -M:outdated
allow_failure: true
when: always
# ------------------------------------------------------------------------------
build-image:
image: docker
tags:
- ht
services:
- docker:dind
stage: build-docker-images
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- >
docker build -f Dockerfile --pull
-t $IMAGE_TAGGED .
- docker push $IMAGE_TAGGED
- docker tag $IMAGE_TAGGED $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
only:
- main
# ------------------------------------------------------------------------------
deploy:
image:
name: bitnami/kubectl:latest
entrypoint: [""]
variables:
HOME: "/tmp"
stage: deploy
before_script:
- mkdir $HOME/.kube
- echo "$KUBECONFIG_COMPLETE" >> $HOME/.kube/config
script:
- kubectl -n schnaq-academy set image deployment/academy academy=$CI_REGISTRY_IMAGE:$CI_PIPELINE_IID
only:
- main