Skip to content

Commit f71cdc3

Browse files
committed
Fix a global-variable problem
`TAG` and `IMAGE_TAG` are two different things.
1 parent fdd7890 commit f71cdc3

File tree

8 files changed

+10
-25
lines changed

8 files changed

+10
-25
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ jobs:
5050
- run : make ci
5151
name: ci
5252

53-
# - name: Build an image for integration testing
54-
# run: ./scripts/package-for-ci
55-
# env:
56-
# ARCH: "${{ matrix.arch }}"
57-
# SHA: "${{ github.sha }}"
58-
5953
- name : install K3d
6054
run : ./.github/workflows/scripts/install-k3d.sh
6155

@@ -77,9 +71,6 @@ jobs:
7771
RANCHER_IMAGE_TAG: "v2.9-head"
7872
VERSION: "2.9"
7973

80-
- name : debug show image_tag file
81-
run : cat dist/image_tag
82-
8374
- name : get vars
8475
run : cat dist/image_tag >> $GITHUB_ENV
8576

.github/workflows/scripts/integration-test-ci

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -eux
2+
set -eu
33

44
cd $(dirname $0)/../../..
55
DIST_DIR="$PWD"/dist
@@ -45,7 +45,7 @@ echo "Uploading new webhook image"
4545

4646
# Install the webhook chart we just built.
4747
upgrade_rancher_webhook() {
48-
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_VERSION}.tgz -n cattle-system \
48+
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_CHART_VERSION}.tgz -n cattle-system \
4949
--wait --timeout=120s --set image.repository="${IMAGE_REPO}" --set image.tag="${IMAGE_TAG}" --reuse-values --debug
5050
}
5151

@@ -68,7 +68,7 @@ set -e
6868
./bin/rancher-webhook-integration.test -test.v -test.run IntegrationTest
6969

7070
# Install the webhook chart with new ports.
71-
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_VERSION}.tgz -n cattle-system \
71+
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_CHART_VERSION}.tgz -n cattle-system \
7272
--wait --reuse-values --set port=443
7373

7474
# Test that the ports are set as expected and run a single integration test to verify the webhook is still accessible.

scripts/integration-test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ source ./dist/tags
3535

3636
# Install the webhook chart we just built.
3737
upgrade_rancher_webhook() {
38-
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_VERSION}.tgz -n cattle-system \
38+
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_CHART_VERSION}.tgz -n cattle-system \
3939
--wait --set image.repository="${IMAGE_REPO}" --set image.tag="${IMAGE_TAG}" --reuse-values --debug
4040
}
4141
try --delay 2 --max 4 --failmsg "Couldn't helm upgrade rancher-webhook" upgrade_rancher_webhook
4242

4343
./bin/rancher-webhook-integration.test -test.v -test.run IntegrationTest
4444

4545
# Install the webhook chart with new ports.
46-
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_VERSION}.tgz -n cattle-system \
46+
helm upgrade rancher-webhook ./dist/artifacts/rancher-webhook-${HELM_CHART_VERSION}.tgz -n cattle-system \
4747
--wait --reuse-values --set port=443
4848

4949
# Test that the ports are set as expected and run a single integration test to verify the webhook is still accessible.

scripts/package

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ set -eu
33

44
source $(dirname $0)/version
55

6-
set -x
7-
86
cd $(dirname $0)/..
97

108
echo Running package

scripts/package-for-ci

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ fi
88

99
source $(dirname $0)/version
1010

11-
set -x
12-
13-
echo "QQQ: scripts/package: SHA is ${SHA}"
1411
REPO=rancher
1512
IMAGE=${REPO}/webhook:${TAG}
1613
docker tag ${IMAGE} "${REPO}/webhook:${SHA}"

scripts/package-helm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ cp -rf charts build/
1212

1313
# must use sed -i'<backup_extension>'` for GNU and OSX compatibility
1414
sed -i'.bkp' \
15-
-e 's/^version:.*/version: '${HELM_VERSION}'/' \
16-
-e 's/appVersion:.*/appVersion: '${HELM_VERSION}'/' \
15+
-e 's/^version:.*/version: '${HELM_CHART_VERSION}'/' \
16+
-e 's/appVersion:.*/appVersion: '${HELM_CHART_VERSION}'/' \
1717
build/charts/rancher-webhook/Chart.yaml
1818

1919
sed -i'.bkb' \

scripts/test-helm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
set -e
33
cd $(dirname $0)/..
44

5-
./scripts/package-helm
65
echo Running helm lint
76
helm lint ./charts/rancher-webhook
87
# Check for unittest plugin

scripts/version

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ fi
2121
SUFFIX="-${ARCH}"
2222

2323
HELM_TAG="${HELM_TAG:-${TAG:-${VERSION}}}"
24-
HELM_VERSION="${HELM_VERSION:-${HELM_TAG/v/}}"
24+
HELM_CHART_VERSION="${HELM_CHART_VERSION:-${HELM_TAG/v/}}"
2525
TAG="${TAG:-${VERSION}${SUFFIX}}"
2626
REPO="${REPO:-rancher}"
2727

2828
if echo $TAG | grep -q dirty; then
2929
TAG=dev
3030
HELM_TAG=dev
31-
HELM_VERSION=0.0.0-dev
31+
HELM_CHART_VERSION=0.0.0-dev
3232
fi
3333

3434
DIST_DIR="${DIST_DIR:-$(dirname $0)/../dist/}"
3535
mkdir -p ${DIST_DIR}
36-
echo "export TAG=${TAG}; export HELM_TAG=${HELM_TAG}; export HELM_VERSION=${HELM_VERSION};" >${DIST_DIR}/tags
36+
echo "export TAG=${TAG}; export HELM_TAG=${HELM_TAG}; export HELM_CHART_VERSION=${HELM_CHART_VERSION};" >${DIST_DIR}/tags

0 commit comments

Comments
 (0)