Skip to content

Commit

Permalink
Update state_machine.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnauGabrielAtienza authored Jan 14, 2025
1 parent f75d392 commit 2eabf88
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/state_machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
if: startsWith(github.event.label.name, 'do_tests')
runs-on: ubuntu-latest
steps:
- name: Checkout PR code
uses: actions/checkout@v3

- name: Configure SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
Expand All @@ -30,6 +33,11 @@ jobs:
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
- name: Install yq
run: |
sudo apt-get update
sudo apt-get install yq
- name: Trigger Jenkins
env:
VPN_SERVER: ${{ secrets.VPN_SERVER }}
Expand All @@ -38,9 +46,13 @@ jobs:
JENKINS_USER: ${{ secrets.JENKINS_USER }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
run: |
METADATA_PATH=apps-code/community-apps/appliances/${{ github.event.pull_request.title }}/metadata.yaml
DISTRO=$(yq '.[":app"][":name"]' $METADATA_PATH)
REQUIREMENTS=$(yq '.[":app"][":os"][":base"]' $METADATA_PATH)
ssh -i ~/.ssh/id_rsa gitact@$VPN_SERVER -p 2222 "curl -X POST $JENKINS_URL/job/one-community-distro/buildWithParameters?token=$ONE_DISTRO_TOKEN \
--user $JENKINS_USER:$JENKINS_TOKEN \
--data DISTROS=${{ github.event.pull_request.title }} \
--data DISTROS=$DISTRO \
--data REQUIREMENTS=$REQUIREMENTS \
--data PR_NUMBER=${{ github.event.pull_request.number }}"
- name: Update labels
Expand Down

0 comments on commit 2eabf88

Please sign in to comment.