forked from dbolkensteyn/kubernetes-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scientists-job.yaml
51 lines (51 loc) · 1.59 KB
/
scientists-job.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
apiVersion: batch/v1
kind: Job
metadata:
name: peach-java-%PROJECT-NAME%
labels:
jobgroup: peach-java
spec:
backoffLimit: 0
template:
metadata:
name: peach-java
labels:
jobgroup: peach-java
spec:
containers:
- name: peach-java
image: maven:3.5.3-jdk-8
volumeMounts:
- mountPath: /peachee-java-flat
name: peachee-java-flat
env:
- name: PROJECT
value: "%PROJECT%"
- name: SONAR_OPTS
valueFrom:
secretKeyRef:
name: sonar
key: opts
- name: GCLOUD_STORAGE_TOKEN # gcloud auth print-access-token
valueFrom:
secretKeyRef:
name: gcloud-storage
key: token
command: ["sh", "-c"]
args:
- "/peachee-java-flat/peachee-java-flat/$(PROJECT)/checkout.sh &&
cd /project &&
mkdir /dump &&
mvn clean package org.sonarsource.scanner.maven:sonar-maven-plugin:LATEST:sonar -B -e -DskipTests -Dsonar.projectKey=\"%PROJECT%\" -Dsonar.projectName=\"%PROJECT%\" $SONAR_OPTS &&
export dump_file=dump-$PROJECT.tar.gz &&
tar cjf $dump_file /dump &&
curl --upload-file $dump_file -H \"Authorization: Bearer $GCLOUD_STORAGE_TOKEN\" \"https://storage.googleapis.com/scientists/issues/$dump_file\"
"
resources:
requests:
cpu: 0.51
volumes:
- name: peachee-java-flat
gitRepo:
repository: "https://github.com/dbolkensteyn/peachee-java-flat.git"
restartPolicy: Never