-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e084e0b
commit c9ed6ca
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This script takes as input the artifacts generated by build jobs and publishes the R packages | ||
# to a S3 hosted CRAN-like repository. Users can then install the packages using the commmand: | ||
# install.packages(<package-name>, repos="http://<S3_RAN>.synapse.org") | ||
|
||
# Params | ||
# AWS_ACCESS_KEY_ID -- S3 creds | ||
# AWS_SECRET_ACCESS_KEY -- S3 creds | ||
# S3_RAN -- either "staging-ran.synapse.org" or "ran.synapse.org" | ||
# ARTIFACTS_DIR -- the directory where the artifacts are copied to | ||
|
||
home=`pwd` | ||
|
||
# remove the last build clone | ||
set +e | ||
rm -R ${S3_RAN} | ||
set -e | ||
|
||
# retrieving the current content of S3_RAN | ||
mkdir ${S3_RAN} | ||
cd ${S3_RAN} | ||
aws s3 sync s3://${S3_RAN}/ . | ||
cd .. | ||
|
||
curl -o deploy.R https://raw.githubusercontent.com/Sage-Bionetworks/CI-Build-Tools/master/r-pkg/deploy.R | ||
|
||
R -e "source('$home/deploy.R');\ | ||
jenkins_deploy('$home/$S3_RAN', '$ARTIFACTS_DIR')" | ||
|
||
# upload | ||
cd ${S3_RAN} | ||
aws s3 sync --acl public-read . s3://${S3_RAN}/ | ||
cd .. | ||
|
||
# This section is removed because gh-action | ||
# cleans up the home dir | ||
# clean up | ||
# rm -rf $home |