Skip to content

Fix crossplane script downloading #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 33 additions & 18 deletions .github/workflows/main-crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ 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 }}/

- name: Copy scripts to scripts folder in working directory
run: |
mkdir -p ./scripts && cp -r ${{ github.workspace }}/scripts/.github/workflows/* ./scripts
shell: sh



- name: copy scripts to scripts folder in working directory
run: |
sudo apt-get install tree
tree /home/runner/work/order-srv/order-srv


- uses: actions/download-artifact@v4
id: download
if: ${{env.zip_lambda_workflow_step == true}} || ${{env.zip_lambda_workflow_step == 'true' }}
Expand Down Expand Up @@ -99,32 +117,29 @@ 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
- name: Install 1Password CLI and patch claim
run: |
mkdir ./scripts && ls
cp -r ${{ github.workspace }}/scripts/.github/workflows ./scripts
shell: sh

- 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
# 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/workflows/scripts/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:
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/pr-crossplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down