Add --no-substitution parameter to personal-devboot/scripts/shell/job/gp/team-pipeline-local.sh script

This commit is contained in:
Matheus Albino Brunhara
2024-04-16 09:50:26 -03:00
parent 805970b7fa
commit 9eb11bc6f8

View File

@@ -1,5 +1,7 @@
#!/bin/bash
# TODO, fazer o script explodir artefatos usando artifactId recuperado pela busca recursiva do arquivo pom.xml
printf "\n"
show_help() {
@@ -12,8 +14,9 @@ show_help() {
echo " --deployments-path | -d (Required) Specify the Wildfly ports-XX/deployments path"
echo " --file-paths | -f (Optional) Specify file paths to consider in the update, separation by comma (,)"
echo " Specifying this will make the \"--commit-hashes\" parameter optional"
echo " --no-build | -b (Optional) If selected, the script will NOT build the maven components in order to generate the target/ folder"
echo " --no-build | --nb (Optional) If selected, the script will NOT build the maven components in order to generate the target/ folder"
echo " --use-git-status | -g (Optional) Will add the files with differences from the \"git status\" command"
echo " --no-substitution | --ns (Optional) If selected, the script will NOT build the maven components in order to generate the target/ folder"
echo " --start-server | -s (Optional) Will run the server after the script finishes copying the files"
}
@@ -24,6 +27,7 @@ deployments_path=''
file_paths_arg=''
build_maven=true
use_git_status=false
should_substitute=true
should_start_server=false
while [ "$#" -gt 0 ]; do
@@ -34,8 +38,9 @@ while [ "$#" -gt 0 ]; do
--commits-between|-cb) commits_between_arg="$2"; shift 2;;
--deployments-path|-d) deployments_path="$2"; shift 2;;
--file-paths|-f) file_paths_arg="$2"; shift 2;;
--no-build|-b) build_maven=false; shift 2;;
--no-build|--nb) build_maven=false; shift 2;;
--use-git-status|-g) use_git_status=true; shift 2;;
--no-substitution|--ns) should_substitute=false; shift 2;;
--start-server|-s) should_start_server=true; shift 2;;
*) shift ;;
esac
@@ -93,6 +98,7 @@ arr_uniq() {
}
build_mvn() {
printf "\n"
echo "[INFO] Realizando build Maven no diretório \"`pwd`\"..."
mvn --quiet clean install --file ./pom.xml --settings ~/.m2/settings.xml
@@ -246,11 +252,14 @@ fi
if [ ! -z "$file_paths_arg" ]; then
file_paths=`convert_csv_to_array "$file_paths_arg"`
if [ ! -f $f ]; then
for f in ${file_paths[@]}; do
if [ ! -f "$repo_dir/$f" ]; then
echo "[WARN] O arquivo informado \"$f\" não existe no repositório."
continue
fi
target_paths+=("$f")
target_paths+=($f)
done
fi
if $use_git_status; then
@@ -311,6 +320,7 @@ for p in ${sorted_pom_paths_uniq[@]}; do
non_root_deployments_files_to_explode=`find * -maxdepth 0 -type f -regextype sed -regex ".*[jew]ar" ! -name '*-client.jar' ! -name '*-sources.jar'`
done
if $should_substitute; then
cd $deployments_path
root_deployments_files_to_explode=`find * -maxdepth 0 -type f -regextype sed -regex ".*[jew]ar"`
@@ -331,8 +341,11 @@ fi
# extra paths because "cpqd-application-renderer-api-*" was inside another non-sense path
extra_paths_to_explode=(`find * -maxdepth 1 -type f -wholename "**/cpqd-application-admweb-web*.war"`)
extra_paths_to_explode+=(`find * -type f -wholename "**/cpqd-application-admweb-web*.war/**/cpqd-*-api-*.jar"`)
if [ ! -z "$extra_paths_to_explode" ]; then
$scripts_folder/explode-java-files.sh --files `join_by , ${extra_paths_to_explode}`
fi
extra_paths_to_explode=(`find * -type f -wholename "**/cpqd-application-admweb-web*.war/**/cpqd-*-api-*.jar"`)
if [ ! -z "$extra_paths_to_explode" ]; then
$scripts_folder/explode-java-files.sh --files `join_by , ${extra_paths_to_explode}`
fi
@@ -473,6 +486,7 @@ if [ ${#unsuccessful_copies[@]} -ne 0 ]; then
echo " Arquivo mal-sucedido: $i"
done
fi
fi
if $should_start_server; then
$cur/debugports-01.sh