From 5f8a972fa29909e01242f533fca22eab10c2affe Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Sat, 21 Dec 2024 09:48:00 +0100 Subject: [PATCH 1/6] Create ce-provision-test-nightly.yml --- .../workflows/ce-provision-test-nightly.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ce-provision-test-nightly.yml diff --git a/.github/workflows/ce-provision-test-nightly.yml b/.github/workflows/ce-provision-test-nightly.yml new file mode 100644 index 000000000..d687dba97 --- /dev/null +++ b/.github/workflows/ce-provision-test-nightly.yml @@ -0,0 +1,44 @@ +name: Run night test builds + +# Run this workflow nightly +on: + schedule: + - cron: '30 4 * * *' + +jobs: + # Set the job key. The key is displayed as the job name + # when a job name is not provided + test-nightly: + if: ${{ github.event.pull_request.head.ref != 'documentation' }} + # Name the Job + name: Build server with ce-provision + # Set the type of machine to run on + runs-on: ubuntu-latest + + # Use our ce-dev Debian base container + container: + image: codeenigma/ce-dev:2.x + volumes: + - ${{ github.workspace }}:/home/controller + + steps: + - name: Install ce-provision + run: | + /usr/bin/curl -LO https://raw.githubusercontent.com/codeenigma/ce-provision/${{ github.event.pull_request.head.ref }}/install.sh + /usr/bin/chmod +x ./install.sh + /usr/bin/sudo ./install.sh --version ${{ github.event.pull_request.head.ref }} --config-branch ${{ github.event.pull_request.base.ref }} --docker --no-firewall + + # Run a web server provision + - name: Prepare Git repos on disk + run: | + /usr/bin/git config --global --add safe.directory /home/controller/ce-provision + /usr/bin/git config --global --add safe.directory /home/controller/ce-provision/config + + - name: Start SSHD + run: /usr/sbin/sshd& + + - name: Provision a test web server + run: /usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/web/ci.yml --own-branch ${{ github.event.pull_request.head.ref }} --config-branch ${{ github.event.pull_request.base.ref }} --force" + + - name: Provision a test GitLab server + run: /usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/gitlab/ci.yml --own-branch ${{ github.event.pull_request.head.ref }} --config-branch ${{ github.event.pull_request.base.ref }} --force" From 3e9fedce5cb77c66004d862909bc7b5cfe278caa Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Sat, 21 Dec 2024 09:49:34 +0100 Subject: [PATCH 2/6] Remove nightly check from GitLab test. --- .github/workflows/ce-provision-test-gitlab.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ce-provision-test-gitlab.yml b/.github/workflows/ce-provision-test-gitlab.yml index bd50e7233..9e5b46a30 100644 --- a/.github/workflows/ce-provision-test-gitlab.yml +++ b/.github/workflows/ce-provision-test-gitlab.yml @@ -1,9 +1,7 @@ name: Run GitLab server test build -# Run this workflow nightly and every time a new commit pushed to your repository +# Run this workflow every time a new commit is pushed to your repository on: - schedule: - - cron: '30 4 * * *' pull_request: jobs: From 865318641d1ed995f4a72017ca59a57c106c6684 Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Sat, 21 Dec 2024 09:50:12 +0100 Subject: [PATCH 3/6] Remove nightly check from web server test. --- .github/workflows/ce-provision-test-web.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ce-provision-test-web.yml b/.github/workflows/ce-provision-test-web.yml index 54421cd40..595905064 100644 --- a/.github/workflows/ce-provision-test-web.yml +++ b/.github/workflows/ce-provision-test-web.yml @@ -1,9 +1,7 @@ name: Run web server test build -# Run this workflow nightly and every time a new commit pushed to your repository +# Run this every time a new commit is pushed to your repository on: - schedule: - - cron: '30 4 * * *' pull_request: jobs: From 8b5879dfe866f534d6280f0614840564e0433b6a Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Sat, 21 Dec 2024 10:57:55 +0100 Subject: [PATCH 4/6] Removing branch references. --- .github/workflows/ce-provision-test-nightly.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ce-provision-test-nightly.yml b/.github/workflows/ce-provision-test-nightly.yml index d687dba97..a001b99f0 100644 --- a/.github/workflows/ce-provision-test-nightly.yml +++ b/.github/workflows/ce-provision-test-nightly.yml @@ -9,7 +9,6 @@ jobs: # Set the job key. The key is displayed as the job name # when a job name is not provided test-nightly: - if: ${{ github.event.pull_request.head.ref != 'documentation' }} # Name the Job name: Build server with ce-provision # Set the type of machine to run on @@ -24,9 +23,9 @@ jobs: steps: - name: Install ce-provision run: | - /usr/bin/curl -LO https://raw.githubusercontent.com/codeenigma/ce-provision/${{ github.event.pull_request.head.ref }}/install.sh + /usr/bin/curl -LO https://raw.githubusercontent.com/codeenigma/ce-provision/2.x/install.sh /usr/bin/chmod +x ./install.sh - /usr/bin/sudo ./install.sh --version ${{ github.event.pull_request.head.ref }} --config-branch ${{ github.event.pull_request.base.ref }} --docker --no-firewall + /usr/bin/sudo ./install.sh --config-branch 2.x --docker --no-firewall # Run a web server provision - name: Prepare Git repos on disk @@ -38,7 +37,7 @@ jobs: run: /usr/sbin/sshd& - name: Provision a test web server - run: /usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/web/ci.yml --own-branch ${{ github.event.pull_request.head.ref }} --config-branch ${{ github.event.pull_request.base.ref }} --force" + run: /usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/web/ci.yml --own-branch 2.x --config-branch 2.x --force" - name: Provision a test GitLab server - run: /usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/gitlab/ci.yml --own-branch ${{ github.event.pull_request.head.ref }} --config-branch ${{ github.event.pull_request.base.ref }} --force" + run: /usr/bin/su - controller -c "cd /home/controller/ce-provision && /bin/sh /home/controller/ce-provision/scripts/provision.sh --python-interpreter /home/controller/ce-python/bin/python3 --repo dummy --branch dummy --workspace /home/controller/ce-provision/ce-dev/ansible --playbook plays/gitlab/ci.yml --own-branch 2.x --config-branch 2.x --force" From 0a4aec415f6c90893ddc709314f5914cf5a895de Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Sat, 21 Dec 2024 10:58:37 +0100 Subject: [PATCH 5/6] Updating installer config branch to 2.x --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 7ca8822d0..53db4ce5d 100755 --- a/install.sh +++ b/install.sh @@ -14,7 +14,7 @@ usage(){ /usr/bin/echo '--version: ce-provision version to use (default: 2.x)' /usr/bin/echo '--user: Ansible controller user (default: controller)' /usr/bin/echo '--config: Git URL to your ce-provision Ansible config repository (default: https://github.com/codeenigma/ce-provision-config-example.git)' - /usr/bin/echo '--config-branch: branch of your Ansible config repository to use (default: 1.x)' + /usr/bin/echo '--config-branch: branch of your Ansible config repository to use (default: 2.x)' /usr/bin/echo '--no-firewall: skip installing iptables with ports 22, 80 and 443 open' /usr/bin/echo '--gitlab: install GitLab CE on this server (default: no, set to desired GitLab address to install, e.g. gitlab.example.com)' /usr/bin/echo '--letsencrypt: try to create an SSL certificate with LetsEncrypt (requires DNS pointing at this server for provided GitLab URL)' @@ -72,7 +72,7 @@ parse_options(){ VERSION="2.x" CONTROLLER_USER="controller" CONFIG_REPO="https://github.com/codeenigma/ce-provision-config-example.git" -CONFIG_REPO_BRANCH="1.x" +CONFIG_REPO_BRANCH="2.x" GITLAB_URL="no" LE_SUPPORT="no" FIREWALL="true" From 74702ac4c8e8ed14b265235f442ecb3ae4c9ee39 Mon Sep 17 00:00:00 2001 From: Greg Harvey Date: Sat, 21 Dec 2024 10:59:26 +0100 Subject: [PATCH 6/6] Removing config branch, default is fine now --- .github/workflows/ce-provision-test-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ce-provision-test-nightly.yml b/.github/workflows/ce-provision-test-nightly.yml index a001b99f0..a10fdd67a 100644 --- a/.github/workflows/ce-provision-test-nightly.yml +++ b/.github/workflows/ce-provision-test-nightly.yml @@ -25,7 +25,7 @@ jobs: run: | /usr/bin/curl -LO https://raw.githubusercontent.com/codeenigma/ce-provision/2.x/install.sh /usr/bin/chmod +x ./install.sh - /usr/bin/sudo ./install.sh --config-branch 2.x --docker --no-firewall + /usr/bin/sudo ./install.sh --docker --no-firewall # Run a web server provision - name: Prepare Git repos on disk