datatogether / coverage

Project for visualizing the status of digital data archiving efforts across various data repositories
http://api.archivers.co/coverage
GNU Affero General Public License v3.0
2 stars 3 forks source link

Setup automated build on DockerHub #26

Open ibnesayeed opened 6 years ago

ibnesayeed commented 6 years ago

Hey there, thank you for submitting an issue!

We are trying to keep issues for feature requests and bug reports. Please complete the following checklist before creating a new one:

Currently, images are build from inside the Circle CI and pushed to the DockerHub. This requires the CI system to install docker client as well as have access to the DockerHub credentials. An alternate approach would be to use the Automated Builds feature of DockerHub or Docker Cloud (both are free for public images). This setup can clean the following blocks from the .circleci/config.yml file:

      - run:
          name: Install Docker client
          command: |
            if [ $CIRCLE_BRANCH = 'master' ]; then
              set -x
              VER="17.03.0-ce"
              curl -L -o /tmp/docker-$VER.tgz https://get.docker.com/builds/Linux/x86_64/docker-$VER.tgz
              tar -xz -C /tmp -f /tmp/docker-$VER.tgz
              mv /tmp/docker/* /usr/bin
            fi
      - run:
          name: Publish to Docker Hub
          command: |
            if [ $CIRCLE_BRANCH = 'master' ]; then
              TAG=0.1.$CIRCLE_BUILD_NUM
              docker build -t datatogether/coverage:latest -t datatogether/coverage:$TAG .
              docker login -u $DOCKER_USER -p $DOCKER_PASS
              docker push datatogether/coverage:$TAG
              docker push datatogether/coverage:latest
            fi

The following image illustrates an automated build setup that would:

This way, the latest tag is always pointing to a stable build while keeping a history of all releases along with bleeding edge master image.

docker-auto-build-settings