From ff5dfe650fdeb8ef601ab58404f088f48cb7cca4 Mon Sep 17 00:00:00 2001 From: Jan Kubalek Date: Fri, 29 Apr 2022 18:39:37 +0200 Subject: [PATCH] Update --- .gitignore | 1 + build.sh | 43 +++++++++++++++---------- example/docker/fleet-os/lsb_release.txt | 2 ++ example/docker/fleet-os/uname.txt | 1 + tools/lsb_release/.gitignore | 1 + tools/uname/.gitignore | 1 + version.txt | 1 + 7 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 example/docker/fleet-os/lsb_release.txt create mode 100644 example/docker/fleet-os/uname.txt create mode 100644 tools/lsb_release/.gitignore create mode 100644 tools/uname/.gitignore create mode 100644 version.txt diff --git a/.gitignore b/.gitignore index 76d54dc..d386cc5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ go.sum install_sysroot localInstall +*.zip diff --git a/build.sh b/build.sh index 8219c9c..66c0108 100755 --- a/build.sh +++ b/build.sh @@ -2,6 +2,13 @@ set -e +INSTALL_DIR="./install_dir" + +if [[ -d ${INSTALL_DIR} ]]; then + echo "${INSTALL_DIR} already exist. Delete it pls" >&2 + exit 1 +fi + go get bringauto/bap-builder go get bringauto/tools/lsb_release go get bringauto/tools/uname @@ -21,21 +28,23 @@ pushd tools/lsb_release CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -tags netgo -ldflags '-w' popd -if [ -d install_dir ]; then - echo "install_dir already exist. Delete it pls" >&2 - exit 1 -fi -mkdir -p install_dir -mkdir -p install_dir/tools - -cp bap-builder/bap-builder install_dir/ -cp -r doc install_dir/ -cp README.md install_dir/ -cp LICENSE install_dir/ -cp tools/lsb_release/lsb_release install_dir/tools/ -cp tools/lsb_release/lsb_release.txt install_dir/tools/ -cp tools/lsb_release/lsb_release_README.md install_dir/tools/ -cp tools/uname/uname_README.md install_dir/tools/ -cp tools/uname/uname install_dir/tools/ -cp tools/uname/uname.txt install_dir/tools/ +mkdir -p "${INSTALL_DIR}" +mkdir -p "${INSTALL_DIR}/tools" + +cp bap-builder/bap-builder "${INSTALL_DIR}/" +cp -r doc "${INSTALL_DIR}/" +cp README.md "${INSTALL_DIR}/" +cp LICENSE "${INSTALL_DIR}/" +cp tools/lsb_release/lsb_release "${INSTALL_DIR}/tools/" +cp tools/lsb_release/lsb_release.txt "${INSTALL_DIR}/tools/" +cp tools/lsb_release/lsb_release_README.md "${INSTALL_DIR}/tools/" +cp tools/uname/uname_README.md "${INSTALL_DIR}/tools/" +cp tools/uname/uname "${INSTALL_DIR}/tools/" +cp tools/uname/uname.txt "${INSTALL_DIR}/tools/" + + +VERSION=$(sed -E -n 's/version=([^=]+)/\1/p' < version.txt) +MACHINE=$(uname -m | sed -E 's/_/-/') +zip -r "bringauto-packager_v${VERSION}_${MACHINE}-linux.zip" ${INSTALL_DIR}/ +rm -fr install_dir \ No newline at end of file diff --git a/example/docker/fleet-os/lsb_release.txt b/example/docker/fleet-os/lsb_release.txt new file mode 100644 index 0000000..96895d1 --- /dev/null +++ b/example/docker/fleet-os/lsb_release.txt @@ -0,0 +1,2 @@ +Distributor ID: fleet-os +Release: 1 diff --git a/example/docker/fleet-os/uname.txt b/example/docker/fleet-os/uname.txt new file mode 100644 index 0000000..6821ff8 --- /dev/null +++ b/example/docker/fleet-os/uname.txt @@ -0,0 +1 @@ +Linux k14 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) aarch64 GNU/Linux diff --git a/tools/lsb_release/.gitignore b/tools/lsb_release/.gitignore new file mode 100644 index 0000000..69e59d1 --- /dev/null +++ b/tools/lsb_release/.gitignore @@ -0,0 +1 @@ +lsb_release \ No newline at end of file diff --git a/tools/uname/.gitignore b/tools/uname/.gitignore new file mode 100644 index 0000000..7322df0 --- /dev/null +++ b/tools/uname/.gitignore @@ -0,0 +1 @@ +uname \ No newline at end of file diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..04d070a --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +version=0.2.0 \ No newline at end of file