-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add automated versioning and deployment (#10) * Remove automatic versioning
- Loading branch information
1 parent
6bc5bf8
commit fb53dc6
Showing
1 changed file
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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$ |