From 4312d13435485e26403409adba47ccf1ffe55994 Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Thu, 19 Mar 2020 19:19:35 +1100 Subject: [PATCH 1/2] initial satis-build --- .docker/Dockerfile.govcms8 | 8 ++--- .env.default | 4 +-- composer.json | 59 ++++++++++++----------------------- custom/composer/composer.json | 5 +++ custom/composer/patches.json | 4 +++ 5 files changed, 34 insertions(+), 46 deletions(-) create mode 100644 custom/composer/composer.json create mode 100644 custom/composer/patches.json diff --git a/.docker/Dockerfile.govcms8 b/.docker/Dockerfile.govcms8 index b6294c944..6920212b9 100644 --- a/.docker/Dockerfile.govcms8 +++ b/.docker/Dockerfile.govcms8 @@ -7,16 +7,14 @@ ARG GOVCMS_PROJECT_VERSION ARG DRUPAL_CORE_VERSION COPY composer.* /app/ - -RUN sed -i -e "/govcms\/govcms/ s!\^1.0!${GOVCMS_PROJECT_VERSION}!" /app/composer.json \ - && sed -i -e "/drupal\/core-recommended/ s!\^8.8!${DRUPAL_CORE_VERSION}!" /app/composer.json +COPY custom /app/custom COPY scripts/composer/ScriptHandler.php /app/scripts/composer/ScriptHandler.php ENV COMPOSER_MEMORY_LIMIT=-1 -RUN composer install -d /app \ +RUN composer install -d /app --no-dev --no-interaction --no-suggest \ # Force drupal-scaffold to run to ensure that the needed files are always created, even if a composer.lock is provided - && composer drupal-scaffold \ + && composer drupal:scaffold \ && composer clearcache COPY .docker/sanitize.sh /app/sanitize.sh diff --git a/.env.default b/.env.default index 66c7608ea..c96971619 100644 --- a/.env.default +++ b/.env.default @@ -43,9 +43,9 @@ SITE_AUDIT_VERSION=7.x-3.x # Set the version of GovCMS and Drupal Core to use - you can use a tag or branch reference (1.x-dev) here # Note: the DRUPAL_CORE_VERSION here must match the version required in the corresponding GOVCMS_PROJECT_VERSION # See https://github.com/govCMS/govcms8/releases -GOVCMS_PROJECT_VERSION=release/1.1.0-dev +GOVCMS_PROJECT_VERSION=1.1.1 DRUPAL_CORE_VERSION=8.8.1 # Set the Lagoon tag to use for the upstream dockerfiles (e.g. v1.2.0) # See https://github.com/amazeeio/lagoon/releases -LAGOON_IMAGE_VERSION=v1.2.0 +LAGOON_IMAGE_VERSION=v1.3.1 diff --git a/composer.json b/composer.json index 6a6b8c257..c92519066 100644 --- a/composer.json +++ b/composer.json @@ -3,44 +3,23 @@ "description": "Project template for GovCMS Drupal 8 projects with composer", "type": "project", "license": "GPL-2.0-or-later", - "repositories": [ - { - "type": "composer", - "url": "https://packages.drupal.org/8" - }, - { - "type": "composer", - "url": "https://asset-packagist.org" - }, - { - "type": "vcs", - "url": "git@github.com:govcms/govcms8.git" - }, - { - "type": "vcs", - "url": "git@github.com:govCMS/scaffold-tooling.git" - } - ], + "repositories": { + "govcms": { "type": "composer", "url": "https://satis.govcms.gov.au/" }, + "whitelist": { "type": "composer", "url": "https://satis.govcms.gov.au/whitelist/" }, + "custom": { "type": "path", "url": "custom/composer" }, + "packagist.org": false + }, "require": { - "composer/installers": "^1.2", - "cweagans/composer-patches": "^1.6.5", - "drupal-composer/drupal-scaffold": "^2.5", - "govcms/govcms": "^1.0", - "webflo/drupal-finder": "^1.0.0", - "webmozart/path-util": "^2.3", - "drupal/core-recommended": "^8.8", - "zaporylie/composer-drupal-optimizations": "^1.0", - "govcms/scaffold-tooling": "dev-feature/govcms-4390-sub-scripts-deploy" + "govcms/govcms": "~1", + "govcms/scaffold-tooling": "~1", + "govcms/custom": "*" }, "require-dev": { - "phpunit/phpunit": "^6.5" + "govcms/require-dev": "~1" }, "conflict": { "drupal/drupal": "*" }, - "provide": { - "drupal/core": "*" - }, "minimum-stability": "dev", "prefer-stable": true, "config": { @@ -63,24 +42,26 @@ ], "post-update-cmd": [ "DrupalProject\\composer\\ScriptHandler::createRequiredFiles" - ], - "drupal-scaffold": [ - "DrupalComposer\\DrupalScaffold\\Plugin::scaffold" ] }, "extra": { + "enable-patching": true, + "patches-file": "custom/composer/patches.json", "patchLevel": { "drupal/core": "-p2" }, - "enable-patching": true, - "patches": {}, - "installer-types": ["bower-asset", "npm-asset"], + "installer-types": [ + "bower-asset", + "npm-asset" + ], "installer-paths": { "web/core": [ "type:drupal-core" ], "web/libraries/{$name}": [ - "type:drupal-library", "type:bower-asset", "type:npm-asset" + "type:drupal-library", + "type:bower-asset", + "type:npm-asset" ], "web/modules/contrib/{$name}": [ "type:drupal-module" @@ -102,4 +83,4 @@ } } } -} +} \ No newline at end of file diff --git a/custom/composer/composer.json b/custom/composer/composer.json new file mode 100644 index 000000000..2c266cf1e --- /dev/null +++ b/custom/composer/composer.json @@ -0,0 +1,5 @@ +{ + "name": "govcms/custom", + "description": "Additional packages from https://satis.govcms.gov.au or where composer.json is locked.", + "require": {} +} diff --git a/custom/composer/patches.json b/custom/composer/patches.json new file mode 100644 index 000000000..3f9d5721c --- /dev/null +++ b/custom/composer/patches.json @@ -0,0 +1,4 @@ +{ + "patches": { + } + } \ No newline at end of file From d9ead3acc72065263b027b0dd542eded0b9284ac Mon Sep 17 00:00:00 2001 From: Toby Bellwood Date: Fri, 20 Mar 2020 18:17:54 +1100 Subject: [PATCH 2/2] move require-dev to test container --- .docker/Dockerfile.test | 2 ++ composer.json | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.docker/Dockerfile.test b/.docker/Dockerfile.test index 1151a2e4c..0531b025f 100644 --- a/.docker/Dockerfile.test +++ b/.docker/Dockerfile.test @@ -11,6 +11,8 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI && rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz COPY --from=cli /app /app +RUN composer require -d /app govcms/require-dev:~1 + COPY .docker/scripts/phpunit /app/web/profiles/contrib/govcms/.docker/phpunit COPY .docker/scripts/lint-govcms /app/web/profiles/contrib/govcms/.docker/scripts/lint-govcms diff --git a/composer.json b/composer.json index c92519066..fff26aec4 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,6 @@ "govcms/custom": "*" }, "require-dev": { - "govcms/require-dev": "~1" }, "conflict": { "drupal/drupal": "*"