-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.yaml
58 lines (50 loc) · 1.81 KB
/
build.yaml
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
name: $(Date:yyyyMMdd)$(Rev:.r)
trigger:
branches:
include:
- main
pool: 'hetzner04'
variables:
- group: catracker-secrets
steps:
- task: Bash@3
displayName: Prepare
inputs:
targetType: 'inline'
script: |
kubectl cluster-info
cd $(Build.SourcesDirectory)/frontend
npm i
npm run build
- task: Docker@2
displayName: Build the image
inputs:
workingDirectory: $(Build.SourcesDirectory)/frontend
repository: eblovich/catracker-http
command: buildAndPush
addPipelineData: false
dockerfile: '$(Build.SourcesDirectory)/frontend/Dockerfile'
tags: $(Build.BuildNumber)
- task: Bash@3
displayName: Prepare dockerfile for image
inputs:
targetType: 'inline'
script: |
docker run -u 1000:1002 -i --log-driver=none -a stdin -a stdout -a stderr -e COURSIER_CACHE=/cache/coursier -v /usr/bin/docker:/sbin/docker -v /var/run/docker.sock:/var/run/docker.sock -v $(Build.SourcesDirectory):/root: -v /data/cache/agent:/cache --rm hseeberger/scala-sbt:graalvm-ce-20.0.0-java11_1.3.13_2.13.3 sbt -Dsbt.global.base=/cache/.sbt -Dsbt.boot.directory=/cache/.sbt -Divy.home=/cache/.ivy2 -Dsbt.ivy.home=/cache/.ivy2 compile docker:stage
- task: Docker@2
displayName: Build the image
inputs:
workingDirectory: $(Build.SourcesDirectory)
repository: eblovich/catracker-service
command: buildAndPush
addPipelineData: false
dockerfile: '$(Build.SourcesDirectory)/target/docker/stage/Dockerfile'
tags: $(Build.BuildNumber)
- task: Bash@3
displayName: Deploy site
inputs:
targetType: 'inline'
script: |
export APP_VERSION=$(Build.BuildNumber)
export DATABASE_PASSWORD=$(DATABASE_PASSWORD)
cat deployment.yaml | envsubst | kubectl apply -f -