From 7f8a459ab31b64f54fba523741987d341ed70666 Mon Sep 17 00:00:00 2001 From: Kieran Patel Date: Tue, 8 Oct 2024 18:30:56 +0200 Subject: [PATCH 1/9] Fix crossplane script downloading --- .github/workflows/pr-crossplane.yaml | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pr-crossplane.yaml b/.github/workflows/pr-crossplane.yaml index 5d2d9877..70fe465d 100644 --- a/.github/workflows/pr-crossplane.yaml +++ b/.github/workflows/pr-crossplane.yaml @@ -76,11 +76,6 @@ jobs: path: ${{ github.workspace }}/dist zip_lambda_workflow_step: ${{ inputs.zip_lambda_workflow_step }} - - name: Display structure of downloaded files - run: ls -R - working-directory: ${{ steps.download.outputs.download-path }} - - - uses: hashicorp/setup-terraform@v1 with: terraform_version: ~1.4 @@ -89,26 +84,16 @@ jobs: id: downloadscripts with: name: scripts - path: ./scripts - - - name: copy scripts to scripts folder in working directory - run: | - mkdir ./scripts && ls - cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts - shell: sh + path: /tmp/scripts - name: Install 1Password Cli, patch claim run: | - curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip > op.zip - unzip op.zip - sudo mv op /usr/local/bin - rm op.zip - ls + curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.23.0.zip > op.zip + sudo unzip op.zip -d /usr/local/bin && rm op.zip python -m pip install "ruamel.yaml<0.18.0" - python scripts/workflows/scripts/patch.py - - + python /tmp/scripts/.github/workflows/scripts/patch.py + for file in *claims.yaml; do if [ -f "$file" ]; then cat $file From 7680939489001157a178029d882aebe3847cfaf5 Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:15:58 +0100 Subject: [PATCH 2/9] fix scripts path --- .github/workflows/main-crossplane.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 212f69cb..4fe8f8dd 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -99,17 +99,17 @@ jobs: with: terraform_version: ~1.4 - - uses: actions/download-artifact@v4 - id: downloadscripts - with: - name: scripts - path: ./scripts - - - name: copy scripts to scripts folder in working directory - run: | - mkdir ./scripts && ls - cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts - shell: sh +# - uses: actions/download-artifact@v4 +# id: downloadscripts +# with: +# name: scripts +# path: ./scripts +# +# - name: copy scripts to scripts folder in working directory +# run: | +# mkdir ./scripts && ls +# cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts +# shell: sh - name: Install 1Password Cli, patch claim run: | @@ -120,7 +120,7 @@ jobs: ls python -m pip install "ruamel.yaml<0.18.0" - python scripts/workflows/scripts/patch.py + python scripts/.github/workflow/patch.py for file in *claims.yaml; do if [ -f "$file" ]; then From 8f11372d6eac5eb4a127caa22492a6867c5dbf3a Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:29:01 +0100 Subject: [PATCH 3/9] fix python install --- .github/workflows/main-crossplane.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 4fe8f8dd..280248ae 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -111,20 +111,28 @@ jobs: # cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts # shell: sh - - name: Install 1Password Cli, patch claim + - name: Install 1Password CLI and patch claim run: | - curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip > op.zip + # Download and unzip 1Password CLI + curl https://cache.agilebits.com/dist/1P/op2/pkg/v2.18.0/op_linux_amd64_v2.18.0.zip -o op.zip unzip op.zip sudo mv op /usr/local/bin rm op.zip - ls - python -m pip install "ruamel.yaml<0.18.0" - - python scripts/.github/workflow/patch.py + # Setup Python environment using a virtual environment + python3 -m venv venv + source venv/bin/activate + + # Install the necessary Python package in the virtual environment + pip install "ruamel.yaml<0.18.0" + + # Run the patch.py script from the scripts folder + python scripts/.github/workflows/patch.py + + # Display contents of the YAML files for file in *claims.yaml; do if [ -f "$file" ]; then - cat $file + cat "$file" fi done env: From 7a0194c974753f338e9f950c2489e530bf809f8f Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:49:06 +0100 Subject: [PATCH 4/9] scripts path --- .github/workflows/main-crossplane.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 280248ae..546f7d39 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -99,6 +99,21 @@ jobs: with: terraform_version: ~1.4 + - name: Upload shared scripts folder as artifact + uses: actions/upload-artifact@v4 + with: + name: shared-scripts + path: ./scripts + + - name: Download shared scripts folder to new directory + uses: actions/download-artifact@v4 + with: + name: shared-scripts + path: ./new-scripts + + - name: Display structure of the downloaded shared scripts folder + run: ls -R ./new-scripts + # - uses: actions/download-artifact@v4 # id: downloadscripts # with: From 17d489884ecd4710efec46f0ed62be272d9a06f8 Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 10:53:59 +0100 Subject: [PATCH 5/9] fix scripts --- .github/workflows/main-crossplane.yaml | 38 ++++++++------------------ 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 546f7d39..7b5c0045 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -69,6 +69,18 @@ jobs: path: ${{ github.workspace }}/dist/* zip_lambda_workflow_step: ${{ inputs.zip_lambda_workflow_step }} + - uses: actions/download-artifact@v4 + id: downloadscripts + with: + name: scripts + path: ./scripts + + - name: copy scripts to scripts folder in working directory + run: | + mkdir ./scripts && ls + cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts + shell: sh + - uses: actions/download-artifact@v4 id: download if: ${{env.zip_lambda_workflow_step == true}} || ${{env.zip_lambda_workflow_step == 'true' }} @@ -99,32 +111,6 @@ jobs: with: terraform_version: ~1.4 - - name: Upload shared scripts folder as artifact - uses: actions/upload-artifact@v4 - with: - name: shared-scripts - path: ./scripts - - - name: Download shared scripts folder to new directory - uses: actions/download-artifact@v4 - with: - name: shared-scripts - path: ./new-scripts - - - name: Display structure of the downloaded shared scripts folder - run: ls -R ./new-scripts - -# - uses: actions/download-artifact@v4 -# id: downloadscripts -# with: -# name: scripts -# path: ./scripts -# -# - name: copy scripts to scripts folder in working directory -# run: | -# mkdir ./scripts && ls -# cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts -# shell: sh - name: Install 1Password CLI and patch claim run: | From 8180de2581fb1a5f712127e5dad403a5f4902bbc Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:20:36 +0100 Subject: [PATCH 6/9] fix scripts --- .github/workflows/main-crossplane.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 7b5c0045..2678b091 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -75,6 +75,13 @@ jobs: name: scripts path: ./scripts + + + - name: copy scripts to scripts folder in working directory + run: | + sudo apt-get install tree + tree /home/runner/work/order-srv/order-srv + - name: copy scripts to scripts folder in working directory run: | mkdir ./scripts && ls From e2329005cf7a8befcc524c0fb3c054857825b3a1 Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:13:22 +0100 Subject: [PATCH 7/9] fix scripts --- .github/workflows/main-crossplane.yaml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 2678b091..6abc58f8 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -69,11 +69,10 @@ jobs: path: ${{ github.workspace }}/dist/* zip_lambda_workflow_step: ${{ inputs.zip_lambda_workflow_step }} - - uses: actions/download-artifact@v4 - id: downloadscripts - with: - name: scripts - path: ./scripts + - name: Copy scripts to scripts folder in working directory + run: | + mkdir -p ./scripts && cp -r ${{ github.workspace }}/scripts/.github/workflows/* ./scripts + shell: sh @@ -82,11 +81,6 @@ jobs: sudo apt-get install tree tree /home/runner/work/order-srv/order-srv - - name: copy scripts to scripts folder in working directory - run: | - mkdir ./scripts && ls - cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts - shell: sh - uses: actions/download-artifact@v4 id: download From c62d3fbfb9edeb6452f48fcb9dafb476bfe4e35e Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:48:47 +0100 Subject: [PATCH 8/9] fix scripts --- .github/workflows/main-crossplane.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 6abc58f8..3c3f5839 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -69,6 +69,11 @@ jobs: path: ${{ github.workspace }}/dist/* zip_lambda_workflow_step: ${{ inputs.zip_lambda_workflow_step }} + - name: copy scripts to scripts folder in working directory + run: | + sudo apt-get install tree + tree ${{ github.workspace }}/scripts/.github/workflows + - name: Copy scripts to scripts folder in working directory run: | mkdir -p ./scripts && cp -r ${{ github.workspace }}/scripts/.github/workflows/* ./scripts From aa4aa39ff4f55e71bbfeafe350d16cc841363124 Mon Sep 17 00:00:00 2001 From: Precious Okwu <32944039+libracoder@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:03:52 +0100 Subject: [PATCH 9/9] fix scripts --- .github/workflows/main-crossplane.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-crossplane.yaml b/.github/workflows/main-crossplane.yaml index 3c3f5839..4288de66 100644 --- a/.github/workflows/main-crossplane.yaml +++ b/.github/workflows/main-crossplane.yaml @@ -72,7 +72,7 @@ jobs: - name: copy scripts to scripts folder in working directory run: | sudo apt-get install tree - tree ${{ github.workspace }}/scripts/.github/workflows + tree ${{ github.workspace }}/ - name: Copy scripts to scripts folder in working directory run: |