Skip to content

Commit

Permalink
Missing withcredentials block
Browse files Browse the repository at this point in the history
  • Loading branch information
justaddcoffee committed May 6, 2020
1 parent 872d832 commit 5d2889a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ pipeline {
def run_py_dl = sh(
script: 'cd config;. venv/bin/activate; python3.7 run.py download', returnStatus: true
)
if (run_py_dl == 0) { // upload raw to s3
sh 'cd config; s3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate put -r data/raw s3://kg-hub-public-data/raw'
} else { // 'run.py download' failed - let's try to download last good copy of raw/ from s3 to data/
sh 'cd config; rm -fr data/raw'
sh 'cd config; s3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate get -r s3://kg-hub-public-data/raw data/'
withCredentials([file(credentialsId: 's3cmd_kg_hub_push_configuration', variable: 'S3CMD_JSON')]) {
if (run_py_dl == 0) { // upload raw to s3
sh 'cd config; s3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate put -r data/raw s3://kg-hub-public-data/raw'
} else { // 'run.py download' failed - let's try to download last good copy of raw/ from s3 to data/
sh 'cd config; rm -fr data/raw'
sh 'cd config; s3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate get -r s3://kg-hub-public-data/raw data/'
}
}
}
}
Expand Down Expand Up @@ -87,7 +89,7 @@ pipeline {
sh 'cd config; s3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate put merged-kg.nt.gz s3://kg-hub-public-data/kg-covid-19.nt.gz'
sh 'cd config; s3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate put merged-kg.tar.gz s3://kg-hub-public-data/kg-covid-19.tar.gz'
// Should now appear at:
// https://idg.berkeleybop.io/[artifact name]
// https://kg-hub.berkeleybop.io/[artifact name]
}

}
Expand Down

0 comments on commit 5d2889a

Please sign in to comment.