statuper shell script - travis upload to S3

pull/78/head
Hunter Long 2018-10-04 22:02:51 -07:00
parent ddb2a10a7c
commit 7241040146
3 changed files with 29 additions and 9 deletions

View File

@ -32,6 +32,24 @@ env:
- GO_ENV=test - GO_ENV=test
- STATUP_DIR=$GOPATH/src/github.com/hunterlong/statup - STATUP_DIR=$GOPATH/src/github.com/hunterlong/statup
before_deploy:
- mv statuper build/statuper
- git config --local user.name "hunterlong"
- git config --local user.email "info@socialeck.com"
- make tag
deploy:
- provider: releases
api_key: $GH_TOKEN
skip_cleanup: true
- provider: s3
access_key_id: $AWS_KEY
secret_access_key: $AWS_SECRET
bucket: "assets.statup.io"
local_dir: build
region: us-west-2
skip_cleanup: true
matrix: matrix:
allow_failures: allow_failures:
- go: master - go: master
@ -42,7 +60,7 @@ notifications:
branches: branches:
except: except:
- /^v\d/ - /^v\d/
before_install: before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep - curl -L -s https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64 -o $GOPATH/bin/dep

View File

@ -1,4 +1,4 @@
VERSION=0.72 VERSION=0.73
BINARY_NAME=statup BINARY_NAME=statup
GOPATH:=$(GOPATH) GOPATH:=$(GOPATH)
GOCMD=go GOCMD=go

View File

@ -8,7 +8,10 @@ US_W_2="ami-7be8a103"
US_E_1="ami-7be8a103" US_E_1="ami-7be8a103"
US_E_2="ami-7be8a103" US_E_2="ami-7be8a103"
AWS_CLI=$(which aws) AWS_CLI=$(which aws)
DOCKER_CLI=$(which docker)
DOCKER_IMG="hunterlong/statup"
AWS_ECS="$AWS_CLI --output json" AWS_ECS="$AWS_CLI --output json"
DOCKER_PORT=8080
function usage() { function usage() {
cat <<EOM cat <<EOM
@ -154,11 +157,8 @@ function localTask {
} }
function dockerTask { function dockerTask {
echo "installing docker" echo "Starting Statup Docker container on port $DOCKER_PORT"
} $DOCKER_CLI run -d -p $DOCKER_PORT:8080 $DOCKER_IMG
function dockerComposeTask {
echo "installing docker compose"
} }
if [ "$BASH_SOURCE" == "$0" ]; then if [ "$BASH_SOURCE" == "$0" ]; then
@ -175,7 +175,6 @@ if [ "$BASH_SOURCE" == "$0" ]; then
while [[ $# -gt 0 ]] while [[ $# -gt 0 ]]
do do
key="$1" key="$1"
case $key in case $key in
-k|--aws-access-key) -k|--aws-access-key)
AWS_ACCESS_KEY_ID="$2" AWS_ACCESS_KEY_ID="$2"
@ -189,12 +188,15 @@ if [ "$BASH_SOURCE" == "$0" ]; then
AWS_DEFAULT_REGION="$2" AWS_DEFAULT_REGION="$2"
shift # past argument shift # past argument
;; ;;
-p|--port)
DOCKER_PORT="$2"
shift # past argument
;;
-x|--verbose) -x|--verbose)
VERBOSE=true VERBOSE=true
;; ;;
-v|--version) -v|--version)
echo ${VERSION} echo ${VERSION}
echo "$2"
usage usage
exit 2 exit 2
exit 0 exit 0