diff --git a/.github/workflows/ce-dev-build.yml b/.github/workflows/ce-dev-build.yml index f39c9a5..5bed936 100644 --- a/.github/workflows/ce-dev-build.yml +++ b/.github/workflows/ce-dev-build.yml @@ -42,7 +42,8 @@ jobs: - name: Build and push Docker images run: | echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - /bin/sh docker-images/export.sh latest --push + /bin/sh docker-images/export.sh --version latest --image-name ce-dev --dockerfile-path base --push + /bin/sh docker-images/export.sh --version latest --image-name ce-dev-controller --dockerfile-path controller --push echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin /bin/sh templates/prebuild.sh --push # Uses https://github.com/marketplace/actions/gh-release diff --git a/docker-images/base/Dockerfile b/docker-images/base/Dockerfile index 2c89636..c3658b9 100644 --- a/docker-images/base/Dockerfile +++ b/docker-images/base/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bookworm-slim as unison +FROM debian:bullseye-slim as unison RUN \ set -x && \ export DEBIAN_FRONTEND=noninteractive && \ @@ -14,7 +14,7 @@ RUN \ cd /tmp/unison-2.53.3 && \ make -FROM debian:bookworm-slim +FROM debian:bullseye-slim RUN \ set -x && \ diff --git a/docker-images/dind/Dockerfile b/docker-images/dind/Dockerfile index 5675565..cf27486 100644 --- a/docker-images/dind/Dockerfile +++ b/docker-images/dind/Dockerfile @@ -9,7 +9,7 @@ RUN \ RUN \ set -x && \ export DEBIAN_FRONTEND=noninteractive && \ - echo 'deb [arch=amd64] https://download.docker.com/linux/debian bookworm stable' > /etc/apt/sources.list.d/docker.list && \ + echo 'deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable' > /etc/apt/sources.list.d/docker.list && \ curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ apt-get update && \ apt-get dist-upgrade -y -o Dpkg::Options::="--force-confnew" && \ diff --git a/src/commands/provision.ts b/src/commands/provision.ts index 45be286..ae6f490 100644 --- a/src/commands/provision.ts +++ b/src/commands/provision.ts @@ -1,29 +1,53 @@ import AnsibleCmd from '../base-cmd-ansible-abstract' +import {flags} from '@oclif/command' export default class ProvisionCmd extends AnsibleCmd { static description = 'Provision containers with Ansible playbooks.' + static examples = [ + '$ ce-dev provision --branch 1.x --config 1.x', + ] + + static flags = { + help: flags.help({char: 'h'}), + branch: flags.string({ + char: 'b', + description: 'The branch of ce-provision to use for provisioning your containers. See https://github.com/codeenigma/ce-provision for options.', + default: '1.x', + }), + config: flags.string({ + char: 'c', + description: 'The branch of the ce-provision-config repository. See https://github.com/codeenigma/ce-dev-ce-provision-config for options.', + default: '1.x', + }), + } + protected ansibleProjectPlaybooksPath = '/home/ce-dev/projects-playbooks/provision' protected ansibleScriptsPath = '/home/ce-dev/ce-provision' protected ansibleScript = 'scripts/provision.sh' + protected ownBranch = '1.x' + + protected configBranch = '1.x' + /** * @inheritdoc */ public constructor(argv: string[], config: any) { super(argv, config) + const {flags} = this.parse(ProvisionCmd) this.ansiblePaths = this.activeProjectInfo.provision + this.ownBranch = flags.branch + this.configBranch = flags.config } protected getCommandParameters(ansiblePath: string): string { const workspace = this.ansibleProjectPlaybooksPath const repo = this.activeProjectInfo.project_name - const ownBranch = '1.x' - const configBranch = '1.x' - let cmd = '--own-branch ' + ownBranch - cmd += ' --config-branch ' + configBranch + let cmd = '--own-branch ' + this.ownBranch + cmd += ' --config-branch ' + this.configBranch cmd += ' --workspace ' + workspace cmd += ' --repo ' + repo cmd += ' --branch ce-dev --playbook ' + ansiblePath diff --git a/templates/drupal10/ce-dev/ansible/provision.yml.j2 b/templates/drupal10/ce-dev/ansible/provision.yml.j2 index 086eaae..25dd455 100644 --- a/templates/drupal10/ce-dev/ansible/provision.yml.j2 +++ b/templates/drupal10/ce-dev/ansible/provision.yml.j2 @@ -56,19 +56,19 @@ enable: false {% endraw %} tasks: - - ansible.builtin.apt: + - apt: update_cache: true - - ansible.builtin.import_role: + - import_role: name: _meta/common_base - - ansible.builtin.import_role: - name: debian/mysql_client - - ansible.builtin.import_role: - name: debian/php-cli - - ansible.builtin.import_role: - name: debian/php-fpm - - ansible.builtin.import_role: - name: debian/nginx - - ansible.builtin.import_role: - name: debian/lhci - - ansible.builtin.import_role: - name: debian/frontail + - import_role: + name: mysql_client + - import_role: + name: php-cli + - import_role: + name: php-fpm + - import_role: + name: nginx + - import_role: + name: lhci + - import_role: + name: frontail diff --git a/templates/drupal9/ce-dev/ansible/provision.yml.j2 b/templates/drupal9/ce-dev/ansible/provision.yml.j2 index 11dd802..2e99b23 100644 --- a/templates/drupal9/ce-dev/ansible/provision.yml.j2 +++ b/templates/drupal9/ce-dev/ansible/provision.yml.j2 @@ -56,19 +56,19 @@ enable: false {% endraw %} tasks: - - ansible.builtin.apt: + - apt: update_cache: true - - ansible.builtin.import_role: + - import_role: name: _meta/common_base - - ansible.builtin.import_role: - name: debian/mysql_client - - ansible.builtin.import_role: - name: debian/php-cli - - ansible.builtin.import_role: - name: debian/php-fpm - - ansible.builtin.import_role: - name: debian/nginx - - ansible.builtin.import_role: - name: debian/lhci - - ansible.builtin.import_role: - name: debian/frontail + - import_role: + name: mysql_client + - import_role: + name: php-cli + - import_role: + name: php-fpm + - import_role: + name: nginx + - import_role: + name: lhci + - import_role: + name: frontail diff --git a/templates/localgov/ce-dev/ansible/provision.yml.j2 b/templates/localgov/ce-dev/ansible/provision.yml.j2 index d30e1de..f171a78 100644 --- a/templates/localgov/ce-dev/ansible/provision.yml.j2 +++ b/templates/localgov/ce-dev/ansible/provision.yml.j2 @@ -50,19 +50,19 @@ enable: false {% endraw %} tasks: - - ansible.builtin.apt: + - apt: update_cache: true - - ansible.builtin.import_role: + - import_role: name: _meta/common_base - - ansible.builtin.import_role: - name: debian/mysql_client - - ansible.builtin.import_role: - name: debian/php-cli - - ansible.builtin.import_role: - name: debian/php-fpm - - ansible.builtin.import_role: - name: debian/nginx - - ansible.builtin.import_role: - name: debian/lhci - - ansible.builtin.import_role: - name: debian/frontail + - import_role: + name: mysql_client + - import_role: + name: php-cli + - import_role: + name: php-fpm + - import_role: + name: nginx + - import_role: + name: lhci + - import_role: + name: frontail diff --git a/yarn.lock b/yarn.lock index 0eadd05..728ca4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -648,11 +648,11 @@ cross-spawn@^7.0.2: which "^2.0.1" debug@^4.0.0, debug@^4.0.1, debug@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: - ms "^2.1.1" + ms "2.1.2" deep-is@^0.1.3: version "0.1.3" @@ -1614,7 +1614,7 @@ moment@^2.22.1: resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" integrity sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w== -ms@^2.1.1: +ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -2369,9 +2369,9 @@ widest-line@^3.1.0: string-width "^4.0.0" word-wrap@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + version "1.2.4" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f" + integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA== wrap-ansi@^4.0.0: version "4.0.0"