45 lines
997 B
Bash
Executable File
45 lines
997 B
Bash
Executable File
#!/bin/bash
|
|
|
|
echo amount of arguments: $#
|
|
|
|
if [[ $# -ne 4 ]]; then
|
|
echo "Build script has to be called with exactly two arguments."
|
|
echo "The version number (Major.Minor.Patch) as its first argument."
|
|
echo "... and the OS (linux, windows or macos) as the second argument"
|
|
echo "TODO: DOCUMENT ARGUMENTS 3 & 4!!!"
|
|
echo "Aborting..."
|
|
exit 1
|
|
fi
|
|
|
|
VERSION=$1
|
|
regex='^([0-9]+\.){0,2}(\*|[0-9]+)$'
|
|
if [[ $VERSION =~ $regex ]]; then
|
|
echo "Version accepted: $VERSION"
|
|
else
|
|
echo "Version '$VERSION' is not acceptable. Aborting..."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! -e .env ]]; then
|
|
exit 1
|
|
fi
|
|
echo "Sourcing .env file..."
|
|
source .env
|
|
|
|
PACKAGENAME=$4
|
|
|
|
PLATFORM=$2
|
|
|
|
PACKAGE_DIR="_build/installer/packages"
|
|
OUTPUT_DIR="../_output/repository"
|
|
echo "executing repo-gen..."
|
|
repogen --update -p $PACKAGE_DIR $OUTPUT_DIR
|
|
|
|
if [[ $PUSH_REPO_URL != "" ]]; then
|
|
echo "pushing package data to repo..."
|
|
echo "PUSH_REPO_URL: $PUSH_REPO_URL"
|
|
scp -r $OUTPUT_DIR/* $PUSH_REPO_URL/$PLATFORM/packages/
|
|
fi
|
|
|
|
cd ${OLD_PWD}
|