Skip to content

Commit

Permalink
Merge pull request #182 from lorengordon/ci-make
Browse files Browse the repository at this point in the history
Uses make to deploy to s3
  • Loading branch information
lorengordon authored Apr 20, 2018
2 parents cf4e078 + 115803d commit 3ef7b39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.4
current_version = 0.0.5
commit = True
message = Bumps version to {new_version}
tag = False
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ jobs:
- aws --version
deploy:
provider: script
script: >-
aws s3 sync --delete --exclude '.git/*' $TRAVIS_BUILD_DIR s3://$BUCKET/repos/$REPO &&
aws s3api list-objects --bucket $BUCKET --query "Contents[?starts_with(Key, ``repos/$REPO/``)].{Key:Key}" --out text | xargs -n1 -P8 -I {} -t aws s3api put-object-tagging --bucket $BUCKET --tagging "TagSet=[{Key=Version,Value=$TRAVIS_TAG}]" --key {}
script: BUCKET=$BUCKET PREFIX=repos/$REPO/ VERSION=$TRAVIS_TAG make deploy
on: # yamllint disable-line rule:truthy
tags: true
repo: $DEPLOY_SLUG
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: deploy

deploy:
@echo "make: Deploying files to S3 bucket, using aws sync"
aws s3 sync --delete --exclude '.git/*' . s3://$(BUCKET)/$(PREFIX)
@echo "make: Applying version tag to bucket objects"
aws s3api list-objects --bucket $(BUCKET) --query "Contents[?starts_with(Key, `$(PREFIX)`)].{Key:Key}" --out text | xargs -n1 -P8 -I {} -t aws s3api put-object-tagging --bucket $(BUCKET) --tagging "TagSet=[{Key=Version,Value=$(VERSION)}]" --key {}

0 comments on commit 3ef7b39

Please sign in to comment.