From b14085a46b138ee7210ef4237c09fe0c6d229717 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Fri, 12 Jul 2024 12:28:20 -0400 Subject: [PATCH 1/5] feat: bootstrap node update workflow --- .github/workflows/update-bootstrap.yml | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/update-bootstrap.yml diff --git a/.github/workflows/update-bootstrap.yml b/.github/workflows/update-bootstrap.yml new file mode 100644 index 000000000..fcf408d69 --- /dev/null +++ b/.github/workflows/update-bootstrap.yml @@ -0,0 +1,39 @@ +name: Update Bootstrap nodes + +on: + release: + types: [released] + +jobs: + update-bootstrap-nodes: + name: Update Bootstrap nodes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Get Release Version from Cargo.toml + id: cargo_version + run: | + VERSION=$(grep '^version' Cargo.toml | sed -E 's/version = "(.*)"/\1/') + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Checkout Ansible Playbook + uses: actions/checkout@v4 + with: + repository: ceramicstudio/simpledeploy.git + path: simpledeploy + - name: Add SSH key + run: | + echo "${{ secrets.ANSIBLE_SSH_KEY }}" > ~/.ssh/ansible_ssh_key + chmod 600 ~/.ssh/ansible_ssh_key + - name: Install Ansible requirements + working-directory: simpledeploy/ansible + run: | + sudo pip3 install -r pip.requirements.txt + - name: Update Bootstrap nodes + working-directory: simpledeploy/ansible + env: + ANSIBLE_PRIVATE_KEY_FILE: ~/.ssh/ansible_ssh_key + ANSIBLE_REMOTE_USER: ansible + run: | + ansible-playbook -i inventory/bootstrap.yml \ + --extra-vars "rust_ceramic_version=${{ env.VERSION }}" \ + playbooks/bootstrap-update.yaml From fab40b71415a9bc459de087a44c273a9b5d7d504 Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Fri, 12 Jul 2024 12:37:03 -0400 Subject: [PATCH 2/5] fix: use matric for environments --- .github/workflows/update-bootstrap.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-bootstrap.yml b/.github/workflows/update-bootstrap.yml index fcf408d69..842498bc4 100644 --- a/.github/workflows/update-bootstrap.yml +++ b/.github/workflows/update-bootstrap.yml @@ -8,6 +8,10 @@ jobs: update-bootstrap-nodes: name: Update Bootstrap nodes runs-on: ubuntu-latest + strategy: + matrix: + environment: [bootstrap-devqa, bootstrap-tnet-mainnet] + max-parallel: 1 steps: - uses: actions/checkout@v4 - name: Get Release Version from Cargo.toml @@ -28,7 +32,7 @@ jobs: working-directory: simpledeploy/ansible run: | sudo pip3 install -r pip.requirements.txt - - name: Update Bootstrap nodes + - name: Update ${{ matrix.environment }} Bootstrap nodes working-directory: simpledeploy/ansible env: ANSIBLE_PRIVATE_KEY_FILE: ~/.ssh/ansible_ssh_key @@ -36,4 +40,5 @@ jobs: run: | ansible-playbook -i inventory/bootstrap.yml \ --extra-vars "rust_ceramic_version=${{ env.VERSION }}" \ + --limit ${{ matrix.environment == 'bootstrap-tnet-mainnet' && 'tnet,mainnet' || 'devqa' }} \ playbooks/bootstrap-update.yaml From ba4647803ef7224026c949228b741113d119e05b Mon Sep 17 00:00:00 2001 From: Ben Wilson Date: Fri, 12 Jul 2024 12:39:23 -0400 Subject: [PATCH 3/5] chore: fix repo name --- .github/workflows/update-bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-bootstrap.yml b/.github/workflows/update-bootstrap.yml index 842498bc4..898ebcf48 100644 --- a/.github/workflows/update-bootstrap.yml +++ b/.github/workflows/update-bootstrap.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout Ansible Playbook uses: actions/checkout@v4 with: - repository: ceramicstudio/simpledeploy.git + repository: ceramicstudio/simpledeploy path: simpledeploy - name: Add SSH key run: | From 0bef7ae308d35b0eba7b7825d5a685a61562c280 Mon Sep 17 00:00:00 2001 From: Ben Wilson <114362991+3benbox@users.noreply.github.com> Date: Mon, 15 Jul 2024 08:56:21 -0400 Subject: [PATCH 4/5] fix: use matrix limit Co-authored-by: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> --- .github/workflows/update-bootstrap.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-bootstrap.yml b/.github/workflows/update-bootstrap.yml index 898ebcf48..5ed790838 100644 --- a/.github/workflows/update-bootstrap.yml +++ b/.github/workflows/update-bootstrap.yml @@ -10,7 +10,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - environment: [bootstrap-devqa, bootstrap-tnet-mainnet] + include: + - environment: bootstrap-tnet-mainnet + limit: tnet,mainnet + - environmnt: bootstrap-devqa + limit: devqa max-parallel: 1 steps: - uses: actions/checkout@v4 From 339910b09dc6e3dfff14df6642f0ea8f63c9a9e8 Mon Sep 17 00:00:00 2001 From: Ben Wilson <114362991+3benbox@users.noreply.github.com> Date: Mon, 15 Jul 2024 08:57:06 -0400 Subject: [PATCH 5/5] fix: use matrix limit Co-authored-by: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> --- .github/workflows/update-bootstrap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-bootstrap.yml b/.github/workflows/update-bootstrap.yml index 5ed790838..04d08695e 100644 --- a/.github/workflows/update-bootstrap.yml +++ b/.github/workflows/update-bootstrap.yml @@ -44,5 +44,5 @@ jobs: run: | ansible-playbook -i inventory/bootstrap.yml \ --extra-vars "rust_ceramic_version=${{ env.VERSION }}" \ - --limit ${{ matrix.environment == 'bootstrap-tnet-mainnet' && 'tnet,mainnet' || 'devqa' }} \ + --limit ${{ matrix.limit }} \ playbooks/bootstrap-update.yaml