This repository has been archived by the owner. It is now read-only.
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (100 sloc) 5.21 KB
language: go
env:
global:
# The location where the decrypted releaser key will be placed. The file
# ./scripts/releaser_key.enc is an encrypted version of this key generated
# using the Travis public key for this repo.
- RELEASER_KEY_PATH=./scripts/releaser_key
# DEPLOY_NODEJS_VERSION is the version of NodeJS for which to run the
# deploy scripts. All deploy targets have the condition to only deploy
# when the NODEJS_VERSION is equal to DEPLOY_NODEJS_VERSION to avoid
# deploying the same commit multiple times. This is necessary because
# Travis runs a new build for each NodeJS version in the build matrix
# for each commit.
#
# The selected version is arbitrary because the generated deployment
# files don't actually change depending on the NodeJs version -- the
# version simply must be one of the versions specified in the build
# matrix.
- DEPLOY_NODEJS_VERSION=6.9.0
# The Docker image that the Travis build should push to.
- KELDA_DOCKER_IMAGE=keldaio/kelda
matrix:
# We specify the two different Nodejs versions to test using an environment
# variable, rather than Travis's built-in language version testing,
# because go is the main language for the build. This is a work-around
# because Travis doesn't have built-in support multiple languages.
- NODEJS_VERSION=6.9.0
- NODEJS_VERSION=8.5.0
sudo: required
services:
- docker
go:
- 1.x
before_install:
- nvm install $NODEJS_VERSION
install:
- make get-build-tools
script:
- govendor test -i +local
- make -j 2 travis
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
slack:
secure: 0YSnrh9wEnohthlLcWdy7KJQ5VO4PEeP+1m9GVCqmNmDV6iEtyz7+iWoXfmXLJa0G1NrJrm6SH4Xm9bRDXweZJ9pCrXtBrDP7iiT3gQWmL60H5cwKejsXP8pjo61YI5StjAXKkhuI40AlRERcD8404rREFGhhejEGygz6FPEoolSVELBoHKVlYdDGAn+3j8DQA2xzheXX+8DKT7hNzkkJ6WCFgYDlI4PScST1/GvJyweK9eaC09O82tEqiObrgkZrWX6s0nNJTmfzNoTKaqyyGwRYAXFOrL5JvInmcab/4zQtuFNokWFrHu5j3kmt1Ypwqt4NAI/fzS9hUkP9hc7XWxckJZpXNbY5G/jScrwLM04LYq9gt74jHYhDsh+v03bUIgfWj4aR3xw6Dg4XT0/gjxKVQpU87ePfXD+b/sAxFwf0v17dzAJp/GcHQj+I3nX1cM5h2oKfjnOBRkNUDEo5UpnkuyT4TDsup3UCBkw2Ea5wjw+3lqXAIWWSMWbYYBtIGSyG5g7xl6DaQ3ziuC/l9Iagf1OWmdoxVssat/e9VH+JikQqdcbQty81++YSGkMtYNAshA2ynde8ysp2pf3bBY3Hx3T9KnOhKnpd5e/SqI+mtN/jSN8hx9D7iudMYXDzKGzVSHHHsHIgDd7iFOXtMamo0vOc0eR0nG5lHYjWhk=
before_deploy:
- make release prep-install docker-build-kelda
# Decrypt the SSH key used to upload releases to Jenkins.
- openssl aes-256-cbc -K $encrypted_e63862ef6e81_key -iv $encrypted_e63862ef6e81_iv
-in ${RELEASER_KEY_PATH}.enc -out ${RELEASER_KEY_PATH} -d && chmod 600 ${RELEASER_KEY_PATH}
# Setup the NPM auth token so that we can publish during deploy.
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
# Log in to Docker so that we can push the minion image.
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
deploy:
- provider: script
script: ./scripts/scp-to-jenkins ${RELEASER_KEY_PATH}
skip_cleanup: true
on:
condition: $NODEJS_VERSION == $DEPLOY_NODEJS_VERSION
tags: true
- provider: releases
api_key:
secure: mI8h+nDDYjmhxt+cLTqxPM5J7PdRXYPQusoYqjVLW9R9Q5U14fduatTYdiMCd3/Wag2JDLydRhYVxtfvY9VqGLJDP6nYaNrp8CVtBBgf+CnhIFtdOST5u0ekpeFDSvO36XPEaeM8TLdBgqljao3WFhkOZJ2mXhS3462qu6Y4BhiOko0p6OwOwPuibQ/23+8h1ITfxmj9Q+2WdqQkq1cF8Z6LP/bNOAK5+/1M5KoD7rbnliaSjcy349CWDqkNQay49hIHJXo519l68cZxiJtvq4FXG0qgNgpJ5wAY3iY9fHJZ5COJ61DRvMjs6EX43vviX1F+rXBkbXVE3q0T9ePhbe1Ph9Gq3ZOjw2Rz9gi0szDgNPES7kyTTrg1z1eqokVMSO1HofV1INfeFfHNn22zg+mezDm7KPbQV17G0Mtw71aYHsDFpJB9dMj/NKmHyAQU7n02TjQ/xo66RLJiEwq1YN23BdHhiDvcGuT4VusaOyuqpl73x7wJwJkSnJTpBvYlANCHsFWhRzyYJFlro+bEKAcsYlPEwX+d3laiGcz2xa76New0DuMtYsrHZt8yjMbv7Aq3MqCFLAJPGnSvxCQRv3oCrhrZ+Q+GJMXcsFOnd+rheLAXoSY4Qk0PD5qkMMZIJtaiw03C3tLIoZ+GM/55lgK3ylgW9RCutgCVxzrwQSk=
file:
- kelda_darwin
- kelda_linux
overwrite: true
skip_cleanup: true
on:
condition: $NODEJS_VERSION == $DEPLOY_NODEJS_VERSION
tags: true
- provider: script
script: npm publish js/install
skip_cleanup: true
on:
tags: true
condition: $TRAVIS_TAG != "dev" && $NODEJS_VERSION == $DEPLOY_NODEJS_VERSION
- provider: script
script: npm publish js/bindings
skip_cleanup: true
on:
tags: true
condition: $TRAVIS_TAG != "dev" && $NODEJS_VERSION == $DEPLOY_NODEJS_VERSION
- provider: script
script: docker push $KELDA_DOCKER_IMAGE:latest &&
git -c user.email="builds@travis-ci.com" -c user.name="Travis CI"
tag -fa dev -m "Autogenerated tag to track master branch" &&
git push -fq https://$GITHUB_KEY@github.com/kelda/kelda.git dev
skip_cleanup: true
on:
branch: "master"
condition: $NODEJS_VERSION == $DEPLOY_NODEJS_VERSION
- provider: script
script: docker tag $KELDA_DOCKER_IMAGE $KELDA_DOCKER_IMAGE:$TRAVIS_TAG &&
docker push $KELDA_DOCKER_IMAGE:$TRAVIS_TAG
skip_cleanup: true
on:
tags: true
condition: $NODEJS_VERSION == $DEPLOY_NODEJS_VERSION