-
Notifications
You must be signed in to change notification settings - Fork 17
218 lines (196 loc) · 8.33 KB
/
release_batch_transformer.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: Release batch transformer
on:
push:
tags:
- '*'
jobs:
release-batch:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout Github
uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- name: Set up JDK 1.11 for batch transformer
uses: actions/setup-java@v1
with:
java-version: 1.11
name: build
- name: Get current SBT version
id: ver
run: |
export PROJECT_VERSION=$(sbt version -Dsbt.log.noformat=true | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n')
echo "::set-output name=project_version::$PROJECT_VERSION"
- name: Compare SBT version with git tag
run: |
tag=${GITHUB_REF##*/}
project_version=${{ steps.ver.outputs.project_version }}
if [[ "${tag}" = "${project_version}" ]]; then
echo "Tag version (${tag}) matches project version (${project_version}). Deploying!"
else
echo "Tag version (${tag}) doesn't match version in scala project (${project_version}). Aborting!"
exit 1
fi
- name: Build artifact
run: sbt "project transformerBatch" "set test in assembly := {}" assembly
- name: Set environmental variables
id: vars
run: |
export SOURCE_DIR=modules/transformer-batch/target/scala-2.12/assembled-jar
export DEST_DIR=4-storage/transformer-batch
echo "::set-output name=source_dir::$SOURCE_DIR"
echo "::set-output name=dest_dir::$DEST_DIR"
- name: Deploy to eu-west-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets
AWS_REGION: eu-west-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to us-east-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-us-east-1
AWS_REGION: us-east-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to us-west-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-us-west-1
AWS_REGION: us-west-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to us-west-2
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-us-west-2
AWS_REGION: us-west-2
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to sa-east-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-sa-east-1
AWS_REGION: sa-east-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to eu-central-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-eu-central-1
AWS_REGION: eu-central-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to ap-southeast-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-ap-southeast-1
AWS_REGION: ap-southeast-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to ap-southeast-2
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-ap-southeast-2
AWS_REGION: ap-southeast-2
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to ap-northeast-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-ap-northeast-1
AWS_REGION: ap-northeast-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to ap-south-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-ap-south-1
AWS_REGION: ap-south-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to us-east-2
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-us-east-2
AWS_REGION: us-east-2
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to ca-central-1
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-ca-central-1
AWS_REGION: ca-central-1
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to eu-west-2
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-eu-west-2
AWS_REGION: eu-west-2
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}
- name: Deploy to ap-northeast-2
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_S3_BUCKET: snowplow-hosted-assets-ap-northeast-2
AWS_REGION: ap-northeast-2
SOURCE_DIR: ${{ steps.vars.outputs.source_dir }}
DEST_DIR: ${{ steps.vars.outputs.dest_dir }}