Skip to content
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

fix: update logic for determining network-operator base branch for va… #54

Open
wants to merge 1 commit into
base: network-operator-25.1.x
Choose a base branch
from
Open
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
29 changes: 17 additions & 12 deletions .github/workflows/fork-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
- if: github.ref_type == 'branch'
name: Determine docker registry and tag (when git branch)
run: |
echo DOCKER_REGISTRY=$REGISTRY_INTERNAL >> $GITHUB_ENV
echo DOCKER_TAG=$(git rev-parse --short HEAD) >> $GITHUB_ENV # short git commit hash
echo DOCKER_REGISTRY=$REGISTRY_INTERNAL | tee -a $GITHUB_ENV
echo DOCKER_TAG=$(git rev-parse --short HEAD) | tee -a $GITHUB_ENV # short git commit hash
- if: github.ref_type == 'tag'
name: Determine docker registry and tag (when git tag)
run: |
echo DOCKER_REGISTRY=$(echo ${{ github.ref_name }} | sed 's/network-operator-//' | grep -q '-' && echo $REGISTRY_INTERNAL || echo $REGISTRY_PUBLIC) >> $GITHUB_ENV # use public registry only when release tag has no '-beta*' or '-rc*' suffix
echo DOCKER_TAG=${{ github.ref_name }} >> $GITHUB_ENV
echo DOCKER_REGISTRY=$(echo ${{ github.ref_name }} | sed 's/network-operator-//' | grep -q '-' && echo $REGISTRY_INTERNAL || echo $REGISTRY_PUBLIC) | tee -a $GITHUB_ENV # use public registry only when release tag has no '-beta*' or '-rc*' suffix
echo DOCKER_TAG=${{ github.ref_name }} | tee -a $GITHUB_ENV
- name: Store docker registry and tag for following jobs
id: store-docker-registry-and-tag
run: |
Expand Down Expand Up @@ -92,7 +92,12 @@ jobs:
path: network-opertor-fork
- name: Determine base branch
run: |
echo "BASE_BRANCH=${{ contains(env.DOCKER_TAG, 'beta') && 'master' || env.DOCKER_TAG }}" >> $GITHUB_ENV
if [[ "${{ github.ref_type }}" == "branch" || "${{ github.ref_name }}" == *"beta"* ]]; then # branch commits and beta tags update values on network-operator's *master* branch
echo BASE_BRANCH=master | tee -a $GITHUB_ENV
else # GA and `-rc.` tags update values on network-operator's respective *release* branches
release_branch=$(echo ${{ github.ref_name }} | sed -E 's/^network-operator-([0-9]+\.[0-9]+).+/v\1.x/') # example: transforms "network-operator-25.1.0-beta.2" to "v25.1.x"
echo BASE_BRANCH=$release_branch | tee -a $GITHUB_ENV
fi
- name: Create PR to update image tags in network-operator values
run: |
cd network-opertor-fork
Expand All @@ -106,13 +111,13 @@ jobs:
cp -r ../sriov-network-operator-fork/deployment/sriov-network-operator-chart/* deployment/network-operator/charts/sriov-network-operator/
# we *don't* copy `Chart.yaml` with the files below, because network-operator's `Chart.yaml` refers to the SR-IOV chart name with a hardcoded version.
git checkout -- deployment/network-operator/charts/sriov-network-operator/Chart.yaml

yq -i e '.SriovNetworkOperator.repository |= "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
yq -i e '.SriovNetworkOperator.version |= "${{ env.DOCKER_TAG }}"' hack/release.yaml
yq -i e '.SriovConfigDaemon.repository |= "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
yq -i e '.SriovConfigDaemon.version |= "${{ env.DOCKER_TAG }}"' hack/release.yaml
yq -i e '.SriovNetworkOperatorWebhook.repository |= "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
yq -i e '.SriovNetworkOperatorWebhook.version |= "${{ env.DOCKER_TAG }}"' hack/release.yaml
yq -i '.SriovNetworkOperator.repository = "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
yq -i '.SriovNetworkOperator.version = "${{ env.DOCKER_TAG }}"' hack/release.yaml
yq -i '.SriovConfigDaemon.repository = "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
yq -i '.SriovConfigDaemon.version = "${{ env.DOCKER_TAG }}"' hack/release.yaml
yq -i '.SriovNetworkOperatorWebhook.repository = "${{ env.DOCKER_REGISTRY }}"' hack/release.yaml
yq -i '.SriovNetworkOperatorWebhook.version = "${{ env.DOCKER_TAG }}"' hack/release.yaml
make release-build

if ! git diff --color --unified=0 --exit-code; then
Expand Down
Loading