forked from dittowords/ditto-ce-connector
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre.yml
52 lines (48 loc) · 1.63 KB
/
.pre.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
name: ce-connector-ditto
jobs:
- name: build-{{.PR}}
node: build
triggers:
githubHook: true
commands:
- docker build -f docker/Dockerfile -t 053497547689.dkr.ecr.eu-central-1.amazonaws.com/ce-connector-ditto/app:PRE-{{.PR}} .
- docker push 053497547689.dkr.ecr.eu-central-1.amazonaws.com/ce-connector-ditto/app:PRE-{{.PR}}
- name: deploy-{{.PR}}
node: ditto-{{.PR}}
instance:
size: small
health:
port: 80
statusCode: 200
path: /health
triggers:
upstream: build-{{.PR}}
commands:
- cp docker/.env.default .env
- TAG=PRE-{{.PR}} docker-compose -f docker/docker-compose.yml -f docker/docker-compose.override.pre.yml pull
- TAG=PRE-{{.PR}} docker-compose -f docker/docker-compose.yml -f docker/docker-compose.override.pre.yml up -d
{{ if eq .PR "main"}}
- name: release
noAgent: true
triggers:
upstream: deploy-main
pipeline: |
node("build") {
git(branch: 'main', credentialsId: 'LOKALISE_KARGO_GITHUB_APP', url: 'https://github.com/lokalise/ce-connector-ditto.git')
properties([
[$class: 'BuildBlockerProperty', useBuildBlocker: false],
disableConcurrentBuilds(),
])
echo "Release started..."
stage("Create a git tag") {
withCredentials([
string(credentialsId: 'GH_TOKEN', variable: 'GITHUB_TOKEN'),
string(credentialsId: 'DOCKER_PASSWORD', variable: 'REGISTRY_PASSWORD')
]) {
sh '''
docker/scripts/release.sh git_tag $(git rev-parse HEAD)
'''
}
}
}
{{ end }}