seafiel build : shellcheck
This commit is contained in:
parent
36b8d09311
commit
d909497e63
|
@ -1,31 +1,32 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
||||||
source ${ABSDIR}/../functions.sh
|
source "${ABSDIR}"/../functions.sh
|
||||||
source ${ABSDIR}/vars.sh
|
source "${ABSDIR}"/vars.sh
|
||||||
|
|
||||||
ensure_pwd_is_scriptdir
|
ensure_pwd_is_scriptdir
|
||||||
ensure_not_root
|
ensure_not_root
|
||||||
|
|
||||||
buildfolder=/tmp/seafile-$$
|
buildfolder=/tmp/seafile-$$
|
||||||
|
|
||||||
if ! podman image exists ${seafile_image}:${seafile_release}; then
|
if ! podman image exists "${seafile_image}":"${seafile_release}"; then
|
||||||
mkdir ${buildfolder} &&
|
mkdir ${buildfolder} &&
|
||||||
git clone --depth=1 https://github.com/haiwen/seafile-docker.git ${buildfolder}/ && {
|
if git clone --depth=1 https://github.com/haiwen/seafile-docker.git ${buildfolder}/ ; then
|
||||||
sed_in_place "^FROM phusion" "FROM docker.io/phusion" ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place "^FROM phusion" "FROM docker.io/phusion" ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile &&
|
||||||
sed_in_place "SEAFILE_VERSION=" "SEAFILE_VERSION=${seafile_release}" ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place "SEAFILE_VERSION=" "SEAFILE_VERSION=${seafile_release}" ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile &&
|
||||||
sed_in_place "pip -i https://pypi.tuna.tsinghua.edu.cn/simple/" "pip" ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place "pip -i https://pypi.tuna.tsinghua.edu.cn/simple/" "pip" ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile &&
|
||||||
sed_in_place " -i https://pypi.tuna.tsinghua.edu.cn/simple/" " " ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place " -i https://pypi.tuna.tsinghua.edu.cn/simple/" " " ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile &&
|
||||||
sed_in_place 'wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com' 'wget -q https://download.seadrive.org' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place 'wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com' 'wget -q https://download.seadrive.org' ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile &&
|
||||||
sed_in_place 'tar -zxvf' 'tar -zxf' ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile &&
|
sed_in_place 'tar -zxvf' 'tar -zxf' ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile &&
|
||||||
podman image build -t ${seafile_image}:${seafile_release} \
|
podman image build -t "${seafile_image}":"${seafile_release}" \
|
||||||
-f ${buildfolder}/image/seafile_${seafile_release%.*}/Dockerfile \
|
-f ${buildfolder}/image/seafile_"${seafile_release%.*}"/Dockerfile \
|
||||||
${buildfolder} || retval=false
|
${buildfolder} || retval=false
|
||||||
podman image rm -f $(podman image list -a -q -- phusion/baseimage) }
|
podman image rm -f "$(podman image list -a -q -- phusion/baseimage)"
|
||||||
|
fi
|
||||||
rm -rf ${buildfolder}
|
rm -rf ${buildfolder}
|
||||||
eval $retval
|
eval "$retval"
|
||||||
else
|
else
|
||||||
echo "Image ${seafile_image}:${seafile_release} already built"
|
echo "Image ${seafile_image}:${seafile_release} already built"
|
||||||
fi &&
|
fi &&
|
||||||
|
|
||||||
oci_push_to_registry ${seafile_image}:${seafile_release}
|
oci_push_to_registry "${seafile_image}":"${seafile_release}"
|
||||||
|
|
Loading…
Reference in a new issue