-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build and deploy docker stack in Travis-CI #166
Conversation
needs swarm init command which seems weird that it would be required but ok using docker stack deploy and not docker-compose
(Moved this comment over from #160 )
|
.travis.yml
Outdated
- docker-ce | ||
before_install: | ||
- docker swarm init | ||
- cp ./.env.example ./.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary. Can we add the environment variables to Travis CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can do it that way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and committed. Added the variables in Travis and everything works fine.
.travis.yml
Outdated
install: | ||
- pip install pipenv | ||
- pipenv install | ||
- make dev | ||
before_script: | ||
- counter=0 ; while ((counter < 10)) && ! pg_isready --host=$PGHOST --port=$PGPORT --dbname=$PGDATABASE ; do sleep 3; let counter=counter+1; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this is a known issue in the travis community... travis-ci/travis-ci#4842
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, look like some folks there used the same sort of idling loop as a workaround. Nice to feel like this solution is validated. (seems like a problem that Travis should fix though :) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, agreed. We could always switch to Circle CI or another CI service if this causes issues in the future. I've used Circle CI with all my other projects, but thought I'd change things up a bit because I got a free sticker from them...
Thanks for doing this @wittejm . Are you able to add the environment vars to Travis Ci https://travis-ci.com/codeforpdx/recordexpungPDX/settings ? |
@NickSchimek Yep, I was able to add env variables to Travis and now the .env file is unnecessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for doing this @wittejm
build and deploy docker stack in Travis-CI
Expands the .travis.yml to build and deploy the Docker stack before running the pytest battery.
I'm making this a separate PR even though it's already feature of #160 . But this is pretty simple and standalone, and will be useful to have in the pipeline independent from finalizing the database features in PR #160.
This is a WIP and partial contribution to issue #165.