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 diff --git a/templates/blank/ce-dev/ansible/provision.yml.j2 b/templates/blank/ce-dev/ansible/provision.yml.j2 index 4f1cd80..0e19d73 100644 --- a/templates/blank/ce-dev/ansible/provision.yml.j2 +++ b/templates/blank/ce-dev/ansible/provision.yml.j2 @@ -12,6 +12,8 @@ enable_vnc: true - nodejs: version: 14.x + - apt_unattended_upgrades: + enable: false tasks: - apt: update_cache: true diff --git a/templates/drupal8/ce-dev/ansible/deploy.yml.j2 b/templates/drupal8/ce-dev/ansible/deploy.yml.j2 index bf411e6..ee6e635 100644 --- a/templates/drupal8/ce-dev/ansible/deploy.yml.j2 +++ b/templates/drupal8/ce-dev/ansible/deploy.yml.j2 @@ -38,14 +38,35 @@ 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: Adding composer/installers plugin to composer config. + community.general.composer: + command: config + arguments: allow-plugins.composer/installers true + working_dir: "{{ deploy_path }}" + - name: Adding drupal/core-composer-scaffold plugin to composer config. + community.general.composer: + command: config + arguments: allow-plugins.drupal/core-composer-scaffold true + working_dir: "{{ deploy_path }}" + - name: Adding drupal/core-project-message plugin to composer config. + community.general.composer: + command: config + arguments: allow-plugins.drupal/core-project-message true + working_dir: "{{ deploy_path }}" + - name: Adding dealerdirect/phpcodesniffer-composer-installer plugin to composer config. + community.general.composer: + command: config + arguments: allow-plugins.dealerdirect/phpcodesniffer-composer-installer true + working_dir: "{{ deploy_path }}" - 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/drupal8/ce-dev/ansible/provision.yml.j2 b/templates/drupal8/ce-dev/ansible/provision.yml.j2 index 1cb1a92..d9df833 100644 --- a/templates/drupal8/ce-dev/ansible/provision.yml.j2 +++ b/templates/drupal8/ce-dev/ansible/provision.yml.j2 @@ -46,6 +46,8 @@ cli: true - lhci: enable_vnc: true + - apt_unattended_upgrades: + enable: false {% endraw %} tasks: - apt: 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/drupal9/ce-dev/ansible/provision.yml.j2 b/templates/drupal9/ce-dev/ansible/provision.yml.j2 index 1c252ef..3bfd917 100644 --- a/templates/drupal9/ce-dev/ansible/provision.yml.j2 +++ b/templates/drupal9/ce-dev/ansible/provision.yml.j2 @@ -52,6 +52,8 @@ enable_vnc: true - nodejs: version: 16.x + - apt_unattended_upgrades: + enable: false {% endraw %} tasks: - apt: diff --git a/templates/localgov/ce-dev/ansible/deploy.yml.j2 b/templates/localgov/ce-dev/ansible/deploy.yml.j2 index 8637751..6a7a660 100644 --- a/templates/localgov/ce-dev/ansible/deploy.yml.j2 +++ b/templates/localgov/ce-dev/ansible/deploy.yml.j2 @@ -38,18 +38,20 @@ 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/9.3.x/composer.json + ansible.builtin.get_url: + url: https://raw.githubusercontent.com/drupal/recommended-project/10.1.x/composer.json dest: "{{ deploy_path }}/composer.json" force: false - name: Install drush. - command: - cmd: composer require drush/drush:11.* - chdir: "{{ deploy_path }}" + community.general.composer: + command: require + arguments: drush/drush:11.* + working_dir: "{{ deploy_path }}" - name: Install localgov. - command: - cmd: composer require localgovdrupal/localgov - chdir: "{{ deploy_path }}" + community.general.composer: + command: require + arguments: localgovdrupal/localgov + working_dir: "{{ deploy_path }}" roles: - _init # Sets some variables the deploy scripts rely on. - composer # Composer install step. diff --git a/templates/localgov/ce-dev/ansible/provision.yml.j2 b/templates/localgov/ce-dev/ansible/provision.yml.j2 index 1cb1a92..d9df833 100644 --- a/templates/localgov/ce-dev/ansible/provision.yml.j2 +++ b/templates/localgov/ce-dev/ansible/provision.yml.j2 @@ -46,6 +46,8 @@ cli: true - lhci: enable_vnc: true + - apt_unattended_upgrades: + enable: false {% endraw %} tasks: - apt: