Deploy stage to S3
This commit is contained in:
parent
3872481a0d
commit
11fe52bcc2
1 changed files with 40 additions and 8 deletions
|
@ -4,6 +4,10 @@ cache:
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
|
||||||
|
variables:
|
||||||
|
S3_BUCKET_NAME: recettes.inf3.ch
|
||||||
|
AWS_BUCKET_REGION: us-east-1
|
||||||
|
|
||||||
node-build:
|
node-build:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
|
@ -14,13 +18,41 @@ node-build:
|
||||||
paths:
|
paths:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
metalsmith-deploy:
|
deploys3-branch:
|
||||||
image: kyleondy/alpine-rsync
|
image: "python:latest"
|
||||||
stage: deploy
|
stage: deploy
|
||||||
tags:
|
before_script:
|
||||||
- pages
|
- pip install awscli
|
||||||
only:
|
|
||||||
- master
|
|
||||||
script:
|
script:
|
||||||
- mkdir -p /volumes/output/recettes
|
- aws s3 cp build s3://${S3_BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive
|
||||||
- rsync -r build/ /volumes/output/recettes
|
environment:
|
||||||
|
name: ${CI_COMMIT_REF_SLUG}
|
||||||
|
url: http://${S3_BUCKET_NAME}.s3-website-${AWS_BUCKET_REGION}.amazonaws.com/${CI_COMMIT_REF_SLUG}
|
||||||
|
on_stop: deploys3-clean
|
||||||
|
except:
|
||||||
|
- /^master$/
|
||||||
|
|
||||||
|
deploys3-master:
|
||||||
|
image: "python:latest"
|
||||||
|
stage: deploy
|
||||||
|
before_script:
|
||||||
|
- pip install awscli
|
||||||
|
script:
|
||||||
|
- aws s3 cp . s3://${S3_BUCKET_NAME}/ --recursive
|
||||||
|
environment:
|
||||||
|
name: ${CI_COMMIT_REF_SLUG}
|
||||||
|
url: http://${S3_BUCKET_NAME}.s3-website-${AWS_BUCKET_REGION}.amazonaws.com/
|
||||||
|
only:
|
||||||
|
- /^master$/
|
||||||
|
|
||||||
|
deploys3-clean:
|
||||||
|
image: "python:latest"
|
||||||
|
stage: deploy
|
||||||
|
before_script:
|
||||||
|
- pip install awscli
|
||||||
|
script:
|
||||||
|
- aws s3 rm s3://${S3_BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive
|
||||||
|
environment:
|
||||||
|
name: ${CI_COMMIT_REF_SLUG}
|
||||||
|
action: stop
|
||||||
|
when: manual
|
||||||
|
|
Loading…
Add table
Reference in a new issue