mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-07 06:22:17 -04:00
make release idempotent (#2278)
This commit is contained in:
parent
a671367794
commit
7c9a78fe51
3 changed files with 17 additions and 23 deletions
16
.github/workflows/on-release.yml
vendored
16
.github/workflows/on-release.yml
vendored
|
@ -27,6 +27,8 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # fetch all history
|
||||||
|
|
||||||
- name: Determine branch names
|
- name: Determine branch names
|
||||||
run: |
|
run: |
|
||||||
|
@ -35,20 +37,8 @@ jobs:
|
||||||
PART_MINOR=${WITHOUT_V#*.}
|
PART_MINOR=${WITHOUT_V#*.}
|
||||||
MAJOR_MINOR=${PART_MAJOR}.${PART_MINOR}
|
MAJOR_MINOR=${PART_MAJOR}.${PART_MINOR}
|
||||||
RELEASE_BRANCH="release/v${MAJOR_MINOR}"
|
RELEASE_BRANCH="release/v${MAJOR_MINOR}"
|
||||||
WORKING_BRANCH_PREFIX="origin/tmp/${FULL_VERSION}"
|
WORKING_BRANCH="tmp/${FULL_VERSION}"
|
||||||
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" | tee -a "$GITHUB_ENV"
|
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" | tee -a "$GITHUB_ENV"
|
||||||
echo "WORKING_BRANCH_PREFIX=${WORKING_BRANCH_PREFIX}" | tee -a "$GITHUB_ENV"
|
|
||||||
|
|
||||||
- name: Find temporary branch
|
|
||||||
id: find-temporary-branch
|
|
||||||
run: |
|
|
||||||
working_branch_count=$(git branch --list -r "${WORKING_BRANCH_PREFIX}*" | wc -l)
|
|
||||||
if [[ "${working_branch_count}" -ne 1 ]]; then
|
|
||||||
echo "More than one (or zero) temporary branches found. Cannot finish transaction."
|
|
||||||
git branch --list "${WORKING_BRANCH_PREFIX}*"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
WORKING_BRANCH=$(git branch --list "${WORKING_BRANCH_PREFIX}*" | head -n 1 | sed -e 's/^[[:space:]]*//')
|
|
||||||
echo "WORKING_BRANCH=${WORKING_BRANCH}" | tee -a "$GITHUB_ENV"
|
echo "WORKING_BRANCH=${WORKING_BRANCH}" | tee -a "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Check if we are strictly ahead of the release branch (if it exists)
|
- name: Check if we are strictly ahead of the release branch (if it exists)
|
||||||
|
|
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
|
@ -13,6 +13,9 @@ on:
|
||||||
required: true
|
required: true
|
||||||
default: "minor"
|
default: "minor"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
verify-inputs:
|
verify-inputs:
|
||||||
name: Verify inputs
|
name: Verify inputs
|
||||||
|
@ -44,8 +47,8 @@ jobs:
|
||||||
|
|
||||||
- name: Verify temporary branch
|
- name: Verify temporary branch
|
||||||
run: |
|
run: |
|
||||||
if [[ ! "${WORKING_BRANCH}" =~ ^tmp/v[0-9]+\.[0-9]+\.[0-9]+(/.+)? ]]; then
|
if [[ ! "${WORKING_BRANCH}" =~ ^tmp/v[0-9]+\.[0-9]+\.[0-9] ]]; then
|
||||||
echo "Workflow can only be triggered from a temporary branch in the form of tmp/vX.Y.Z/..."
|
echo "Workflow can only be triggered from a temporary branch in the form of tmp/vX.Y.Z"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -176,8 +179,12 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "edgelessci"
|
git config --global user.name "edgelessci"
|
||||||
git config --global user.email "edgelessci@users.noreply.github.com"
|
git config --global user.email "edgelessci@users.noreply.github.com"
|
||||||
git commit -m "deps: update images to ${VERSION}"
|
if git diff-index --quiet HEAD --; then
|
||||||
git push
|
echo "No changes to commit"
|
||||||
|
else
|
||||||
|
git commit -m "deps: update images to ${VERSION}"
|
||||||
|
git push
|
||||||
|
fi
|
||||||
|
|
||||||
os-image:
|
os-image:
|
||||||
name: Build OS image
|
name: Build OS image
|
||||||
|
@ -251,7 +258,7 @@ jobs:
|
||||||
git config --global user.name "edgelessci"
|
git config --global user.name "edgelessci"
|
||||||
git config --global user.email "edgelessci@users.noreply.github.com"
|
git config --global user.email "edgelessci@users.noreply.github.com"
|
||||||
git tag -a "${VERSION}" -m "Release ${VERSION}"
|
git tag -a "${VERSION}" -m "Release ${VERSION}"
|
||||||
git push origin "refs/tags/${VERSION}"
|
git push --force origin "refs/tags/${VERSION}" # force push to overwrite existing tag
|
||||||
|
|
||||||
draft-release-cli:
|
draft-release-cli:
|
||||||
name: Draft release (CLI)
|
name: Draft release (CLI)
|
||||||
|
|
|
@ -79,11 +79,8 @@ Then wait until the node / Kubernetes upgrades are finished by periodically chec
|
||||||
4. Update the `fromVersion` in `e2e-test-release.yml` and `e2e-test-weekly.yaml` to the newly released version. To check the current values, run: `grep "fromVersion: \[.*\]" -R .github`.
|
4. Update the `fromVersion` in `e2e-test-release.yml` and `e2e-test-weekly.yaml` to the newly released version. To check the current values, run: `grep "fromVersion: \[.*\]" -R .github`.
|
||||||
5. Reset `upgradeRequiresIAMMigration` in `iamupgradeapply.go`.
|
5. Reset `upgradeRequiresIAMMigration` in `iamupgradeapply.go`.
|
||||||
|
|
||||||
## Pipeline cleanup
|
## Troubleshooting: Pipeline cleanup
|
||||||
|
No manual steps should be necessary anymore but in case you encounter issues, create a ticket to fix it. These are instructions to do some cleanup steps manually:
|
||||||
When testing changes to the pipeline or when the pipeline fails during a release it might become necessary to clean up the images created by the pipeline.
|
|
||||||
These are the necessary steps.
|
|
||||||
|
|
||||||
### General
|
### General
|
||||||
|
|
||||||
Depending on how far the pipeline ran we need to delete:
|
Depending on how far the pipeline ran we need to delete:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue