feat(fetcherfs): make rpm and deb package

This commit is contained in:
Zexi Li
2021-04-12 17:48:31 +08:00
parent 7a03b9378e
commit 811730e7cf
4 changed files with 53 additions and 0 deletions
+18
View File
@@ -89,6 +89,9 @@ vet:
cmd/esxi-agent: prepare_dir
CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
cmd/fetcherfs: prepare_dir
CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
cmd/%: prepare_dir
$(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
@@ -101,6 +104,21 @@ deb/%: cmd/%
pkg/%: prepare_dir
$(GO_INSTALL) $(REPO_PREFIX)/$@
rpm/fetcherfs: cmd/fetcherfs
docker run --rm \
--name docker-centos-build-fetcherfs \
-v $(CURDIR):/data \
registry.cn-beijing.aliyuncs.com/yunionio/centos-build:1.1-4 \
/bin/bash -c "VERSION=3.6 /data/build/build.sh fetcherfs /opt/yunion/fetchclient/bin"
deb/fetcherfs: rpm/fetcherfs
#VERSION=3.6 $(DEB_BUILD_SCRIPT) fetcherfs /opt/yunion/fetchclient/bin
docker run --rm \
--name docker-debian-build-fetcherfs \
-v $(CURDIR):/data \
registry.cn-beijing.aliyuncs.com/yunionio/debian10-base:1.0 \
/data/build/convert_rpm2deb.sh
build:
$(MAKE) $(cmdTargets)
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
set -e
if [ -z "$ROOT_DIR" ]; then
ROOT_DIR=$(dirname $(dirname $(readlink -f "$BASH_SOURCE")))
fi
RPMS_DIR=$ROOT_DIR/_output/rpms
DEBS_DIR=$ROOT_DIR/_output/debs
case $(uname -m) in
x86_64)
CURRENT_ARCH=amd64
;;
aarch64)
CURRENT_ARCH=arm64
;;
esac
mkdir -p $DEBS_DIR && cd $DEBS_DIR
find $RPMS_DIR -type f -name *.rpm -exec alien --target=$CURRENT_ARCH {} \;
+9
View File
@@ -0,0 +1,9 @@
# registry.cn-beijing.aliyuncs.com/yunionio/debian10-base:1.0
FROM debian:10
RUN apt update && apt install -y alien
RUN apt-get clean autoclean && \
apt-get autoremove --yes && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
+3
View File
@@ -0,0 +1,3 @@
debian10-base:
docker buildx build --platform linux/arm64,linux/amd64 --push \
-t registry.cn-beijing.aliyuncs.com/yunionio/debian10-base:1.0 -f ./Dockerfile.debian-base .