-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
54 lines (50 loc) · 1.26 KB
/
.drone.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
kind: pipeline
name: default
type: kubernetes
clone:
disable: true
steps:
- name: clone
image: alpine/git
commands:
- git clone -c http.sslVerify=false https://git.local/gitea/gitOps.git .
- git checkout $DRONE_COMMIT
- name: publish
image: plugins/kaniko
settings:
username:
from_secret: registry_username
password:
from_secret: registry_password
registry: git.local
repo: git.local/gitea/nyancat
skip_tls_verify: true
tags: latest
context: src/
digestFile: /tmp/digest
dockerfile: src/Dockerfile
depends_on:
- clone
- name: deploy
image: jonasbg/yq
commands:
- git config --global user.name "DroneCI"
- git config --global user.email "droneci@torden.tech"
- git clone -c http.sslVerify=false https://gitea:$GIT_PAT@git.local/gitea/gitOps.git gitOps
- cat /tmp/digest
- ls -lah
- cd gitOps
- git switch main
- echo "Image tag"
- export IMAGE_TAG="git.local/gitea/nyancat:${DRONE_COMMIT_SHA:0:7}"
- yq eval -i '.spec.template.spec.containers[0]."image"=env(IMAGE_TAG)' cluster/project/nyan/deployment.yml
- git commit -am "IMAGE_TAG CHANGED $IMAGE_TAG"
- git push
environment:
GIT_PAT:
from_secret: registry_password
depends_on:
- publish
when:
event:
- pull_request