Commit 3d3a99b0 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Updated build script to customize the installer name (needed by CI to support...

Updated build script to customize the installer name (needed by CI to support multiple installer versions)
parent f807c5e0
Pipeline #8634 passed with stages
in 2 minutes and 9 seconds
......@@ -12,11 +12,24 @@ build:
- cp config.properties.example config.properties
- ./build.sh embedded
build_installer:
build_installer_java8:
stage: build
tags:
- docker
image: maven:3-openjdk-8
script:
- cp config.properties.example config.properties
- cp TASMAN-webapp/local-settings.xml ~/.m2/settings.xml
- ./build.sh installer install-jdk8.sh
artifacts:
paths:
- install-jdk8.sh
build_installer_java11:
stage: build
tags:
- docker
image: maven:3-openjdk-11
script:
- cp config.properties.example config.properties
- cp TASMAN-webapp/local-settings.xml ~/.m2/settings.xml
......@@ -46,3 +59,4 @@ upload_installer:
- master
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file install.sh "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/latest/install.sh"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file install-jdk8.sh "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/TASMAN/latest/install-jdk8.sh"'
......@@ -132,12 +132,13 @@ function build_installer_package {
tar cfz tasman.tar.gz tasman-webapp.war tasman-embedded.jar
rm tasman-webapp.war
rm tasman-embedded.jar
cp install_template.sh install.sh
cp install_template.sh $1
config_dir=$(cat config.properties | grep config_directory | cut -d"=" -f2 | xargs)
sed -i "s/__CONFIG_DIR__/${config_dir//\//\\/}/g" install.sh
cat tasman.tar.gz >> install.sh
sed -i "s/__CONFIG_DIR__/${config_dir//\//\\/}/g" $1
cat tasman.tar.gz >> $1
rm tasman.tar.gz
echo "TASMAN install.sh built"
echo "TASMAN $1 built"
}
function print_usage {
......@@ -154,7 +155,12 @@ function print_usage {
exit 0
}
if [ "$#" -ne 1 ]; then
custom_installer=false
if [ "$#" -eq 2 ] && [ "$1" == "installer" ]; then
custom_installer=true
fi
if [ "$#" -ne 1 ] && [ "$custom_installer" = false ]; then
print_usage
fi
......@@ -175,7 +181,12 @@ case "$1" in
build_web_embedded
;;
"installer")
build_installer_package
if [ "$custom_installer" = true ]; then
installer_name="$2"
else
installer_name="install.sh"
fi
build_installer_package $installer_name
;;
*)
print_usage
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment