Skip to content
Snippets Groups Projects
Commit e63ea812 authored by Peter Walter's avatar Peter Walter
Browse files

add aws deployment

parent 632d6638
No related branches found
No related tags found
No related merge requests found
......@@ -3,14 +3,18 @@ image: netroby/alpine-rsync
#project specific variables can be defines here, or overridden project settings
variables:
SERVER_DEV: ebi-cli.ebi.ac.uk
S3_BUCKET_DEV: dev.ebi.emblstatic.net
SCRIPT_DEV: ~/bin/update-ebi-framework
DEV_URL: http://wwwdev.ebi.ac.uk/web_guidelines/EBI-Framework
SERVER_PROD: ebi-cli.ebi.ac.uk
S3_BUCKET_PROD: origin.ebi.emblstatic.net
SCRIPT_PROD: ~/bin/update-ebi-framework-prod
PROD_URL: http://www.ebi.ac.uk/web_guidelines/EBI-Framework
# do not define here, put in project variables
SSH_USER: username
SSH_KEY: secret-key
AWS_KEY: key
AWS_SECRET: secret-key
#setup ssh keys
.deploy_setup: &deploy_setup
......@@ -44,3 +48,22 @@ deploy_live:
name: live
url: ${LIVE_URL}
deploy_aws_dev:
image: ebiwd/alpine-ssh
stage: deploy
before_script:
- add-aws-key ${AWS_KEY} ${AWS_SECRET}
script:
- bin/deploy-aws
only:
- branches
deploy_aws_live:
image: ebiwd/alpine-ssh
stage: deploy
before_script:
- add-aws-key ${AWS_KEY} ${AWS_SECRET}
script:
- bin/deploy-aws prod
only:
- tags
#!/bin/bash
# abort on error
set -e;
# abort on undefined variable
set -u;
# get current branch from git info
PROJECT=${CI_PROJECT_NAME};
BRANCH=${CI_COMMIT_REF_NAME};
# set project base
DEPLOY_PATH="web_guidelines/${PROJECT}/${BRANCH}";
if [ "${1:-''}" = "prod" ]; then
S3_BUCKET=${S3_BUCKET_PROD};
else
S3_BUCKET=${S3_BUCKET_DEV};
fi;
# push to AWS (exclude bin and .git)
aws s3 sync . s3://${S3_BUCKET}/${DEPLOY_PATH} \
--exclude ".git*" \
--exclude "bin/*" \
;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment