From 2fe72f123bc45825359b4baea42eed462d0cbe11 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Wed, 30 Aug 2023 10:47:32 +1000 Subject: [PATCH] DEV: Add minio install to test image (#726) Relies on discourse/discourse#22975 to be merged first; the minio_runner gem can self-install minio, but it's better to just bake the binaries into the test image. Just uses the script/install_minio.rb script to use the gem to install required binaries. We are adding minio to the core project to run system tests for S3 uploads using minio as a mock S3 store. --- .github/workflows/build.yml | 21 ++++++++++++--------- image/discourse_test/Dockerfile | 3 ++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae5c1f4..e5d42fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,24 +29,27 @@ jobs: - name: build slim image run: | cd image && ruby auto_build.rb base_slim + - name: tag slim images + id: tag-images + run: | + TAG=`date +%Y%m%d-%H%M` + echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT + docker tag discourse/base:build_slim discourse/base:2.0.$TAG-slim + docker tag discourse/base:build_slim discourse/base:slim - name: build release image run: | cd image && ruby auto_build.rb base + - name: tag release images + run: | + TAG=${{ steps.tag-images.outputs.tag }} + docker tag discourse/base:build discourse/base:2.0.$TAG + docker tag discourse/base:build discourse/base:release - name: build test_build image run: | cd image && ruby auto_build.rb discourse_test_build - name: run specs run: | docker run --rm -e RUBY_ONLY=1 -e USE_TURBO=1 -e SKIP_PLUGINS=1 -e SKIP_LINT=1 discourse/discourse_test:build - - name: tag images - id: tag-images - run: | - TAG=`date +%Y%m%d-%H%M` - echo "tag=$(echo $TAG)" >> $GITHUB_OUTPUT - docker tag discourse/base:build_slim discourse/base:2.0.$TAG-slim - docker tag discourse/base:build_slim discourse/base:slim - docker tag discourse/base:build discourse/base:2.0.$TAG - docker tag discourse/base:build discourse/base:release - name: Print summary run: | docker images discourse/base diff --git a/image/discourse_test/Dockerfile b/image/discourse_test/Dockerfile index 3a4fbba..69dcc6e 100644 --- a/image/discourse_test/Dockerfile +++ b/image/discourse_test/Dockerfile @@ -33,6 +33,7 @@ RUN cd /var/www/discourse &&\ sudo -u discourse yarn cache clean RUN cd /var/www/discourse && sudo -E -u discourse -H bundle exec rake plugin:install_all_official &&\ - sudo -E -u discourse -H bundle exec rake plugin:install_all_gems + sudo -E -u discourse -H bundle exec rake plugin:install_all_gems &&\ + sudo -E -u discourse -H bundle exec ruby script/install_minio_binaries.rb ENTRYPOINT sudo -E -u discourse -H ruby script/docker_test.rb -- 2.25.1