NiklasRosenstein / flux-ci

Flux is your own private & lightweight CI server.
MIT License
26 stars 10 forks source link

Docker #27

Closed steinnes closed 8 years ago

steinnes commented 8 years ago

Hey @NiklasRosenstein now this runs with my GitHub repo: https://github.com/steinnes/flask-test-kata

There are several things here which are subjective, and in some cases I may have made a change which I didn't even intend to (I'm at home enjoying paternity leave, so I'm being distracted regularly). Feel free to comment aggressively :-)

I would love to clean this up and get it merged if you're interested in the direction. If not, I would suggest taking the GitHub secret code, at least this works fine for me, and I'm not sure how it was supposed to work before (I don't see any secret in my GitHub json payload).

I hope you like the changes!

steinnes commented 8 years ago

Here's a screenshot of this branch working on my system:

image

steinnes commented 8 years ago

Btw @NiklasRosenstein what I think would make sense for a small CI system like this, would be for the docker image defined here to be considered a "base image", which we would publish on Docker Hub or something, so others could base their own custom Flux docker, with their specific build requirements there. An example could be something like:

FROM steinnes/flux
RUN apt-get update && apt-get install openjdk-7-jre-headless
ADD start-everything.sh
...

or

FROM steinnes/flux
RUN apt-get update && apt-get install -y make curl python2.7
RUN curl -SLO "https://s3.amazonaws.com/codeship-jet-releases/1.7.0/jet-linux_amd64_1.7.0.tar.gz" \
    && tar -xaC /usr/local/bin -f jet-linux_amd64_1.7.0.tar.gz \
    && chmod +x /usr/local/bin/jet

and probably a lot of more complicated stuff because I need to run a docker daemon and be able to start other dockers, etc. Which is probably not a big deal if I start the flux docker with --privileged, but we'll see :-)

steinnes commented 8 years ago

But that's all kinda open ended really, will test this approach and let you know. What I would really like feedback on is the GitHub signature support because I'm not sure how this worked before I added that :-)

NiklasRosenstein commented 8 years ago

To be honest I'm by no means an expert in Docker and have only been using it to setup GitLab until now. :) Wouldn't it be enough to host the Docker (base-?)image on the Docker website or is it necessary to include the Dockerfile in the repository?

What I would really like feedback on is the GitHub signature support because I'm not sure how this worked before I added that :-)

For now, I would like to only merge your changes to the flux_config.py file and verification for the GitHub signature. :) I wonder if there's a good way to select parts of your changes and keep you as a committer or at least contributor? Because if I just copy the stuff I want to keep for now, you contribution will be lost, no? And instructing you what exactly I want and how from the merge request is tedious. 😅

NiklasRosenstein commented 8 years ago

Please take a look at the github-fix branch.

steinnes commented 8 years ago

Hi @NiklasRosenstein you're right that you don't need to include the Dockerfile here to push it to Docker Hub, although I would say that it's good practice to keep it in the same repo and version control it. I already pushed my docker to https://hub.docker.com/r/steinnes/flux/ and have started using that as a base for my own builds, like I mentioned in my last comment.

Thanks for incorporating my changes, although making a PR with them alone would have been no problem -- that way I could have sneaked in the beginnings of a test suite for this project, something which I am sure you would like it to have? :-)