Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Update/nextflow container #61

Merged
merged 14 commits into from
Sep 13, 2019
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ before_deploy:
- bash _scripts/configure-deploy.sh

deploy:
provider: script
script: bash _scripts/deploy.sh
skip_cleanup: true
on:
repo: aws-samples/aws-genomics-workflows
branch: master
- provider: script
script: bash _scripts/deploy.sh production
skip_cleanup: true
on:
repo: aws-samples/aws-genomics-workflows
branch: release
- provider: script
script: bash _scripts/deploy.sh test
skip_cleanup: true
on:
repo: aws-samples/aws-genomics-workflows
branch: master
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The documentation is built using mkdocs.
Install dependencies:

```bash
$ conda env create --file enviroment.yaml
$ conda env create --file environment.yaml
```

This will create a `conda` environment called `mkdocs`
Expand Down
86 changes: 65 additions & 21 deletions _scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,74 @@ set -e
bash _scripts/make-artifacts.sh
mkdocs build

ASSET_BUCKET=s3://aws-genomics-workflows
ASSET_STAGE=${1:-production}

echo "publishing artifacts:"
aws s3 sync \
--profile asset-publisher \
--acl public-read \
--delete \
./artifacts \
s3://aws-genomics-workflows/artifacts

function s3_uri() {
BUCKET=$1
shift

echo "publishing templates:"
aws s3 sync \
--profile asset-publisher \
--acl public-read \
--delete \
--metadata commit=$(git rev-parse HEAD) \
./src/templates \
s3://aws-genomics-workflows/templates
IFS=""
PREFIX_PARTS=("$@")
PREFIX_PARTS=(${PREFIX_PARTS[@]})
PREFIX=$(printf '/%s' "${PREFIX_PARTS[@]%/}")

echo "${BUCKET%/}/${PREFIX:1}"
}


echo "publishing site"
aws s3 sync \
--acl public-read \
--delete \
./site \
s3://docs.opendata.aws/genomics-workflows
function artifacts() {
S3_URI=$(s3_uri $ASSET_BUCKET $ASSET_STAGE_PATH "artifacts")

echo "publishing artifacts: $S3_URI"
aws s3 sync \
--profile asset-publisher \
--acl public-read \
--delete \
./artifacts \
$S3_URI
}

function templates() {
S3_URI=$(s3_uri $ASSET_BUCKET $ASSET_STAGE_PATH "templates")

echo "publishing templates: $S3_URI"
aws s3 sync \
--profile asset-publisher \
--acl public-read \
--delete \
--metadata commit=$(git rev-parse HEAD) \
./src/templates \
$S3_URI
}

function site() {
echo "publishing site"
aws s3 sync \
--acl public-read \
--delete \
./site \
s3://docs.opendata.aws/genomics-workflows
}

function all() {
artifacts
templates
site
}

case $STAGE in
production)
ASSET_STAGE_PATH=""
all
;;
test)
ASSET_STAGE_PATH="test"
artifacts
templates
;;
*)
echo "unsupported staging level"
exit 1
esac
Loading