-
Notifications
You must be signed in to change notification settings - Fork 3
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
feature/16-build-and-upload-docker-images-from-travis #17
feature/16-build-and-upload-docker-images-from-travis #17
Conversation
appveyor builds are failing because appveyor.yml is not present in this branch. This is part of PR13 |
DOCKER_USER and DOCKER_PASS are env vars added to Travis Settings |
7abc3b6
to
d25e4f8
Compare
Have you looked at the automated builds chapter on Docker Hub? Wouldn't it be better to set up something more robust with that? https://docs.docker.com/docker-hub/builds/#prerequisites |
Yes I have tried docker hub's automated build, but there are issues with that.
We need to upload docker images only if dockerfile or bootstrap.sh is changed. |
@@ -0,0 +1,43 @@ | |||
#/bin/bash |
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.
I got the intention but is this really necessary? Can't we make this a warning or maybe an error - if inconsistent bail out and make the build fail... I am a bit skeptical about the possible side effects...
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.
If build fails it wont help the user much. User has to contact me and I need to build, test and upload new docker image to my account, which is cumbersome and might open window for errors in my side :-)
Almost every CI pipeline (travis, bitbucket pipeline, shippable, circle-ci, gitlab-ci etc) added support for automated docker build and upload. Many (like atlassin) encourage to use automatic build and upload of docker images. At-least the process wise I think it is correct to automate docker image deployment. We can always improve the conditions when the docker image is uploaded, what meta info is added, where it is upload etc in future.
Since the feature for continuous delivery of docker images in build servers is new feature, we dont see much github projects using it.
Useful links:
https://github.com/travis-ci/docs-travis-ci-com/blob/master/user/docker.md
http://docs.shippable.com/ci/push-docker-hub/
https://blog.bitbucket.org/2017/04/18/bitbucket-pipelines-supports-building-docker-images-and-service-containers/
https://circleci.com/docs/1.0/docker/
@@ -1,7 +1,9 @@ | |||
sudo: required | |||
git: |
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.
Which OS version is travis using? Can't we require Ubuntu 17 and use with the non-dockerized setup?
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.
Travis uses Ubuntu 14, it provides us with old tools like OpenCV2.4, gcc 4.8, cmake 3.5. Not much suitable for us. Ofcourse we can make it work but it requires few changes in cmake and may be in code if we are using latest c++. But I recommend current containerized build approach.
scripts/linux/ci_cd.sh
Outdated
project_dir=${current_dir}/../.. | ||
cd ${project_dir} | ||
|
||
$(git whatchanged HEAD^! | grep docker/Dockerfile > /dev/null) |
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.
What range of differences are considered here? How do we now that the user didn't create a new image? Or is this intended for travis usage only?
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.
We are currently looking at changes in HEAD^ which touched Dockerfile or the script. Is this sufficient? What I am missing is a last known state when the image was created. So I'd expect a range of commits starting at the known point where current image was created. This requires that this is somehow encoded in the image name or image metadata. Maybe "docker inspect" can help? Or tagging the image with current commit hash?
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.
git whatchanged is used for travis purpose only. to check if a file is changed in the current commit.
User cannot upload a new image, Only I can upload a new image. travis pushes and pulls from my docker repository
Even if I upload some wrong image to docker hub. Travis uploads a new image if dockerfile/bootstrap.sh commit is on master.
Last state can be tracked, because we adding travis build number to docker image tag.
This has been explained in detail in below comment
#16 (comment)
5eb012b
to
e432176
Compare
5e08ba2
to
2b6469d
Compare
…p.sh changes.