This repository was archived by the owner on Apr 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathk8s-java-pipeline.yml
More file actions
111 lines (109 loc) · 2.62 KB
/
k8s-java-pipeline.yml
File metadata and controls
111 lines (109 loc) · 2.62 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
resource_types:
- name: slack-alert
type: docker-image
source:
repository: arbourd/concourse-slack-alert-resource
resources:
- name: source-code
type: git
icon: github-circle
source:
uri: ((git-uri))
branch: ((git-branch))
username: ((git-username))
password: ((git-password))
- name: notify
type: slack-alert
icon: slack
source:
url: ((slack-webhook))
jobs:
- name: run-unit-tests
plan:
- get: source-code
trigger: true
- task: compile-and-test
config:
platform: linux
image_resource:
type: docker-image
source:
repository: adoptopenjdk
tag: ((app-java-version))-jdk-hotspot
inputs:
- name: source-code
caches:
- path: source-code/maven
run:
path: /bin/bash
args:
- -c
- |
cd source-code
if [[ -d $PWD/maven && ! -d $HOME/.m2 ]]; then
ln -s "$PWD/maven" "$HOME/.m2"
fi
./mvnw package
on_success:
put: notify
params:
channel: ((slack-channel))
alert_type: success
message: "Unit tests passed: ((app))"
on_failure:
put: notify
params:
channel: ((slack-channel))
alert_type: failed
message: "Unit tests error: ((app))"
- name: update-deployment-manifest
plan:
- get: source-code
trigger: true
passed: [run-unit-tests]
- task: update-manifest
config:
platform: linux
image_resource:
type: docker-image
source:
repository: alexandreroman/pb-cli
tag: ((build-cli-version))
inputs:
- name: source-code
run:
path: /bin/bash
args:
- -c
- |
cat > image.yml << EOF
team: ((build-team))
source:
git:
url: ((git-uri))
revision: $(cat source-code/.git/ref)
build:
env:
- name: BP_JAVA_VERSION
value: ((app-java-version)).*
image:
tag: ((build-image))
EOF
cat image.yml
export BUILD_SERVICE_USERNAME=((build-username))
export BUILD_SERVICE_PASSWORD=((build-password))
pb api set ((build-target)) --skip-ssl-validation
pb login
pb image apply -f image.yml
on_success:
put: notify
params:
channel: ((slack-channel))
alert_type: success
message: "New build started: ((app))"
on_failure:
put: notify
params:
channel: ((slack-channel))
alert_type: failed
message: "Failed to start new build: ((app))"