forked from curioswitch/curiostack
-
Notifications
You must be signed in to change notification settings - Fork 1
/
cloudbuild.yaml
87 lines (86 loc) · 2.6 KB
/
cloudbuild.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
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
---
steps:
- id: curio-generated-fetch-source
name: gcr.io/cloud-builders/git
waitFor:
- '-'
entrypoint: bash
args:
- '-c'
- |
# Cloud Build does not copy in the git repo, just source files, so we can't compute a diff.
# Check out the code again using git.
ls -A1 | xargs rm -rf
git clone https://github.com/curioswitch/curiostack . --depth=10
env:
- CI=true
- id: curio-generated-fetch-builder-image
waitFor:
- '-'
name: ghcr.io/curioswitch/cloud-builder
entrypoint: bash
args:
- -c
- echo Fetched builder image.
- id: curio-generated-fetch-compressed-build-cache
waitFor:
- '-'
name: curiostack/gsutil-lz4
volumes:
- name: gradle-wrapper
path: /root/.gradle/wrapper
- name: gradle-caches
path: /root/.gradle/caches
- name: curiostack
path: /root/.gradle/curiostack
dir: /root/.gradle
entrypoint: ash
args:
- -c
- gsutil cp gs://curioswitch-gradle-build-cache/cloudbuild-cache-compressed.tar.lz4 /tmp/cloudbuild-cache-compressed.tar.lz4 && lz4 -dc /tmp/cloudbuild-cache-compressed.tar.lz4 | tar -xp || echo Could not fetch compressed build cache...
- id: curio-generated-build-all
waitFor:
- curio-generated-fetch-source
- curio-generated-fetch-compressed-build-cache
name: ghcr.io/curioswitch/cloud-builder
volumes:
- name: gradle-wrapper
path: /root/.gradle/wrapper
- name: gradle-caches
path: /root/.gradle/caches
- name: curiostack
path: /root/.gradle/curiostack
entrypoint: ./gradlew
args:
- continuousBuild
- --scan
- --stacktrace
- -Pcuriostack.revisionId=$REVISION_ID
env:
- CI=true
- CI_MASTER=true
- CLOUDBUILD_BUILD_ID=$BUILD_ID
- GRADLE_USER_HOME=/root/.gradle
secretEnv:
- CODECOV_TOKEN
- id: curio-generated-push-compressed-build-cache
waitFor:
- curio-generated-build-all
name: curiostack/gsutil-lz4
volumes:
- name: gradle-wrapper
path: /root/.gradle/wrapper
- name: gradle-caches
path: /root/.gradle/caches
- name: curiostack
path: /root/.gradle/curiostack
dir: /root/.gradle
entrypoint: ash
args:
- -c
- tar -cpf - wrapper caches curiostack/gcloud curiostack/miniconda-build curiostack/openjdk | lz4 -qc - | gsutil -o GSUtil:parallel_composite_upload_threshold=150M cp - gs://curioswitch-gradle-build-cache/cloudbuild-cache-compressed.tar.lz4
timeout: 60m
secrets:
- kmsKeyName: projects/curioswitch-cluster/locations/us-central1/keyRings/cloudbuild/cryptoKeys/github
secretEnv:
CODECOV_TOKEN: CiQAxdYgHOdQ5tY7WYjvBYlUsXk9g4GvELjEJZhEIFcxrkuDKY4STQA/OpLB7g9Gr8K5MZrwZXVDH/Ste1P6ZOFJl0TYILjU31c72w8Mmhde5JJv1VyEHW+67h8UARJHh6yOktrGFBU6wGzKDud0p6az3PoW