diff --git a/.github/workflows/ce-deploy-test-drupal8.yml b/.github/workflows/ce-deploy-test-drupal8.yml index 5ebfebfa..0fba5f5a 100644 --- a/.github/workflows/ce-deploy-test-drupal8.yml +++ b/.github/workflows/ce-deploy-test-drupal8.yml @@ -7,38 +7,49 @@ jobs: # Set the job key. The key is displayed as the job name # when a job name is not provided run-tests: + if: ${{ github.event.pull_request.head.ref != 'documentation' }} # Name the Job name: Run Drupal 8 test build # Set the type of machine to run on - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest + + # Use our ce-dev Debian base container + container: + image: codeenigma/ce-dev:2.x + volumes: + - ${{ github.workspace }}:/home/controller steps: # Checks out a copy of your repository on the ubuntu-latest machine - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - # Installs the ce-dev stack - - name: Install ce-dev + # Configure environment + - name: Prepare Git and installed CE tools run: | - cd /tmp - wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz - sudo tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin - git clone https://github.com/FiloSottile/mkcert && cd mkcert - go build -ldflags "-X main.Version=$(git describe --tags)" - sudo mv ./mkcert /usr/local/bin && cd ../ - sudo chmod +x /usr/local/bin/mkcert - rm -Rf mkcert - curl -sL https://raw.githubusercontent.com/codeenigma/ce-dev/2.x/install.sh | /bin/sh -s -- --platform linux - - # Uses the ce-dev stack to run a test Drupal deploy - - name: Run a test ce-dev deploy with Drupal 8 + /usr/bin/git config --global user.email "sysadm@codeenigma.com" + /usr/bin/git config --global user.name "Code Enigma CI" + /usr/bin/git config --global pull.rebase false + /usr/bin/git config --global --add safe.directory /__w/ce-provision/ce-provision + /usr/bin/su - ce-dev -c "cd /home/ce-dev/ce-provision && /usr/bin/git pull origin 2.x" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/ce-deploy && /usr/bin/git checkout origin ${{ github.event.pull_request.base.ref }}" + /usr/bin/su - ce-dev -c "cd /home/ce-dev/ce-deploy && /usr/bin/git pull origin ${{ github.event.pull_request.base.ref }}" + + - name: Set up Ansible and SSH run: | - ce-dev create -p test -t drupal8 -d ~/test - cd ~/test - ce-dev init - ce-dev start - ce-dev provision - ce-dev deploy - curl https://www.test.local - shell: bash + mkdir -p /home/ce-dev/ansible/bin/hosts + echo "deploy-web ansible_host=127.0.0.1" > /home/ce-dev/ansible/bin/hosts/hosts + echo "StrictHostKeyChecking=no" > /home/ce-dev/.ssh/config + cat /home/ce-dev/.ssh/id_rsa.pub > /home/ce-dev/.ssh/authorized_keys + chown ce-dev:ce-dev /home/ce-dev/.ssh/config + chmod 700 /home/ce-dev/.ssh/config + chown ce-dev:ce-dev /home/ce-dev/.ssh/authorized_keys + chmod 700 /home/ce-dev/.ssh/authorized_keys + /usr/sbin/sshd& + + # @TODO install required packages for a basic web server - MySQL server and client, PHP, composer, etc. + + # Run a test Drupal deploy + #- name: Run a test ce-dev deploy with Drupal 8 + # run: | + # @TODO diff --git a/README.md b/README.md index 3046acb1..26fbcc0e 100644 --- a/README.md +++ b/README.md @@ -8,36 +8,34 @@ It allows the deploy steps for a given app to be easily customisable and to be s When triggered from a deployment tool, the stack will clone the codebase and "play" a given deploy playbook from there. -## [Install](install/README.md) -The stack only gets tested on Debian Buster, but should run on any Linux distribution, as long as Ansible >=2.9 is present. +## Install +The stack only gets tested on Debian Linux, but should run on any Linux distribution, as long as Ansible >=2.9 is present. You can install either: -- through [ce-provision](https://github.com/codeenigma/ce-provision) -- manually by running a local playbook -- with Docker (soon) - -### [Install with ce-provision](install/README.md#install-with-ce-provision) -### [Install manually](install/README.md#install-manually) -### [Install with Docker](install/README.md#install-with-docker) -### [Configuration](install/README.md#configuration) -## [Usage](scripts/README.md) + +* [With ce-provision](install/README.md#install-with-ce-provision) +* [Manually by running a local playbook](install/README.md#install-manually) +* [With Docker (coming soon)](install/README.md#install-with-docker) + +[More installation instructions can be found here.](install/README.md) + +[Configuration options here.](install/README.md#configuration) + +## Usage While you can re-use/fork roles or call playbooks directly from your deployment tool, it is recommended to use the provided wrapper scripts, as they will take care of setting up the needed environments. -### [Deploy with the "build" script](scripts/README.md#deploy-with-the-build-script) -### [Deploy with individual steps](scripts/README.md#deploy-with-individual-steps) -## [Roles](roles/README.md) -Ansible roles and group of roles that constitute the deploy stack. -### [Sync roles](roles/sync/README.md) -Roles that sync data/assets between environments. -### ["Meta"](roles/_meta/README.md) -Roles that bundles other individual roles together for tackling common use cases. -### [Data backups](roles/database_backup/README.md) -Generate backups for each build. -### [Cron](roles/cron/README.md) -Roles to generate cron entries. -### [Code deployment](roles/code/README.md) -Roles managing the codebase: deployment, symlinks, composer steps, ... -### [CLI Tools](roles/cli/README.md) -Roles to install app-specific cli tool and utilities (Drush, ...) -## [Contribute](contribute/README.md) - -### [Documentation](contribute/README.md#documentation) + +* [Deploy with the "build" script](scripts/README.md#deploy-with-the-build-script) +* [Deploy with individual steps](scripts/README.md#deploy-with-individual-steps) + +## Roles +[Ansible roles and group of roles that constitute the deploy stack.](roles/README.md) + +* [Sync roles](roles/sync/README.md) - roles that sync data/assets between environments. +* ["Meta"](roles/_meta/README.md) - roles that bundles other individual roles together for tackling common use cases. +* [Data backups](roles/database_backup/README.md) - generate backups for each build. +* [Cron](roles/cron/README.md) - roles to generate cron entries. +* [Code deployment](roles/code/README.md) - roles managing the codebase: deployment, symlinks, composer steps, ... +* [CLI Tools](roles/cli/README.md) - roles to install app-specific cli tool and utilities (Drush, cachetool, ...) + +## Contribute +[Find out more about conrtibuting here.](contribute/README.md)