Skip to content

Commit

Permalink
Merge b23088e into f188996
Browse files Browse the repository at this point in the history
  • Loading branch information
mrniket committed Oct 10, 2018
2 parents f188996 + b23088e commit 2949cdc
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 64 deletions.
139 changes: 82 additions & 57 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,94 @@ git:
depth: 9999999 # Building untagged builds needs enough depth to get the latest tag
stages:
- name: test
- name: release
if: branch = master OR branch = development
- name: deploy
if: branch = master
if: tag IS present
jobs:
include:
- stage: test
name: "Python Tests"
env:
- NODE_ENV=production
before_script:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.7.0
# Fix the kubectl context, as it's often stale.
- minikube update-context
# Wait for Kubernetes to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
before_install:
- nvm install node
- nvm use node
- gem install sass --version 3.3.4
install:
- pip install .
- pip install coveralls
- pushd game_frontend
- yarn
- node djangoBundler.js
- popd
script:
- python all_tests.py --coverage
after_success:
- coveralls
- name: "Javascript Tests"
before_install:
- nvm install node
- nvm use node
install:
- cd game_frontend && yarn
script:
- yarn test
- stage: deploy
env:
- NODE_ENV=production
before_install:
- nvm install node
- nvm use node
install:
- pushd game_frontend
- yarn
- popd
script:
- pushd game_frontend
- node djangoBundler.js
- popd
deploy:
include:
- stage: test
name: "Python Tests"
env:
- NODE_ENV=production
before_script:
# Download kubectl, which is a requirement for using minikube.
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Download minikube.
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.7.0
# Fix the kubectl context, as it's often stale.
- minikube update-context
# Wait for Kubernetes to be up and ready.
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done
before_install:
- nvm install node
- nvm use node
- gem install sass --version 3.3.4
install:
- pip install .
- pip install coveralls
- pushd game_frontend
- yarn
- node djangoBundler.js
- popd
script:
- python all_tests.py --coverage
after_success:
- coveralls
- name: "Javascript Tests"
before_install:
- nvm install node
- nvm use node
install:
- cd game_frontend && yarn
script:
- yarn test
- stage: release
script:
- bash tag_release_on_travis.sh
deploy:
- provider: releases
api_key:
secure: "dZxjTMW1+eAIw4gv71PKpaaL62BNcb2uWRf4ft1mVRRwsdNy5M1Vxv3YvOQGEYUO3TAo2xuvj/ifc1Yp6F1nCU7fLQaHllUljzU/Wa7gebv434TXMKfCbYLCFAylALF1Up0xhdaJaIEpEK9V4VqGeqhWcvAxi+fuFeK7CNgkvgxMINGAF96m3uU5CRKk4oU45ETifvFoWE8Kea73H32uisShqiECIsririOWZLKnm2YeGn3z26kKNjkn8wK4upWESCZUfP46FjFzV3EtT8RE51g6LFToaIls7fs99yLCwkX4xWBRdI0b6c5JvuaP4mukaXc6Ud9nREVmuOVsJ8mJbtnfl9hvfCdnzSpWR4x1ep6EinmPEX4Z1eBoeYXMkU31eOgdzXn+VpyT48W1rcrZxNCGe9Ln09OLlgNx5aYMDNAKrXiYkD55aMLFM7JLmX40DSez7EP8FFM5xALtNQnwun4ziGomf8Hl8GroYC+xNYIDMSpXVQBEc8s04dw3267tIPbA1p63CAHL/edAzn6bTtmvjLOI49o1fMLHls9ECW4/dKhalsPuZ4GUwqwIbf0WvTzNyvKjx65O+stDkxisDbVWVbXXNzGmbvvKJBo8SRymTM/THpavi+keps3kjUfmfmhImayG5fj5Z9G4r3KM77K+siQTvjjjg0t2hbLvyWI="
prerelease: true
target_commitish: development
skip_cleanup: true
on:
repo: ocadotechnology/aimmo
branch: development
- provider: releases
api_key:
secure: "dZxjTMW1+eAIw4gv71PKpaaL62BNcb2uWRf4ft1mVRRwsdNy5M1Vxv3YvOQGEYUO3TAo2xuvj/ifc1Yp6F1nCU7fLQaHllUljzU/Wa7gebv434TXMKfCbYLCFAylALF1Up0xhdaJaIEpEK9V4VqGeqhWcvAxi+fuFeK7CNgkvgxMINGAF96m3uU5CRKk4oU45ETifvFoWE8Kea73H32uisShqiECIsririOWZLKnm2YeGn3z26kKNjkn8wK4upWESCZUfP46FjFzV3EtT8RE51g6LFToaIls7fs99yLCwkX4xWBRdI0b6c5JvuaP4mukaXc6Ud9nREVmuOVsJ8mJbtnfl9hvfCdnzSpWR4x1ep6EinmPEX4Z1eBoeYXMkU31eOgdzXn+VpyT48W1rcrZxNCGe9Ln09OLlgNx5aYMDNAKrXiYkD55aMLFM7JLmX40DSez7EP8FFM5xALtNQnwun4ziGomf8Hl8GroYC+xNYIDMSpXVQBEc8s04dw3267tIPbA1p63CAHL/edAzn6bTtmvjLOI49o1fMLHls9ECW4/dKhalsPuZ4GUwqwIbf0WvTzNyvKjx65O+stDkxisDbVWVbXXNzGmbvvKJBo8SRymTM/THpavi+keps3kjUfmfmhImayG5fj5Z9G4r3KM77K+siQTvjjjg0t2hbLvyWI="
prerelease: false
target_commitish: master
skip_cleanup: true
on:
repo: ocadotechnology/aimmo
branch: master
- stage: deploy
env:
- NODE_ENV=production
before_install:
- nvm install node
- nvm use node
install:
- pushd game_frontend
- yarn
- popd
script:
- pushd game_frontend
- node djangoBundler.js
- popd
deploy:
- provider: pypi
skip_cleanup: true
provider: pypi
user: ocadotechnology
password:
secure: "dX2M4PpyGwa1bjpJN/Wk3EORWRXuTS14ZQEQ7Ndqk/WnOZlNqD5t/WiITTdqBWoR/ScvQiGBzR/VdRLZllkGrhupoMrtkfCldaxEI3/wbbwW9CiLuwyR/V5xgVj9TA+PtXErjgAqG9KRtyaBEOaC20t13Uc6vuIc9e6aXkzhQ9hf3vVMlnABOZP3f/2R3+sJQMLylGPCz/6BAs2U+nyxGJCpfq0aJK7H2aVPUKtM1/nscuhvsrl8yU+RWYS3idgfXDuPlwqKvRL9xbEm1DC3ByCFwwzAGCPlUtzYlx6Ttrg8Jv6S1cgsjxijzV5QqU+k1JhmY3jDqqmMROFAaY3wJ6038xUbn4zlgvXgtCayiebJukSMR7tJoVrs6ao26QPsbLNZdReDzSXJR05pgB4I8gGTlIKeZE8zOS75hkv0CdMjmIsQhTeMKqQcATuN8QszYRP4uO7vG+3I7hNSK8HcqxHtNLEDq2/QKDAVBve0R5CeEvLMnSxj7UydO+HuJUgickjHuJUmLZ+7iR9i1p6G0MUpKq/n8izSponvShu0lDshrNWJ9PYuhRD4Yvnp4/FCSxdY0+u7pHJsbluGcIvaAlwoa5O01Seu2pVpox8hVTIhn9LuR0wP7Ed4Nxper7cMNgugqb8J9BybSlMjRlBYmI7FQePCdsu1ETNI9JDHAug="
distributions: "bdist_wheel sdist"
on:
repo: ocadotechnology/aimmo
after_deploy:
- "curl -d POST -v https://semaphoreci.com/api/v1/projects/${SEMAPHORE_PROJECT_ID}/master/build?auth_token=${SEMAPHORE_API_AUTH}"
tags: true
after_deploy:
- "curl -d POST -v https://semaphoreci.com/api/v1/projects/${SEMAPHORE_PROJECT_ID}/master/build?auth_token=${SEMAPHORE_API_AUTH}"
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Clone your repo using HTTPS
* Work on a new git branch.
* Need help with [git](https://git-scm.com/docs/gittutorial)?
Anyway you can't use Ocado Technology's master.
* The [issues are listed on ocadotechnology/aimmo](https://github.com/ocadotechnology/aimmo/issues).
It's even better if you're using [ZenHub](https://www.zenhub.com/) because it will allow you to look at a [Kanban-ish board](https://github.com/ocadotechnology/aimmo/issues#boards) for the project.
The new starter / up-for-grabs issues are listed with the [help wanted label](https://github.com/ocadotechnology/aimmo/labels/help%20wanted)
Expand All @@ -18,13 +17,14 @@ The new starter / up-for-grabs issues are listed with the [help wanted label](ht
* To manually test things and run the project, `./run` in the root.

## Great, you can **commit**, open a **Pull Request**, and we'll **review** it...
* Then you can commit! On a new branch for a new Pull Request please.
* If your commit resolves a GitHub issue, please include “fixes #123” in the commit message.
* Then you can push to your forked repo, and create a pull request from your branch to ocadotechnology's master branch.
* Some tests will run automatically: Travis will run the automated tests, coverage will test the test coverage. Please fix found issues, then repush on your branch - it will rerun the tests.

Before you merge:
- Your PR should be connected to a corresponing ZenHub issue.
- All required status checks must pass.
- Add documentation if necessary

* Do not accept a PR yourself - at least someone else should review your code and approve it first.
* Some old PRs will need to see the branch rebased on the current master
* When a PR is accepted, **congrats!** It will be merged on master.
* When a PR is accepted, **congrats! 🎉** It will be merged on development.

## Some conventions to keep in mind...
We follow PEP8 convention quite strictly however we do make a few exceptions to this rule. They are as follows:
Expand Down
13 changes: 13 additions & 0 deletions tag_release_on_travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]
then
export BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
else
export BRANCH="$TRAVIS_BRANCH"
fi

if [ "$BRANCH" = "development" ]
then
git tag "$(cat version.txt).b$TRAVIS_BUILD_NUMBER"
else
git tag "$(cat version.txt)"
fi
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0

0 comments on commit 2949cdc

Please sign in to comment.