Skip to content

Commit

Permalink
[#82] Replace Drupal8 Dockerfile with Drupal 9 one
Browse files Browse the repository at this point in the history
  • Loading branch information
juampynr committed Jul 7, 2022
1 parent cd41095 commit 6309765
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 107 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
drupal9ci
coverage.txt
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM drupal:8.9-apache
FROM drupal:9-apache

RUN apt-get update && apt-get install -y \
git \
Expand Down Expand Up @@ -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 - && \
Expand Down
57 changes: 0 additions & 57 deletions Dockerfile9

This file was deleted.

11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
13 changes: 0 additions & 13 deletions coverage.out

This file was deleted.

6 changes: 1 addition & 5 deletions dist/bitbucket/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: juampynr/drupal8ci:latest
image: ghcr.io/lullabot/drupal9ci:latest

pipelines:
default:
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 1 addition & 7 deletions dist/circleci/.circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -79,19 +79,13 @@ 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:
- checkout
- *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
Expand Down
12 changes: 6 additions & 6 deletions dist/github-actions/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
phpunit:
runs-on: ubuntu-latest
container:
image: juampynr/drupal8ci:latest
image: ghcr.io/lullabot/drupal9ci:latest

services:
mariadb:
Expand Down Expand Up @@ -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
Expand All @@ -51,7 +51,7 @@ jobs:
code-coverage:
runs-on: ubuntu-latest
container:
image: juampynr/drupal8ci:latest
image: ghcr.io/lullabot/drupal9ci:latest

services:
mariadb:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 -
Expand Down
12 changes: 6 additions & 6 deletions dist/gitlabci/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -107,4 +107,4 @@ drupal9ci:cypress:
- vendor/bin/robo job:cypress-tests
artifacts:
paths:
- cypress
- cypress
2 changes: 1 addition & 1 deletion dist/travisci/.travis/php-node.dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6309765

Please sign in to comment.