2022-02-12 18:30:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-02-20 23:33:43 +01:00
|
|
|
STEP="envinit prebuild build makedeb"
|
|
|
|
|
2022-02-12 18:30:28 +01:00
|
|
|
envinit() {
|
2022-02-20 23:33:43 +01:00
|
|
|
apt install -y --no-install-recommends build-essential git wget ca-certificates dpkg fakeroot
|
2022-02-12 18:30:28 +01:00
|
|
|
wget -qO - https://deb.nodesource.com/setup_16.x | bash
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y nodejs
|
2022-02-20 23:33:43 +01:00
|
|
|
wget -qO - https://go.dev/dl/go1.17.7.linux-amd64.tar.gz | tar -C /usr/local -xz
|
2022-02-12 18:30:28 +01:00
|
|
|
wget -qO - https://get.pnpm.io/install.sh | sh -
|
|
|
|
}
|
|
|
|
|
|
|
|
prebuild(){
|
2022-02-20 23:33:43 +01:00
|
|
|
GIT_VERSION=$1
|
|
|
|
git clone --depth 1 -b ${GIT_VERSION} https://github.com/authelia/authelia.git /tmp/authelia
|
2022-02-12 18:30:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd /tmp/authelia/
|
2022-02-20 23:33:43 +01:00
|
|
|
PATH=$PATH:/usr/local/go/bin:/root/.local/share/pnpm
|
|
|
|
./cmd/authelia-scripts/authelia-scripts build
|
2022-02-12 18:30:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
makedeb(){
|
2022-02-20 23:33:43 +01:00
|
|
|
GIT_VERSION=$1
|
|
|
|
DEB_VERSION=$2
|
|
|
|
PATH_DEB=/tmp/dist/rootfs
|
2022-02-12 18:30:28 +01:00
|
|
|
|
2022-02-20 23:33:43 +01:00
|
|
|
cp /tmp/authelia/dist/authelia ${PATH_DEB}/usr/bin/authelia
|
|
|
|
cp /tmp/authelia/config.template.yml ${PATH_DEB}/etc/authelia/configuration.yml
|
|
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" /tmp/dist/rootfs/DEBIAN/control
|
|
|
|
fakeroot dpkg-deb -Z gzip --build /tmp/dist/rootfs/ /tmp/dist/
|
2022-02-12 18:30:28 +01:00
|
|
|
}
|