Skip to content

Commit

Permalink
Merge 817095a into 1140b32
Browse files Browse the repository at this point in the history
  • Loading branch information
afontainec committed Apr 9, 2019
2 parents 1140b32 + 817095a commit 6039205
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 6 deletions.
31 changes: 31 additions & 0 deletions .before_travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
language: node_js
node_js:
- "node"
addons:
postgresql: "9.5"
before_script:
- psql -c 'create database chinchay_test;' -U postgres
- psql -c 'create database chinchay2;' -U postgres
- npm i knex -g
- knex migrate:latest --env test
- node knexOtherMigrate.js
script:
- npm run test
- npm run coverage
- npm run linter
after_success:
- npm run coveralls
before_deploy:
- npm version patch
deploy:
- provider: npm
email: antonio.fontainecorrea@gmail.com
api_key: $NPM_TOKEN
on:
branch: master
- provider: script
skip_cleanup: true
script: .travis/pu.sh
on:
branch: master
tags: false
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// .eslintrc.js

module.exports = {
"extends": "airbnb",
Expand Down
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ script:
- npm run linter
after_success:
- npm run coveralls
before_deploy:
- npm version patch
deploy:
provider: npm
email: antonio.fontainecorrea@gmail.com
api_key: $NPM_TOKEN
provider: script
skip_cleanup: true
script: .travis/pu.sh
on:
branch: master
tags: false
44 changes: 44 additions & 0 deletions .travis/pu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

#!/bin/sh

setup_git() {
# Set the user name and email to match the API token holder
# This will make sure the git commits will have the correct photo
# and the user gets the credit for a checkin
git config --global user.email "afontaine@uc.cl"
git config --global user.name "antonio"
git config --global push.default matching

# Get the credentials from a file
git config credential.helper "store --file=.git/credentials"

# This associates the API Key with the account
echo "https://${GITHUB_API_KEY}:@github.com" > .git/credentials
}

make_version() {
# Make sure that the workspace is clean
# It could be "dirty" if
# 1. package-lock.json is not aligned with package.json
# 2. npm install is run
git checkout -- .

# Echo the status to the log so that we can see it is OK
git status

# Run the deploy build and increment the package versions
# %s is the placeholder for the created tag
npm version patch -m "chore: release version %s [skip ci]"
}

upload_files() {
# This make sure the current work area is pushed to the tip of the current branch
git push origin HEAD:$TRAVIS_BRANCH

# This pushes the new tag
git push --tags
}

setup_git
make_version
upload_files

0 comments on commit 6039205

Please sign in to comment.