From 906bc14e2b98af1b7417910a72b46fe06db0130e Mon Sep 17 00:00:00 2001 From: gregharvey Date: Fri, 9 Sep 2022 10:42:52 +0200 Subject: [PATCH 1/7] Adding a Drupal 9 template to ce-dev. --- templates/drupal9/ce-dev/ansible/deploy.yml.j2 | 4 ++-- templates/drupal9/ce-dev/ce-dev.compose.prebuilt.yml.j2 | 4 ++-- templates/prebuild.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/drupal9/ce-dev/ansible/deploy.yml.j2 b/templates/drupal9/ce-dev/ansible/deploy.yml.j2 index 29aaef8..853fc4c 100644 --- a/templates/drupal9/ce-dev/ansible/deploy.yml.j2 +++ b/templates/drupal9/ce-dev/ansible/deploy.yml.j2 @@ -1,9 +1,9 @@ --- -# Template playbook for a local Drupal9 codebase. +# Template playbook for a local Drupal 9 codebase. - hosts: {{ project_name }}-web vars: - project_name: {{ project_name }} - - project_type: drupal8 + - project_type: drupal9 - webroot: web - build_type: local - _env_type: dev diff --git a/templates/drupal9/ce-dev/ce-dev.compose.prebuilt.yml.j2 b/templates/drupal9/ce-dev/ce-dev.compose.prebuilt.yml.j2 index 9902799..c1f83bb 100644 --- a/templates/drupal9/ce-dev/ce-dev.compose.prebuilt.yml.j2 +++ b/templates/drupal9/ce-dev/ce-dev.compose.prebuilt.yml.j2 @@ -11,7 +11,7 @@ x-ce_dev: - 'https://www.{{ project_name }}.local' services: web: - image: 'codeenigma/drupal8-web:latest' + image: 'codeenigma/drupal9-web:latest' expose: - 443 - 80 @@ -34,6 +34,6 @@ services: cap_add: - NET_ADMIN db: - image: 'codeenigma/drupal8-db:latest' + image: 'codeenigma/drupal9-db:latest' environment: MYSQL_ROOT_PASSWORD: ce-dev diff --git a/templates/prebuild.sh b/templates/prebuild.sh index cb40a31..a812e09 100644 --- a/templates/prebuild.sh +++ b/templates/prebuild.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test project creation and pre-build image. set -e -PROJECTS="blank drupal8" +PROJECTS="blank drupal8 drupal9" # Common processing. OWN_DIR=$(dirname "$0") From f29db1105937aa7dd70e26dd9dcb9b2513bb2f8f Mon Sep 17 00:00:00 2001 From: gregharvey Date: Fri, 9 Sep 2022 11:44:26 +0200 Subject: [PATCH 2/7] Testing nodejs version change with blank template. --- templates/blank/ce-dev/ansible/provision.yml.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/blank/ce-dev/ansible/provision.yml.j2 b/templates/blank/ce-dev/ansible/provision.yml.j2 index 796799a..1f1194c 100644 --- a/templates/blank/ce-dev/ansible/provision.yml.j2 +++ b/templates/blank/ce-dev/ansible/provision.yml.j2 @@ -8,6 +8,8 @@ - _env_type: dev - lhci: enable_vnc: true + - nodejs: + version: 14.x tasks: - apt: update_cache: true From 7fda697f343d0c363dcac538d0563b9488e836c7 Mon Sep 17 00:00:00 2001 From: gregharvey Date: Fri, 9 Sep 2022 11:49:11 +0200 Subject: [PATCH 3/7] Incrementing version for release. --- RELEASE | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE b/RELEASE index bd67827..ec9f751 100644 --- a/RELEASE +++ b/RELEASE @@ -1,2 +1,2 @@ -1.1.21 -Drupal 9 template configured with composer 2 by default +1.1.22 +Drupal 9 template building. diff --git a/package.json b/package.json index 8c10d24..02d87ff 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ce-dev", "description": "Local Stack wrapper tool", - "version": "1.1.21", + "version": "1.1.22", "author": " @pm98zz-c", "bin": { "ce-dev": "./bin/run" From 2d2ece6e8d038426cc0816c5efb03bb39dfdba10 Mon Sep 17 00:00:00 2001 From: gregharvey Date: Fri, 9 Sep 2022 12:57:42 +0200 Subject: [PATCH 4/7] There's no drupal9 template for ce-deploy. --- templates/drupal9/ce-dev/ansible/deploy.yml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/drupal9/ce-dev/ansible/deploy.yml.j2 b/templates/drupal9/ce-dev/ansible/deploy.yml.j2 index 853fc4c..0826731 100644 --- a/templates/drupal9/ce-dev/ansible/deploy.yml.j2 +++ b/templates/drupal9/ce-dev/ansible/deploy.yml.j2 @@ -3,7 +3,7 @@ - hosts: {{ project_name }}-web vars: - project_name: {{ project_name }} - - project_type: drupal9 + - project_type: drupal8 - webroot: web - build_type: local - _env_type: dev From fbe6fc6e6f4de052f39ab69f6e2c3cfd6d98472b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 02:36:34 +0000 Subject: [PATCH 5/7] Bump semver from 5.7.1 to 5.7.2 Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2) --- updated-dependencies: - dependency-name: semver dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 099a829..0eadd05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1543,6 +1543,13 @@ lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -1966,19 +1973,21 @@ safe-regex@^1.1.0: integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== "semver@2 || 3 || 4 || 5", semver@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@^6.0.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.2.1, semver@^7.3.2: - version "7.3.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.2.tgz#604962b052b81ed0786aae84389ffba70ffd3938" - integrity sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ== + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" shebang-command@^1.2.0: version "1.2.0" @@ -2416,6 +2425,11 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yn@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" From 98e90525ba9649aa61b8203af5c901371c59f7a9 Mon Sep 17 00:00:00 2001 From: gregharvey Date: Tue, 18 Jul 2023 11:45:12 +0200 Subject: [PATCH 6/7] Updating Drupal templates. --- templates/drupal8/ce-dev/ansible/deploy.yml.j2 | 11 ++++++----- templates/drupal9/ce-dev/ansible/deploy.yml.j2 | 2 +- templates/localgov/ce-dev/ansible/deploy.yml.j2 | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/templates/drupal8/ce-dev/ansible/deploy.yml.j2 b/templates/drupal8/ce-dev/ansible/deploy.yml.j2 index bf411e6..52689ee 100644 --- a/templates/drupal8/ce-dev/ansible/deploy.yml.j2 +++ b/templates/drupal8/ce-dev/ansible/deploy.yml.j2 @@ -38,14 +38,15 @@ pre_tasks: # You can safely remove these steps once you have a working composer.json. - name: Download composer file. - get_url: - url: https://raw.githubusercontent.com/drupal/recommended-project/8.8.x/composer.json + ansible.builtin.get_url: + url: https://raw.githubusercontent.com/drupal/recommended-project/8.9.x/composer.json dest: "{{ deploy_path }}/composer.json" force: false - name: Install drush. - command: - cmd: composer require drush/drush "^10.6.2" - chdir: "{{ deploy_path }}" + community.general.composer: + command: require + arguments: drush/drush:10.* + working_dir: "{{ deploy_path }}" roles: - _init # Sets some variables the deploy scripts rely on. - composer # Composer install step. diff --git a/templates/drupal9/ce-dev/ansible/deploy.yml.j2 b/templates/drupal9/ce-dev/ansible/deploy.yml.j2 index 6eab502..892fbae 100644 --- a/templates/drupal9/ce-dev/ansible/deploy.yml.j2 +++ b/templates/drupal9/ce-dev/ansible/deploy.yml.j2 @@ -46,7 +46,7 @@ # You can safely remove these steps once you have a working composer.json. - name: Download composer file. ansible.builtin.get_url: - url: https://raw.githubusercontent.com/drupal/recommended-project/9.3.x/composer.json + url: https://raw.githubusercontent.com/drupal/recommended-project/9.5.x/composer.json dest: "{{ deploy_path }}/composer.json" force: false - name: Install drush. diff --git a/templates/localgov/ce-dev/ansible/deploy.yml.j2 b/templates/localgov/ce-dev/ansible/deploy.yml.j2 index 8637751..e518179 100644 --- a/templates/localgov/ce-dev/ansible/deploy.yml.j2 +++ b/templates/localgov/ce-dev/ansible/deploy.yml.j2 @@ -39,7 +39,7 @@ # You can safely remove these steps once you have a working composer.json. - name: Download composer file. get_url: - url: https://raw.githubusercontent.com/drupal/recommended-project/9.3.x/composer.json + url: https://raw.githubusercontent.com/drupal/recommended-project/10.1.x/composer.json dest: "{{ deploy_path }}/composer.json" force: false - name: Install drush. From 9a03d041b5d9f07414a98f8c9228bcf1241e22a8 Mon Sep 17 00:00:00 2001 From: gregharvey Date: Tue, 18 Jul 2023 11:57:23 +0200 Subject: [PATCH 7/7] Removing docs steps for ansible because they cannot work. --- .github/workflows/ce-provision-build-docs.yml | 48 ------ contribute/toc.sh | 140 ------------------ 2 files changed, 188 deletions(-) delete mode 100644 .github/workflows/ce-provision-build-docs.yml delete mode 100755 contribute/toc.sh diff --git a/.github/workflows/ce-provision-build-docs.yml b/.github/workflows/ce-provision-build-docs.yml deleted file mode 100644 index bbd1c64..0000000 --- a/.github/workflows/ce-provision-build-docs.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build docs - -# Run this workflow every time a new commit pushed to your repository -on: pull_request - -jobs: - # Set the job key. The key is displayed as the job name - # when a job name is not provided - build-docs: - # Name the Job - name: Build the documentation - # Set the type of machine to run on - runs-on: ubuntu-20.04 - - steps: - # Checks out a copy of your repository on the ubuntu-latest machine - - name: Checkout code - if: ${{ github.event.pull_request.head.ref != 'documentation' }} - uses: actions/checkout@v2 - - # Configures global Git variables for committing - - name: Configure Git - run: | - git config --global user.email "sysadm@codeenigma.com" - git config --global user.name "Code Enigma CI" - - # Builds the docs - - name: Build documentation - if: ${{ github.event.pull_request.head.ref != 'documentation' }} - run: | - git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} - git fetch - git checkout documentation - contribute/toc.sh - git add docs - git diff --quiet && git diff --staged --quiet || git commit -am 'GitHub Actions - Rebuilt documentation.' && git push origin documentation - shell: bash - - # Create docs pull request - - name: Create a documentation pull request - if: ${{ github.event.pull_request.head.ref != 'documentation' && github.event.pull_request.base.ref == '1.x' }} - uses: devops-infra/action-pull-request@v0.4.2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - source_branch: documentation - target_branch: ${{ github.event.pull_request.base.ref }} - title: Documentation update. - body: "**Automated pull request** created by GitHub Actions because of a documentation update." diff --git a/contribute/toc.sh b/contribute/toc.sh deleted file mode 100755 index face006..0000000 --- a/contribute/toc.sh +++ /dev/null @@ -1,140 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC2094 -# shellcheck disable=SC2129 -IFS=$(printf '\n\t') -set -e -OWN_DIR=$(dirname "$0") -cd "$OWN_DIR" || exit 1 -OWN_DIR=$(git rev-parse --show-toplevel) -cd "$OWN_DIR" || exit 1 -OWN_DIR=$(pwd -P) - -# @param -# $1 string filepath -cp_role_page(){ - RELATIVE=$(realpath --relative-to="$OWN_DIR" "$(dirname "$1")") - if [ ! -d "$OWN_DIR/docs/$RELATIVE" ]; then - mkdir -p "$OWN_DIR/docs/$RELATIVE" - fi - cp "$1" "$OWN_DIR/docs/$RELATIVE.md" -} - -# @param -# $1 string folder -cp_single_page(){ - if [ ! -d "$OWN_DIR/docs/$1" ]; then - mkdir "$OWN_DIR/docs/$1" - fi - cp "$OWN_DIR/$1/README.md" "$OWN_DIR/docs/$1.md" -} - -# @param -# $1 (string) filename -parse_role_variables(){ - TMP_MD=$(mktemp) - WRITE=1 - # Ensure we have a trailing line. - echo "" >> "$1" - while read -r LINE; do - case $LINE in - '') - echo "$LINE" >> "$TMP_MD" - generate_role_variables "$1" - WRITE=0 - ;; - '') - echo "$LINE" >> "$TMP_MD" - WRITE=1 - ;; - '') - echo "$LINE" >> "$TMP_MD" - WRITE=0 - ;; - '') - echo "$LINE" >> "$TMP_MD" - WRITE=1 - ;; - *) - if [ $WRITE = 1 ]; then - echo "$LINE" >> "$TMP_MD" - fi - ;; - esac - done < "$1" - printf '%s\n' "$(cat "$TMP_MD")" > "$1" - rm "$TMP_MD" -} - -# @param -# $1 (string) filename -generate_role_variables(){ - VAR_FILE="$(dirname "$1")/defaults/main.yml" - if [ -f "$VAR_FILE" ]; then - echo "## Default variables" >> "$TMP_MD" - echo '```yaml' >> "$TMP_MD" - cat "$VAR_FILE" >> "$TMP_MD" - echo "" >> "$TMP_MD" - echo '```' >> "$TMP_MD" - echo "" >> "$TMP_MD" - fi -} - -generate_roles_toc(){ - TMP_SIDEBAR=$(mktemp) - WRITE="true" - while read -r LINE; do - case $LINE in - " - [Roles](roles)") - echo "$LINE" >> "$TMP_SIDEBAR" - parse_roles_toc roles 2 - WRITE="false" - ;; - " -"*) - WRITE="true" - echo "$LINE" >> "$TMP_SIDEBAR" - ;; - *) - if [ "$WRITE" = "true" ]; then - echo "$LINE" >> "$TMP_SIDEBAR" - fi - ;; - esac - done < "$OWN_DIR/docs/_Sidebar.md" - mv "$TMP_SIDEBAR" "$OWN_DIR/docs/_Sidebar.md" -} - -parse_roles_toc(){ - ROLES=$(find "$OWN_DIR/$1" -mindepth 2 -maxdepth 2 -name "README.md" | sort) - for ROLE in $ROLES; do - WRITE="true" - INDENT=$(printf %$(($2 * 2))s) - RELATIVE=$(realpath --relative-to="$OWN_DIR" "$(dirname "$ROLE")") - while read -r LINE; do - case $LINE in - "# "*) - if [ "$WRITE" = "true" ]; then - TITLE=$(echo "$LINE" | cut -c 3-) - echo "$INDENT"" - [$TITLE](/$RELATIVE)" >> "$TMP_SIDEBAR" - WRITE="false" - fi - ;; - esac - done < "$ROLE" - parse_roles_toc "$RELATIVE" $(($2 + 1)) - done -} - -rm -rf "$OWN_DIR/docs/roles" -ROLE_PAGES=$(find "$OWN_DIR/roles" -name "README.md") -for ROLE_PAGE in $ROLE_PAGES; do - parse_role_variables "$ROLE_PAGE" -done -for ROLE_PAGE in $ROLE_PAGES; do - cp_role_page "$ROLE_PAGE" -done -generate_roles_toc - - -cp_single_page install -cp_single_page contribute -cp_single_page scripts \ No newline at end of file