forked from rancher/rancher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recent GHA related changes have broken make quick and the related dev-scripts/build-local.sh script, which were used to compile Rancher and build charts locally. This functionality required the dapper tool which is now being removed from all scripts. This change is a first step to restore functionality - at least to rebuild the Rancher Manager images (server and agent). Signed-off-by: Silvio Moioli <[email protected]> Co-authored-by: Pedro Tashima <[email protected]>
- Loading branch information
Showing
7 changed files
with
75 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
## This script builds the Rancher server image exclusively, sans Dapper | ||
|
||
set -eo pipefail | ||
set -x | ||
|
||
# variables | ||
COMMIT=$(git rev-parse --short HEAD) | ||
TAG="${TAG:-$(yq '.env.TAG | sub("-.*", "")' < .github/workflows/pull-request.yml)-${COMMIT}}" | ||
OS="${OS:-linux}" | ||
ARCH="${ARCH:-amd64}" | ||
CATTLE_K3S_VERSION=$(yq '.env.CATTLE_K3S_VERSION' < .github/workflows/pull-request.yml) | ||
CATTLE_KDM_BRANCH=$(yq '.env.CATTLE_KDM_BRANCH' < .github/workflows/pull-request.yml) | ||
RKE_VERSION=$(grep -m1 'github.com/rancher/rke' go.mod | awk '{print $2}') | ||
CATTLE_RANCHER_WEBHOOK_VERSION=$(yq '.webhookVersion' < build.yaml) | ||
CATTLE_CSP_ADAPTER_MIN_VERSION=$(yq '.cspAdapterMinVersion' < build.yaml) | ||
CATTLE_FLEET_VERSION=$(yq '.fleetVersion' < build.yaml) | ||
|
||
# download airgap images and export it to a tarball | ||
if [ ! -f ./k3s-images.txt ]; then | ||
curl -Lf https://github.com/rancher/k3s/releases/download/${CATTLE_K3S_VERSION}/k3s-images.txt -o ./k3s-images.txt | ||
fi | ||
if [ ! -f ./k3s-airgap-images.tar ]; then | ||
AIRGAP_IMAGES=$(grep -e 'docker.io/rancher/mirrored-pause' -e 'docker.io/rancher/mirrored-coredns-coredns' ./k3s-images.txt) | ||
xargs -n1 docker pull <<< "${AIRGAP_IMAGES}" | ||
xargs -n2 docker save -o ./k3s-airgap-images.tar <<< "${AIRGAP_IMAGES}" | ||
fi | ||
|
||
# download kontainer driver metadata | ||
if [ ! -f ./data.json ]; then | ||
curl -sLf https://releases.rancher.com/kontainer-driver-metadata/${CATTLE_KDM_BRANCH}/data.json > ./data.json | ||
fi | ||
|
||
# start the builds | ||
docker buildx build \ | ||
--build-arg VERSION="${TAG}" \ | ||
--build-arg ARCH=${ARCH} \ | ||
--build-arg COMMIT="${COMMIT}" \ | ||
--build-arg RKE_VERSION=${RKE_VERSION} \ | ||
--build-arg CATTLE_RANCHER_WEBHOOK_VERSION=${CATTLE_RANCHER_WEBHOOK_VERSION} \ | ||
--build-arg CATTLE_CSP_ADAPTER_MIN_VERSION=${CATTLE_CSP_ADAPTER_MIN_VERSION} \ | ||
--build-arg CATTLE_FLEET_VERSION=${CATTLE_FLEET_VERSION} \ | ||
--tag rancher/rancher:${TAG} \ | ||
--platform="${OS}/${ARCH}" \ | ||
--file ./package/Dockerfile . | ||
|
||
docker buildx build \ | ||
--build-arg VERSION="${TAG}" \ | ||
--build-arg ARCH=${ARCH} \ | ||
--build-arg RANCHER_TAG=${TAG} \ | ||
--build-arg RANCHER_IMAGE=rancher/rancher:${TAG}-${ARCH} \ | ||
--build-arg COMMIT="${COMMIT}" \ | ||
--build-arg RKE_VERSION=${RKE_VERSION} \ | ||
--build-arg CATTLE_RANCHER_WEBHOOK_VERSION=${CATTLE_RANCHER_WEBHOOK_VERSION} \ | ||
--tag rancher/rancher-agent:${TAG} \ | ||
--platform="${OS}/${ARCH}" \ | ||
--file ./package/Dockerfile.agent . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.