Skip to content

Commit

Permalink
test local dispatch
Browse files Browse the repository at this point in the history
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
  • Loading branch information
galal-hussein committed Jun 10, 2024
1 parent fe93a53 commit 7cced6c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,27 +118,28 @@ jobs:
with:
files: |
dist/artifacts/*
# dispatch:
# needs: [release-amd64, release-arm64]
# runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
dispatch:
needs: [release-amd64, release-arm64]
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64
steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Install Dapper
# run: |
# curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
# chmod +x /usr/local/bin/dapper
- name: Install Dapper
run: |
curl -sL https://releases.rancher.com/dapper/latest/dapper-$(uname -s)-$(uname -m) > /usr/local/bin/dapper
chmod +x /usr/local/bin/dapper
# - name: "Read secrets"
# uses: rancher-eio/read-vault-secrets@main
# with:
# secrets: |
# secret/data/github/repo/${{ github.repository }}/pat_username/credentials token | PAT_USERNAME ;
# - name: "Read secrets"
# uses: rancher-eio/read-vault-secrets@main
# with:
# secrets: |
# secret/data/github/repo/${{ github.repository }}/pat_username/credentials token | PAT_USERNAME ;

# - name: Dispatch
# run: |
# dapper -f Dockerfile --target dapper make dispatch
# env:
# PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PATH_USERNAME: ${{ env.PAT_USERNAME }}
- name: Dispatch
run: |
dapper -f Dockerfile --target dapper make dispatch
env:
PAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PATH_USERNAME: ${{ secrets.PAT_USERNAME }}
GITHUB_ACTION_TAG: ${{ env.GITHUB_ACTION_TAG }}
8 changes: 4 additions & 4 deletions scripts/dispatch
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#!/usr/bin/env bash
set -ex

REPO="https://api.github.com/repos/rancher/rke2-upgrade/dispatches"
REPO="https://api.github.com/repos/galal-hussein/rke2-upgrade/dispatches"

# send dispatch event to REPO
curl -XPOST -u "${PAT_USERNAME}:${PAT_TOKEN}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" $REPO \
--data '{"event_type": "create_tag", "client_payload": {"tag":"'"$DRONE_TAG"'"}}'
--data '{"event_type": "create_tag", "client_payload": {"tag":"'"$GITHUB_ACTION_TAG"'"}}'

SYSTEM_AGENT_INSTALLER_RKE2_REPO="https://api.github.com/repos/rancher/system-agent-installer-rke2/dispatches"
SYSTEM_AGENT_INSTALLER_RKE2_REPO="https://api.github.com/repos/galal-hussein/system-agent-installer-rke2/dispatches"

# send dispatch event to SYSTEM_AGENT_INSTALLER_RKE2_REPO
curl -XPOST -u "${PAT_USERNAME}:${PAT_TOKEN}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" $SYSTEM_AGENT_INSTALLER_RKE2_REPO \
--data '{"event_type": "create_tag", "client_payload": {"tag":"'"$DRONE_TAG"'"}}'
--data '{"event_type": "create_tag", "client_payload": {"tag":"'"$GITHUB_ACTION_TAG"'"}}'

0 comments on commit 7cced6c

Please sign in to comment.