From 630976525779cce7b0f4e23bd88ea2e9175c18a1 Mon Sep 17 00:00:00 2001 From: Juampy NR Date: Thu, 7 Jul 2022 10:47:15 +0200 Subject: [PATCH] [#82] Replace Drupal8 Dockerfile with Drupal 9 one --- .gitignore | 1 + Dockerfile | 10 ++-- Dockerfile9 | 57 -------------------- README.md | 11 ++-- coverage.out | 13 ----- dist/bitbucket/bitbucket-pipelines.yml | 6 +-- dist/circleci/.circleci/config.yml | 8 +-- dist/github-actions/.github/workflows/ci.yml | 12 ++--- dist/gitlabci/.gitlab-ci.yml | 12 ++--- dist/travisci/.travis/php-node.dockerfile | 2 +- 10 files changed, 25 insertions(+), 107 deletions(-) delete mode 100644 Dockerfile9 delete mode 100644 coverage.out diff --git a/.gitignore b/.gitignore index 8e4a01e..4f56184 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea drupal9ci +coverage.txt diff --git a/Dockerfile b/Dockerfile index 771293a..7d8bda3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM drupal:8.9-apache +FROM drupal:9-apache RUN apt-get update && apt-get install -y \ git \ @@ -39,16 +39,16 @@ RUN pecl install xdebug && \ RUN wget https://robo.li/robo.phar && \ chmod +x robo.phar && mv robo.phar /usr/local/bin/robo +# Install node. +RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \ + apt install -y nodejs xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 + # Install Dockerize. ENV DOCKERIZE_VERSION v0.6.0 RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz -# Install ImageMagic to take screenshots. -RUN pecl install imagick && \ - docker-php-ext-enable imagick - # Install Chrome browser. RUN apt-get install --yes gnupg2 apt-transport-https && \ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && \ diff --git a/Dockerfile9 b/Dockerfile9 deleted file mode 100644 index 7d8bda3..0000000 --- a/Dockerfile9 +++ /dev/null @@ -1,57 +0,0 @@ -FROM drupal:9-apache - -RUN apt-get update && apt-get install -y \ - git \ - imagemagick \ - libmagickwand-dev \ - mariadb-client \ - rsync \ - sudo \ - unzip \ - vim \ - wget && \ - docker-php-ext-install bcmath && \ - docker-php-ext-install mysqli && \ - docker-php-ext-install pdo && \ - docker-php-ext-install pdo_mysql - -# Remove the memory limit for the CLI only. -RUN echo 'memory_limit = -1' > /usr/local/etc/php/php-cli.ini - -# Remove the vanilla Drupal project that comes with this image. -RUN rm -rf ..?* .[!.]* * - -# Install composer. -COPY scripts/composer-installer.sh /tmp/composer-installer.sh -RUN chmod +x /tmp/composer-installer.sh && \ - /tmp/composer-installer.sh && \ - mv composer.phar /usr/local/bin/composer && \ - composer self-update --1 - -# Put a turbo on composer. -RUN composer global require hirak/prestissimo - -# Install XDebug. -RUN pecl install xdebug && \ - docker-php-ext-enable xdebug - -# Install Robo CI. -RUN wget https://robo.li/robo.phar && \ - chmod +x robo.phar && mv robo.phar /usr/local/bin/robo - -# Install node. -RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && \ - apt install -y nodejs xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 - -# Install Dockerize. -ENV DOCKERIZE_VERSION v0.6.0 -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ - tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ - rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz - -# Install Chrome browser. -RUN apt-get install --yes gnupg2 apt-transport-https && \ - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && \ - sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \ - apt-get update && \ - apt-get install --yes google-chrome-unstable diff --git a/README.md b/README.md index 12c9e69..2b1ca03 100644 --- a/README.md +++ b/README.md @@ -27,10 +27,8 @@ structure differs from what _drupal-project_ sets up, you will need to adjust the CI scripts. It's also recommended to adjust your project to add a subset of the `settings.php` file into -version control and rely on `settings.local.php` for setting the database connection. See [this -commit](https://github.com/juampynr/drupal8-circleci/commit/817d0b6674c42dba73165b047b6b89d72ee72d11) -which contains these changes among other ones. The CI scripts have their own `settings.local.php` -which is copied at build time into `web/sites/default`. +version control and rely on `settings.local.php` for setting the database connection. The CI scripts +have their own `settings.local.php` which is copied at build time into `web/sites/default`. #### DocumentRoot: web vs docroot @@ -66,9 +64,8 @@ For an overview of the CircleCI features, have a look at #### Using a custom Docker image The [CircleCI configuration file](dist/circleci/.circleci/config.yml) uses a -[custom Docker image](https://hub.docker.com/r/juampynr/drupal8ci/) that extends from -the [official Drupal image](https://hub.docker.com/_/drupal/) and it is [hosted at -Docker Hub](https://hub.docker.com/r/juampynr/drupal8ci/). If this image +[custom Docker image](https://github.com/Lullabot/drupal9ci/pkgs/container/drupal9ci) that extends from +the [official Drupal image](https://hub.docker.com/_/drupal/). If this image does not fit your project's architecture then consider [creating your own image](https://circleci.com/docs/2.0/custom-images/) based out of it. diff --git a/coverage.out b/coverage.out deleted file mode 100644 index 68bb6b7..0000000 --- a/coverage.out +++ /dev/null @@ -1,13 +0,0 @@ -mode: atomic -drupal9ci/scripts/scripts.go:39.35,47.2 1 0 -drupal9ci/scripts/scripts.go:49.39,57.2 1 2 -drupal9ci/scripts/scripts.go:59.93,63.23 3 1 -drupal9ci/scripts/scripts.go:82.2,82.25 1 1 -drupal9ci/scripts/scripts.go:63.23,65.3 1 1 -drupal9ci/scripts/scripts.go:65.8,66.22 1 0 -drupal9ci/scripts/scripts.go:67.18,68.41 1 0 -drupal9ci/scripts/scripts.go:69.17,70.40 1 0 -drupal9ci/scripts/scripts.go:71.22,72.45 1 0 -drupal9ci/scripts/scripts.go:73.17,74.40 1 0 -drupal9ci/scripts/scripts.go:75.17,76.40 1 0 -drupal9ci/scripts/scripts.go:77.11,78.43 1 0 diff --git a/dist/bitbucket/bitbucket-pipelines.yml b/dist/bitbucket/bitbucket-pipelines.yml index efdd38e..b470950 100644 --- a/dist/bitbucket/bitbucket-pipelines.yml +++ b/dist/bitbucket/bitbucket-pipelines.yml @@ -1,4 +1,4 @@ -image: juampynr/drupal8ci:latest +image: ghcr.io/lullabot/drupal9ci:latest pipelines: default: @@ -47,10 +47,6 @@ pipelines: - echo $DB_DUMP_URL - sleep 10 - robo job:build - # The following two lines add node/npm to the juampynr/drupal8ci image. - # They are not needed if you use juampynr/drupal9ci (PHP8). - - curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - - - apt install -y nodejs xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 - vendor/bin/robo job:serve-drupal - vendor/bin/robo job:cypress-tests variables: diff --git a/dist/circleci/.circleci/config.yml b/dist/circleci/.circleci/config.yml index 11593fa..a69cb7d 100644 --- a/dist/circleci/.circleci/config.yml +++ b/dist/circleci/.circleci/config.yml @@ -16,7 +16,7 @@ update_composer: &update_composer ## Defines images and working directory. defaults: &defaults docker: - - image: juampynr/drupal8ci:latest + - image: ghcr.io/lullabot/drupal9ci:latest environment: XDEBUG_MODE: coverage - image: mariadb:10.3 @@ -79,7 +79,6 @@ behat_tests: &behat_tests - save_cache: *save_cache ## Job to run the update path and Cypress tests. -# juampynr/drupal9ci:latest lands with PHP8 and node, so if your project is PHP8 you can remove the `Set up node` step. cypress_tests: &cypress_tests <<: *defaults steps: @@ -87,11 +86,6 @@ cypress_tests: &cypress_tests - *copy_robo - *update_composer - restore_cache: *restore_cache - - run: - name: Setup node - command: | - curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - - apt install -y nodejs xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 - run: name: Run Cypress tests command: robo job:run-cypress-tests diff --git a/dist/github-actions/.github/workflows/ci.yml b/dist/github-actions/.github/workflows/ci.yml index 33f2e70..dfbe771 100644 --- a/dist/github-actions/.github/workflows/ci.yml +++ b/dist/github-actions/.github/workflows/ci.yml @@ -4,7 +4,7 @@ jobs: phpunit: runs-on: ubuntu-latest container: - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest services: mariadb: @@ -32,7 +32,7 @@ jobs: code-standards: runs-on: ubuntu-latest container: - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest steps: - uses: actions/checkout@v1 @@ -51,7 +51,7 @@ jobs: code-coverage: runs-on: ubuntu-latest container: - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest services: mariadb: @@ -86,7 +86,7 @@ jobs: behat: runs-on: ubuntu-latest container: - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest services: mariadb: image: mariadb:latest @@ -117,7 +117,7 @@ jobs: cypress: runs-on: ubuntu-latest container: - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest services: mariadb: image: mariadb:latest @@ -140,7 +140,7 @@ jobs: - name: Build project run: robo job:build - # juampynr/drupal9ci:latest lands with PHP8 and node, so if your project is PHP8 you can remove this step. + # ghcr.io/lullabot/drupal9ci:latest:latest lands with PHP8 and node, so if your project is PHP8 you can remove this step. - name: Setup node run: | curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - diff --git a/dist/gitlabci/.gitlab-ci.yml b/dist/gitlabci/.gitlab-ci.yml index 120ba90..b6403f5 100644 --- a/dist/gitlabci/.gitlab-ci.yml +++ b/dist/gitlabci/.gitlab-ci.yml @@ -23,7 +23,7 @@ stages: # The template for Drupal9CI tests. .drupal9ci_test_template: extends: .cache_strategy_pull - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest stage: test services: - name: mariadb:latest @@ -41,7 +41,7 @@ stages: ## Job to build the environment. drupal9ci:build: extends: .cache_strategy_push - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest stage: build script: - composer global remove hirak/prestissimo && composer self-update --2 @@ -54,7 +54,7 @@ drupal9ci:build: ## Job to check coding standards. drupal9ci:code_sniffer: extends: .cache_strategy_pull - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest script: vendor/bin/robo job:coding-standards artifacts: paths: @@ -82,7 +82,7 @@ drupal9ci:code_coverage: ## Job to run behat. drupal9ci:behat: extends: .drupal9ci_test_template - image: juampynr/drupal8ci:latest + image: ghcr.io/lullabot/drupal9ci:latest variables: FOO: bar # DB_DUMP_URL: "URL to your DB dump" @@ -97,7 +97,7 @@ drupal9ci:behat: ## Job to run cypress. drupal9ci:cypress: extends: .drupal9ci_test_template - image: juampynr/drupal9ci:latest + image: ghcr.io/lullabot/drupal9ci:latest variables: FOO: bar # DB_DUMP_URL: "URL to your DB dump" @@ -107,4 +107,4 @@ drupal9ci:cypress: - vendor/bin/robo job:cypress-tests artifacts: paths: - - cypress \ No newline at end of file + - cypress diff --git a/dist/travisci/.travis/php-node.dockerfile b/dist/travisci/.travis/php-node.dockerfile index 5551a31..a448fe1 100644 --- a/dist/travisci/.travis/php-node.dockerfile +++ b/dist/travisci/.travis/php-node.dockerfile @@ -1,4 +1,4 @@ -FROM juampynr/drupal8ci:latest +FROM ghcr.io/lullabot/drupal9ci:latest RUN curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - RUN apt install -y nodejs xvfb libgtk-3-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2