Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
Pipeline #8634 passed
...@@ -12,11 +12,24 @@ build: ...@@ -12,11 +12,24 @@ build:
- cp config.properties.example config.properties - cp config.properties.example config.properties
- ./build.sh embedded - ./build.sh embedded
build_installer: build_installer_java8:
stage: build stage: build
tags: tags:
- docker - docker
image: maven:3-openjdk-8 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: script:
- cp config.properties.example config.properties - cp config.properties.example config.properties
- cp TASMAN-webapp/local-settings.xml ~/.m2/settings.xml - cp TASMAN-webapp/local-settings.xml ~/.m2/settings.xml
...@@ -46,3 +59,4 @@ upload_installer: ...@@ -46,3 +59,4 @@ upload_installer:
- master - master
script: 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.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 { ...@@ -132,12 +132,13 @@ function build_installer_package {
tar cfz tasman.tar.gz tasman-webapp.war tasman-embedded.jar tar cfz tasman.tar.gz tasman-webapp.war tasman-embedded.jar
rm tasman-webapp.war rm tasman-webapp.war
rm tasman-embedded.jar 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) config_dir=$(cat config.properties | grep config_directory | cut -d"=" -f2 | xargs)
sed -i "s/__CONFIG_DIR__/${config_dir//\//\\/}/g" install.sh sed -i "s/__CONFIG_DIR__/${config_dir//\//\\/}/g" $1
cat tasman.tar.gz >> install.sh cat tasman.tar.gz >> $1
rm tasman.tar.gz rm tasman.tar.gz
echo "TASMAN install.sh built" echo "TASMAN $1 built"
} }
function print_usage { function print_usage {
...@@ -154,7 +155,12 @@ function print_usage { ...@@ -154,7 +155,12 @@ function print_usage {
exit 0 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 print_usage
fi fi
...@@ -175,7 +181,12 @@ case "$1" in ...@@ -175,7 +181,12 @@ case "$1" in
build_web_embedded build_web_embedded
;; ;;
"installer") "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 print_usage
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment