add nc v26 / update build.sh

Cette révision appartient à :
2023-04-21 18:07:58 +02:00
Parent 0d2a94e711
révision ec0331193c
27 fichiers modifiés avec 654 ajouts et 18 suppressions
+34 -17
Voir le fichier
@@ -3,36 +3,53 @@ if [ -z "${BASH_SOURCE}" ] ; then
exit 1
fi
if [[ $# -gt 2 || ( $# -eq 2 && "$2" != "latest" ) ]] ; then
echo "
BUILD VERSION jimmyGALLAND with [version] version and pull to hub repository
USAGE: $0 [version] [latest]
version (optional) nc version eg: 26.0.1 (latest version nextcloud release if ommited)
latest (optional): type 'latest' if you want add latest tag to this build
"
fi
cd "${BASH_SOURCE%/*}/" || exit 1
NC_VERS=$(curl -s https://api.github.com/repos/nextcloud/server/releases/latest \
if [ -z $1 ]; then
NC_VERS=$(curl -s https://api.github.com/repos/nextcloud/server/releases/latest \
| grep "tag_name" \
| cut -d : -f 2 \
| tr -d "\",v " \
)
else
NC_VERS=$1
fi
if [ -z ${NC_VERS} ]; then
exit 1
fi
if [ ! -f "./version" ]; then
echo "-" > "./version"
fi
VERS=$(<"./version")
MAJOR_VERS=$( cut -d'.' -f 1 <<< "${NC_VERS}")
if [ ${NC_VERS} != ${VERS} ]; then
if [[ ${MAJOR_VERS} != 24 && ${MAJOR_VERS} != 25 ]]; then
exit
fi
cd $MAJOR_VERS
docker build --build-arg NC_VERS=${NC_VERS} --no-cache -t jimmygalland/nextcloud:latest -t jimmygalland/nextcloud:${NC_VERS} . && \
docker push jimmygalland/nextcloud:${NC_VERS} && \
docker push jimmygalland/nextcloud:latest && \
echo "${NC_VERS}" > "../version"
cd -
if [[ ${MAJOR_VERS} != 24 && ${MAJOR_VERS} != 25 && ${MAJOR_VERS} != 26 ]]; then
exit
fi
cd $MAJOR_VERS
docker build --build-arg NC_VERS=${NC_VERS} --no-cache -t jimmygalland/nextcloud:${NC_VERS} . && \
docker push jimmygalland/nextcloud:${NC_VERS} && \
docker tag jimmygalland/nextcloud:${NC_VERS} git.celjim.fr/jimmygalland/nextcloud:${NC_VERS} && \
docker push git.celjim.fr/jimmygalland/nextcloud:${NC_VERS}
if [[ $2 == 'latest' ]]; then
docker tag jimmygalland/nextcloud:${NC_VERS} jimmygalland/nextcloud:latest && \
docker tag jimmygalland/nextcloud:${NC_VERS} git.celjim.fr/jimmygalland/nextcloud:latest && \
docker push jimmygalland/nextcloud:latest && \
docker push git.celjim.fr/jimmygalland/nextcloud:latest
fi
#echo "${NC_VERS}" > "../version"
cd -