1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 06:40:31 +00:00
Files
os/scripts/package

66 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-08-31 11:14:03 -07:00
#!/bin/bash
set -e
source $(dirname $0)/version
cd $(dirname $0)/..
export TAG
2021-10-12 10:24:39 -07:00
make build
2021-08-31 11:14:03 -07:00
make iso
if [ -n "$DOCKER_PASSWORD" ]; then
docker login -u "$DOCKER_USERNAME" -p "${DOCKER_PASSWORD}"
PUSH=true
fi
if [ "$PUSH" = "true" ]; then
make push
2021-10-02 23:14:04 -07:00
make push-framework
2021-08-31 11:14:03 -07:00
fi
if [ "$PUSH" = "true" ] && [ -n "$AWS_SECRET_ACCESS_KEY" ]; then
2021-10-12 10:24:39 -07:00
IMAGE_TARGETS="${IMAGE_TARGETS} all-amis"
2021-08-31 11:14:03 -07:00
fi
export GIT_COMMIT=${COMMIT}
2021-10-12 10:24:39 -07:00
if [ -n "${IMAGE_TARGETS}" ]; then
make -j8 ${IMAGE_TARGETS}
fi
2021-08-31 11:14:03 -07:00
isoinfo -x /rootfs.squashfs -R -i build/output.iso > build/output.squashfs
isoinfo -x /boot/kernel.xz -R -i build/output.iso > build/output-kernel
isoinfo -x /boot/rootfs.xz -R -i build/output.iso > build/output-initrd
2021-10-13 16:00:29 -07:00
2021-10-20 12:19:44 -07:00
RELEASE_URL=${RELEASE_URL:-https://github.com/rancher/os2/releases/download}
2021-10-13 16:00:29 -07:00
INSTALL_CFG=${RELEASE_URL}/${VERSION}/example-cloud-init
PXE_ASSET_VERSION="\${version}-\${arch}"
if [ "${TAG}" = "dev" ]; then
RELEASE_URL=tftp://10.0.2.2
INSTALL_CFG=
VERSION=${TAG}
PXE_ASSET_VERSION=${TAG}
fi
2021-10-20 10:58:54 -07:00
./scripts/package-helm
2021-10-13 16:00:29 -07:00
cat > build/output.ipxe << EOF
#!ipxe
set arch ${ARCH}
set version ${VERSION}
set url ${RELEASE_URL}/\${version}
set kernel rancheros-${PXE_ASSET_VERSION}-kernel
set initrd rancheros-${PXE_ASSET_VERSION}-initrd
set rootfs rancheros-${PXE_ASSET_VERSION}.squashfs
kernel \${url}/\${kernel} initrd=\${initrd} ip=dhcp rd.cos.disable root=live:\${url}/\${rootfs} rancheros.install.automatic=true rancheros.install.config_url=\${config} console=tty1 console=ttyS0
initrd \${url}/\${initrd}
boot
EOF
2021-10-05 21:00:21 -07:00
mkdir -p dist/artifacts
for i in build/output*; do
2021-10-05 21:00:21 -07:00
mv -f $i dist/artifacts/rancheros-${TAG}${i##build/output}
echo Built: dist/artifacts/rancheros-${TAG}${i##build/output}
2021-08-31 11:14:03 -07:00
done