Skip to content

Commit

Permalink
Add automated deployment (#10, #21)
Browse files Browse the repository at this point in the history
* Add automated versioning and deployment (#10)

* Remove automatic versioning
  • Loading branch information
koraytaylan authored Feb 3, 2019
1 parent 6bc5bf8 commit fb53dc6
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
language: node_js
services:
- docker
node_js:
- 10
cache: npm
cache:
directories:
- node_modules
env:
- DOCKER_IMAGE="emakinatr/makina-app"
script:
# Build and test
- npm run lint
- npm run build
- npm test
after_script:
- |
# Upload coverage to coveralls
npm install --save-dev coveralls
coveralls < ./coverage/lcov.info
# Coverage
- npm install coveralls --no-save
- coveralls < ./coverage/lcov.info
deploy:
provider: script
script:
- VERSION=`node -p -e "require('./package.json').version"`
- DOCKER_TAG=develop && [[ $TRAVIS_BRANCH == "master" ]] && DOCKER_TAG=latest
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull $DOCKER_IMAGE:$DOCKER_TAG
- docker build -t $DOCKER_IMAGE:$VERSION -t $DOCKER_IMAGE:$DOCKER_TAG --cache-from $DOCKER_IMAGE:$DOCKER_TAG .
- docker push $DOCKER_IMAGE:$VERSION
- docker push $DOCKER_IMAGE:$DOCKER_TAG
on:
all_branches: true
condition: $TRAVIS_BRANCH =~ ^develop|master$

0 comments on commit fb53dc6

Please sign in to comment.