Skip to content

Commit

Permalink
Sample script to build packages for multiple distros
Browse files Browse the repository at this point in the history
  • Loading branch information
ayurchen committed May 2, 2024
1 parent cd7fcea commit 28f016a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
16 changes: 16 additions & 0 deletions packaging/build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh -eu

# Resulting packages will be placed in the current working directory.
# Environment variables:
# GIT_BRANCH - which branch to build

GIT_BRANCH=${GIT_BRANCH:='master'}

DIRNAME=$(dirname $0)

BASE='centos:7' ${DIRNAME}/rpm/build.sh
BASE='rockylinux:8' ${DIRNAME}/rpm/build.sh

BASE='debian:stable' ${DIRNAME}/deb/build.sh
BASE='ubuntu:22.04' ${DIRNAME}/deb/build.sh
BASE='ubuntu:24.04' ${DIRNAME}/deb/build.sh
3 changes: 2 additions & 1 deletion packaging/deb/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BASE=${BASE:='debian:stable'}

docker buildx build -t glb-builder-${BASE} --build-arg base=${BASE} \
https://github.com/codership/glb.git\#${GIT_BRANCH}:packaging/deb/
mkdir ${BASE} # output dir for packages
mkdir -p ${BASE} # output dir for packages
rm -rf ${BASE}/*
docker run -v ${PWD}:/output --env GIT_BRANCH=${GIT_BRANCH} \
--env BASE=${BASE} glb-builder-${BASE}
3 changes: 2 additions & 1 deletion packaging/rpm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ BASE=${BASE:='rockylinux:8'}

docker buildx build -t glb-builder-${BASE} --build-arg base=${BASE} \
https://github.com/codership/glb.git\#${GIT_BRANCH}:packaging/rpm/
mkdir ${BASE} # output dir for packages
mkdir -p ${BASE} # output dir for packages
rm -rf ${BASE}/*
docker run -v ${PWD}:/output --env GIT_BRANCH=${GIT_BRANCH} \
--env BASE=${BASE} glb-builder-${BASE}

0 comments on commit 28f016a

Please sign in to comment.