ci-optimization
gapodo 2022-12-06 11:49:55 +01:00
parent 521dd9b38c
commit 464d02d447
2 changed files with 9 additions and 8 deletions

View File

@ -108,8 +108,8 @@ pipeline:
# defaulttagname: main
commands:
- mkdir docker/bin
- ./docker/map-binaries.sh ./dist/binaries forgejo gitea ${CI_COMMIT_TAG##v}
- ./docker/map-binaries.sh ./dist/contrib environment-to-ini false ${CI_COMMIT_TAG##v}
- bash -c './docker/map-binaries.sh ./dist/binaries forgejo gitea ${CI_COMMIT_TAG##v}'
- bash -c './docker/map-binaries.sh ./dist/contrib environment-to-ini false ${CI_COMMIT_TAG##v}'
when:
event: tag

View File

@ -1,7 +1,8 @@
#!/bin/bash
if [[ ${#@} -lt 2 ]]; then
if [ ${#@} -lt 3 ]; then
echo "not enough arguments provided" 1>&2
echo "syntax: ${0} <path directly containing the binary> <base name of the binary> <target name or false> [<version tag as in the file name>]"
exit 1
fi
@ -9,19 +10,19 @@ BINARYLOOKUPPATH="${1}"
FILEBASENAME="${2}"
RENAME="${3}"
if [[ ${#@} -gt 3 ]] && ! [[ "${4}" == "" ]]; then
if [ ${#@} -gt 3 ] && ! [ "${4}" == "" ]; then
FILEVERSION="${4}"
else
FILEVERSION="${DEFAULTTAGNAME:-main}"
fi
OUTFILENAME=""
if [[ "$RENAME" == "false" ]]; then
if [ "${RENAME}" == "false" ]; then
OUTFILENAME="${FILEBASENAME}"
else
# not using elif as busybox can't handle it...
if [["$RENAME" == "true" ]]; then
OUTFILENAME=gitea
if ["${RENAME}" == "true" ]; then
OUTFILENAME="gitea"
else
OUTFILENAME="${RENAME}"
fi
@ -32,7 +33,7 @@ FILE_WIHTOUT_PLATFORM="${FILEBASENAME}-${FILEVERSION}"
DOCKERDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
WS_BASE="${DOCKERDIR%/docker}"
if [[ ! -f "${DOCKERDIR}/archmap.txt" ]]; then
if [ ! -f "${DOCKERDIR}/archmap.txt" ]; then
echo "no archmap found" 1>&2
exit 1
fi