forked from gocms-io/gocms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·30 lines (25 loc) · 1018 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
GOCMS_VERSION=0.0.$TRAVIS_BUILD_NUMBER
GOCMS_VER_FILE="versions.txt"
# vars for testing. comment out for release.
#AWS_SECRET=
#AWS_BUCKET=
#AWS_KEY=
#TRAVIS_BRANCH=
#TRAVIS_BUILD_NUMBER=
#TRAVIS_COMMIT=
# get ver file
curl http://release.gocms.io/$TRAVIS_BRANCH/$GOCMS_VER_FILE --output $GOCMS_VER_FILE
echo "$GOCMS_VERSION" >> $GOCMS_VER_FILE
# copy files to s3
echo copy files to current release dir
AWS_ACCESS_KEY_ID=$AWS_KEY AWS_SECRET_ACCESS_KEY=$AWS_SECRET aws s3 cp \
--recursive bin/$TRAVIS_BRANCH/ s3://release.gocms.io/$TRAVIS_BRANCH/current/
# copy files to build number bucket
echo copy files to version release
AWS_ACCESS_KEY_ID=$AWS_KEY AWS_SECRET_ACCESS_KEY=$AWS_SECRET aws s3 cp \
--recursive s3://release.gocms.io/$TRAVIS_BRANCH/current/ s3://release.gocms.io/$TRAVIS_BRANCH/$GOCMS_VERSION/
# update version listing
echo update version listings
AWS_ACCESS_KEY_ID=$AWS_KEY AWS_SECRET_ACCESS_KEY=$AWS_SECRET aws s3 cp \
$GOCMS_VER_FILE s3://release.gocms.io/$TRAVIS_BRANCH/