Skip to content

Commit

Permalink
package: add tarball bundle to dist/artifacts (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweomer authored Aug 19, 2020
1 parent 80d0108 commit 22a6e8b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "packaging"]
path = packaging
url = https://github.com/rancher/rke2-packaging.git
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ download-charts: ## Download packaged helm charts
./scripts/download-charts

.PHONY: package
package: download-charts package-airgap ## Package the rke2 binary
package: | download-charts package-airgap package-bundle ## Package the rke2 binary
./scripts/package

.PHONY: package-airgap
package-airgap: build/images/airgap.tar ## Package docker images for airgap environment
./scripts/package-airgap

.PHONY: package-bundle
package-bundle: ## Package the tarball bundle
./scripts/package-bundle

./.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/v0.5.0/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
Expand Down
1 change: 1 addition & 0 deletions packaging
Submodule packaging added at 6d2390
4 changes: 1 addition & 3 deletions scripts/package-airgap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ cd $(dirname $0)/..

airgap_image_file='scripts/airgap/image-list.txt'
mkdir -p dist/artifacts
cp build/images/airgap.tar dist/artifacts/rke2-airgap-images-amd64.tar
cp "${airgap_image_file}" dist/artifacts/rke2-images.txt
gzip dist/artifacts/rke2-airgap-images-amd64.tar

gzip < build/images/airgap.tar > dist/artifacts/rke2-airgap-images-amd64.tar.gz
41 changes: 41 additions & 0 deletions scripts/package-bundle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
set -e -x

cd $(dirname $0)/..

. scripts/version.sh

if [ ! -d packaging/rpm ]; then
git submodule update --recursive --remote --init packaging
fi

find packaging
mkdir -p dist/bundle/{bin,etc/rancher/${PROG},usr/share/${PROG}/rpm}

### bin/rke2
cp -f bin/${PROG} dist/bundle/bin/

### etc/environment
cat << EOF > dist/bundle/etc/environment
KUBECONFIG=/etc/rancher/${PROG}/${PROG}.yaml
EOF

### etc/rancher/rke2/README.md
cat << EOF > dist/bundle/etc/rancher/${PROG}/README.md
# RKE2 FILES
- **\`${PROG}.yaml\`**
\`${PROG} server\` will place this KUBECONFIG on successful start-up.
- **\`registries.yaml\`**
The \`k3s\` subsystem embedded in \`${PROG}\` will look for this file on all agents (i.e. including servers) as configuration
for custom/private registries a la https://rancher.com/docs/k3s/latest/en/installation/private-registry/
EOF

### usr/share/rke2/rpm
rsync -a packaging/rpm/ dist/bundle/usr/share/${PROG}/rpm/

###

mkdir -p dist/artifacts
tar -cvzf dist/artifacts/${RELEASE}.tar.gz -C dist/bundle .

0 comments on commit 22a6e8b

Please sign in to comment.