mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-09 09:17:27 +00:00
Change repository name used in bootstrap tests
This changes the name of the repository that is used for the GitHub end-to-end tests to a name that is still traceable to the source (repository) that created it, by using the format `<ORIGIN_REPOSITORY_NAME>-<PSEUDO_RAND_SUFFIX>`. The `PSEUDO_RAND_SUFFIX` is a SHA1 sum of the name of the branch and commit SHA the tests run for, resulting in a 40 character suffix that unlike the short commit SHA used before, should not result in collisions. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
9f10b6be1b
commit
0239307d8e
1 changed files with 11 additions and 5 deletions
16
.github/workflows/bootstrap.yaml
vendored
16
.github/workflows/bootstrap.yaml
vendored
|
|
@ -34,12 +34,18 @@ jobs:
|
|||
go build -o /tmp/flux ./cmd/flux
|
||||
- name: Set outputs
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
run: |
|
||||
REPOSITORY_NAME=${{ github.event.repository.name }}
|
||||
BRANCH_NAME=${GITHUB_REF##*/}
|
||||
COMMIT_SHA=$(git rev-parse HEAD)
|
||||
PSEUDO_RAND_SUFFIX=$(echo "${BRANCH_NAME}-${COMMIT_SHA}" | shasum | awk '{print $1}')
|
||||
TEST_REPO_NAME="${REPOSITORY_NAME}-${PSEUDO_RAND_SUFFIX}"
|
||||
echo "::set-output name=test_repo_name::$TEST_REPO_NAME"
|
||||
- name: bootstrap init
|
||||
run: |
|
||||
/tmp/flux bootstrap github --manifests ./manifests/install/ \
|
||||
--owner=fluxcd-testing \
|
||||
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
|
||||
--repository=${{ steps.vars.outputs.test_repo_name }} \
|
||||
--branch=main \
|
||||
--path=test-cluster
|
||||
env:
|
||||
|
|
@ -48,7 +54,7 @@ jobs:
|
|||
run: |
|
||||
/tmp/flux bootstrap github --manifests ./manifests/install/ \
|
||||
--owner=fluxcd-testing \
|
||||
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
|
||||
--repository=${{ steps.vars.outputs.test_repo_name }} \
|
||||
--branch=main \
|
||||
--path=test-cluster
|
||||
env:
|
||||
|
|
@ -61,7 +67,7 @@ jobs:
|
|||
run: |
|
||||
/tmp/flux bootstrap github --manifests ./manifests/install/ \
|
||||
--owner=fluxcd-testing \
|
||||
--repository=flux-test-${{ steps.vars.outputs.sha_short }} \
|
||||
--repository=${{ steps.vars.outputs.test_repo_name }} \
|
||||
--branch=main \
|
||||
--path=test-cluster
|
||||
env:
|
||||
|
|
@ -73,7 +79,7 @@ jobs:
|
|||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token ${GITHUB_TOKEN}" \
|
||||
--fail --silent \
|
||||
https://api.github.com/repos/fluxcd-testing/flux-test-${{ steps.vars.outputs.sha_short }}
|
||||
https://api.github.com/repos/fluxcd-testing/${{ steps.vars.outputs.test_repo_name }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }}
|
||||
- name: Debug failure
|
||||
|
|
|
|||
Loading…
Reference in a new issue