Fixed git auto package creation

canary
WolverinDEV 2020-04-03 01:14:37 +02:00
parent dcdebe36c4
commit 77aea2dac7
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
LOG_FILE="auto-build/logs/build.log" LOG_FILE="auto-build/logs/build.log"
PACKAGES_DIRECTORY="auto-build/packages/"
build_verbose=1 build_verbose=1
build_release=1 build_release=1
build_debug=0 build_debug=0
@ -173,8 +174,8 @@ function move_target_file() {
handle_failure -1 "Failed to find target file" handle_failure -1 "Failed to find target file"
fi fi
mkdir -p packages || { echo "failed to create target path"; exit 1; } mkdir -p "${PACKAGES_DIRECTORY}" || { echo "failed to create target path"; exit 1; }
target_file="../packages/$file_name" target_file="${PACKAGES_DIRECTORY}/$file_name"
if [[ -f "$target_file" ]]; then if [[ -f "$target_file" ]]; then
echo "Removing old packed file located at $target_file" echo "Removing old packed file located at $target_file"
rm "${target_file}" && handle_failure -1 "Failed to remove target file" rm "${target_file}" && handle_failure -1 "Failed to remove target file"

View File

@ -1,5 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
PACKAGES_DIRECTORY="auto-build/packages/"
LOG_FILE="auto-build/logs/build.log"
if [[ -z "${GIT_AUTHTOKEN}" ]]; then if [[ -z "${GIT_AUTHTOKEN}" ]]; then
echo "Missing environment variable GIT_AUTHTOKEN. Please set it before usign this script!" echo "Missing environment variable GIT_AUTHTOKEN. Please set it before usign this script!"
exit 1 exit 1
@ -40,6 +43,7 @@ if [[ ! -x ${GIT_RELEASE_EXECUTABLE} ]]; then
fi fi
fi fi
cd "$(dirname "$0")/.." || { echo "Failed to enter base dir"; exit 1; }
echo "Generating release" echo "Generating release"
${GIT_RELEASE_EXECUTABLE} release \ ${GIT_RELEASE_EXECUTABLE} release \
--repo "TeaWeb" \ --repo "TeaWeb" \
@ -54,7 +58,7 @@ ${GIT_RELEASE_EXECUTABLE} release \
} }
echo "Uploading release files" echo "Uploading release files"
folders=("/tmp/build/logs/" "/tmp/build/packages/") folders=("${LOG_FILE}" "${PACKAGES_DIRECTORY}")
uploaded_files=() uploaded_files=()
failed_files=() failed_files=()