Skip to content

Commit

Permalink
Remove s3cmd variable
Browse files Browse the repository at this point in the history
  • Loading branch information
justaddcoffee committed May 13, 2020
1 parent c58cb85 commit 7fcd41b
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ pipeline {
echo "Will not push if not on correct branch."
} else {
withCredentials([file(credentialsId: 's3cmd_kg_hub_push_configuration', variable: 'S3CMD_JSON')]) {
def s3cmd_with_args = 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text'
sh '${s3cmd_with_args} --cf-invalidate put -r data/raw s3://kg-hub-public-data/'
sh 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate put -r data/raw s3://kg-hub-public-data/'
}
}
} else { // 'run.py download' failed - let's try to download last good copy of raw/ from s3 to data/
withCredentials([file(credentialsId: 's3cmd_kg_hub_push_configuration', variable: 'S3CMD_JSON')]) {
def s3cmd_with_args = 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text'
sh 'rm -fr data/raw || true;'
sh 'mkdir -p data/raw || true'
sh '${s3cmd_with_args} get -r s3://kg-hub-public-data/raw/ data/raw/'
sh 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text' get -r s3://kg-hub-public-data/raw/ data/raw/'
}
}
}
Expand All @@ -87,16 +85,14 @@ pipeline {
echo "Will not push if not on correct branch."
} else {
withCredentials([file(credentialsId: 's3cmd_kg_hub_push_configuration', variable: 'S3CMD_JSON')]) {
def s3cmd_with_args = 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text'
sh '${s3cmd_with_args} --cf-invalidate put -r data/transformed s3://kg-hub-public-data/'
sh 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text --cf-invalidate put -r data/transformed s3://kg-hub-public-data/'
}
}
} else { // 'run.py transform' failed - let's try to download last good copy of transformed/ from s3 to data/
withCredentials([file(credentialsId: 's3cmd_kg_hub_push_configuration', variable: 'S3CMD_JSON')]) {
def s3cmd_with_args = 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text'
sh 'rm -fr data/transformed || true;'
sh 'mkdir -p data/transformed || true'
sh '${s3cmd_with_args} get -r s3://kg-hub-public-data/transformed/ data/transformed/'
sh 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text get -r s3://kg-hub-public-data/transformed/ data/transformed/'
}
}
}
Expand Down Expand Up @@ -130,9 +126,8 @@ pipeline {
echo "Will not push if not on correct branch."
} else {
withCredentials([file(credentialsId: 's3cmd_kg_hub_push_configuration', variable: 'S3CMD_JSON')]) {
def s3cmd_with_args = 's3cmd -c $S3CMD_JSON --acl-public --mime-type=plain/text'
sh '${s3cmd_with_args} --cf-invalidate put merged-kg.nt.gz s3://kg-hub-public-data/kg-covid-19.nt.gz'
sh '${s3cmd_with_args} --cf-invalidate put merged-kg.tar.gz s3://kg-hub-public-data/kg-covid-19.tar.gz'
sh '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 '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://kg-hub.berkeleybop.io/[artifact name]
}
Expand Down

0 comments on commit 7fcd41b

Please sign in to comment.