From 471bbb92af3e1aaad6b5e5305d96e13be13a474e Mon Sep 17 00:00:00 2001 From: Oliver Azevedo Barnes Date: Wed, 16 Dec 2020 12:17:38 +0000 Subject: [PATCH 1/3] Publish images to Docker Hub through Github workflow --- .github/workflows/on_push.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index c8e459a..85d691a 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -57,7 +57,7 @@ jobs: docker tag $GENERATOR_IMAGE_NAME:$TAG $GENERATOR_IMAGE_NAME:latest docker tag $GENERATOR_IMAGE_NAME:$TAG $GENERATOR_IMAGE_NAME:$DECIDIM_VERSION - - name: Publish Image to Github Container Registry + - name: Publish decidim-generator Image to Github Container Registry uses: azure/docker-login@v1 with: login-server: ghcr.io @@ -66,6 +66,14 @@ jobs: - run: | docker push $GENERATOR_IMAGE_NAME + - name: Publish decidim-generator Image to Docker Hub + uses: docker/login-action@v1 + with: + username: decidimbot + password: ${{ secrets.DOCKERHUB_PAT }} + - run: | + docker push $GENERATOR_IMAGE_NAME + - name: Build decidim-test Image env: RUBY_VERSION: ${{ steps.ruby-version.outputs.version }} @@ -86,6 +94,14 @@ jobs: - run: | docker push $TEST_IMAGE_NAME + - name: Publish decidim-test Image to Docker Hub + uses: docker/login-action@v1 + with: + username: decidimbot + password: ${{ secrets.DOCKERHUB_PAT }} + - run: | + docker push $TEST_IMAGE_NAME + - name: Build decidim-dev Image env: RUBY_VERSION: ${{ steps.ruby-version.outputs.version }} @@ -106,6 +122,14 @@ jobs: - run: | docker push $DEV_IMAGE_NAME + - name: Publish decidim-dev Image to Docker Hub + uses: docker/login-action@v1 + with: + username: decidimbot + password: ${{ secrets.DOCKERHUB_PAT }} + - run: | + docker push $DEV_IMAGE_NAME + - name: Build decidim (app) Image env: RUBY_VERSION: ${{ steps.ruby-version.outputs.version }} @@ -125,3 +149,12 @@ jobs: password: ${{ secrets.CONTAINER_REGISTRY_PAT }} - run: | docker push $APP_IMAGE_NAME + + - name: Publish decidim Image to Docker Hub + uses: docker/login-action@v1 + with: + username: decidimbot + password: ${{ secrets.DOCKERHUB_PAT }} + - run: | + docker push $APP_IMAGE_NAME + From 337efaa4a385140749aff114fef97ac20eaa9ae8 Mon Sep 17 00:00:00 2001 From: Oliver Azevedo Barnes Date: Mon, 21 Dec 2020 20:05:56 +0000 Subject: [PATCH 2/3] Add defaults for ruby and decidim-versions --- Dockerfile | 4 ++-- Dockerfile-test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7fcd21e..df7bbc3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -ARG ruby_version +ARG ruby_version=2.7.1 FROM ruby:${ruby_version} LABEL maintainer="info@coditramuntana.com" -ARG decidim_version +ARG decidim_version=0.23.1 ENV LANG C.UTF-8 ENV LC_ALL C.UTF-8 diff --git a/Dockerfile-test b/Dockerfile-test index 4d41a56..c4ca0f9 100644 --- a/Dockerfile-test +++ b/Dockerfile-test @@ -3,7 +3,7 @@ ARG base_image=ghcr.io/decidim/decidim-generator:latest FROM $base_image LABEL maintainer="info@coditramuntana.com" -ARG decidim_version +ARG decidim_version=0.23.1 RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \ From ae8a9f254c6cad8106737e6c35dfd0b0e68f5c42 Mon Sep 17 00:00:00 2001 From: Oliver Azevedo Barnes Date: Mon, 21 Dec 2020 20:12:38 +0000 Subject: [PATCH 3/3] Separate command from entrypoint this fixes building the decidim-test image for it, and allows us to run arbitrary commands against the image (such as bash) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index df7bbc3..c81ba48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,8 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ RUN npm install -g npm@6.3.0 RUN gem install bundler --version '>= 2.1.4' \ - && gem install decidim:${decidim_version} + && gem install decidim:${decidim_version} --no-document -ENTRYPOINT ["decidim"] +CMD ["decidim"] + +ENTRYPOINT []