Skip to content

Commit 18a6d54

Browse files
authored
Automate the schema change in travis (#815)
* update submodule to latest master * Update .travis.yml * Update .travis.yml * minor * add +x * update script permission. * trial to get rid of "local" * more * disable ndt5 table schema update
1 parent 2f40dd0 commit 18a6d54

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

.travis.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ script:
132132
# Clean build and prepare for deployment
133133
- cd $TRAVIS_BUILD_DIR/cmd/etl_worker &&
134134
go build -v -ldflags "-X github.com/m-lab/go/prometheusx.GitShortCommit=$(git log -1 --format=%h)" .
135+
- cd $TRAVIS_BUILD_DIR/cmd/update-schema &&
136+
go build -v
135137
- cd $TRAVIS_BUILD_DIR
136138

137139
#################################################################################
@@ -204,6 +206,8 @@ deploy:
204206
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_sandbox
205207
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-sandbox
206208
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/etl_worker app-batch.yaml
209+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-sandbox
210+
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
207211
# && $TRAVIS_BUILD_DIR/etl-schema/schema/sync_tables_with_schema.sh mlab-sandbox batch nodryrun
208212
# && $TRAVIS_BUILD_DIR/etl-schema/schema/sync_tables_with_schema.sh mlab-sandbox base_tables nodryrun
209213
skip_cleanup: true
@@ -216,6 +220,8 @@ deploy:
216220
- provider: script
217221
script:
218222
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_sandbox
223+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-sandbox
224+
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
219225
# && $TRAVIS_BUILD_DIR/etl-schema/schema/sync_tables_with_schema.sh mlab-sandbox base_tables nodryrun
220226
skip_cleanup: true
221227
on:
@@ -233,6 +239,8 @@ deploy:
233239
- provider: script
234240
script:
235241
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_sandbox
242+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-sandbox
243+
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
236244
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-sandbox
237245
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/etl_worker app-ndt.yaml
238246
skip_cleanup: true
@@ -269,7 +277,9 @@ deploy:
269277
## Service: etl-traceroute-parser -- AppEngine Flexible Environment.
270278
- provider: script
271279
script:
272-
$TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-sandbox
280+
$TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-sandbox
281+
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
282+
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-sandbox
273283
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/etl_worker app-traceroute.yaml
274284
skip_cleanup: true
275285
on:
@@ -280,7 +290,9 @@ deploy:
280290
## Service: etl-scamper-parser -- AppEngine Flexible Environment.
281291
- provider: script
282292
script:
283-
$TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-sandbox
293+
$TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-sandbox
294+
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
295+
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-sandbox
284296
SERVICE_ACCOUNT_mlab_sandbox $TRAVIS_BUILD_DIR/cmd/etl_worker app-scamper.yaml
285297
skip_cleanup: true
286298
on:
@@ -342,6 +354,9 @@ deploy:
342354
&&
343355
travis/kubectl.sh mlab-staging data-processing ./apply-cluster.sh
344356
&&
357+
$TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-staging
358+
SERVICE_ACCOUNT_mlab_staging $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
359+
&&
345360
$TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-staging
346361
SERVICE_ACCOUNT_mlab_staging $TRAVIS_BUILD_DIR/cmd/etl_worker app-ndt.yaml
347362
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-staging
@@ -391,6 +406,8 @@ deploy:
391406
- provider: script
392407
script:
393408
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_oti
409+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-oti
410+
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
394411
&& cd $TRAVIS_BUILD_DIR/functions
395412
&& gcloud functions deploy createProdTaskOnFileNotification --project=mlab-oti --stage-bucket=functions-mlab-oti --trigger-event=providers/cloud.storage/eventTypes/object.change --trigger-resource=archive-mlab-oti
396413
&& gcloud functions deploy createProdTaskOnEmbargoFileNotification --project=mlab-oti --stage-bucket=functions-mlab-oti --trigger-event=providers/cloud.storage/eventTypes/object.change --trigger-resource=embargo-mlab-oti
@@ -413,6 +430,8 @@ deploy:
413430
- provider: script
414431
script:
415432
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_oti
433+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-oti
434+
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
416435
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-oti
417436
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/etl_worker app-traceroute.yaml
418437
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-oti
@@ -432,6 +451,8 @@ deploy:
432451
- provider: script
433452
script:
434453
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_oti
454+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-oti
455+
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
435456
&& gcloud app deploy --project=mlab-oti $TRAVIS_BUILD_DIR/appengine/queue.yaml
436457
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-oti
437458
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/etl_worker app-batch.yaml
@@ -448,6 +469,8 @@ deploy:
448469
- provider: script
449470
script:
450471
$TRAVIS_BUILD_DIR/travis/activate_service_account.sh SERVICE_ACCOUNT_mlab_oti
472+
&& $TRAVIS_BUILD_DIR/travis/run_with_application_credentials.sh mlab-oti
473+
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/update-schema update-schema
451474
&& gcloud app deploy --project=mlab-oti $TRAVIS_BUILD_DIR/appengine/queue.yaml
452475
&& $TRAVIS_BUILD_DIR/travis/deploy_app.sh mlab-oti
453476
SERVICE_ACCOUNT_mlab_oti $TRAVIS_BUILD_DIR/cmd/etl_worker app-ndt.yaml

cmd/update-schema/update.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,13 @@ func main() {
119119
if err := CreateOrUpdatePT(project, "batch", "traceroute"); err != nil {
120120
errCount++
121121
}
122+
/* Temporaily comment out due to NDT7 unstable schemas.
122123
if err := CreateOrUpdateNDTResultRow(project, "base_tables", "ndt5"); err != nil {
123124
errCount++
124125
}
125126
if err := CreateOrUpdateNDTResultRow(project, "batch", "ndt5"); err != nil {
126127
errCount++
127-
}
128+
}*/
128129

129130
case "tcpinfo":
130131
if err := CreateOrUpdateTCPInfo(project, "base_tables", "tcpinfo"); err != nil {

travis

0 commit comments

Comments
 (0)