Many additions and changes

This commit is contained in:
Matheus Albino Brunhara
2024-07-25 14:27:47 -03:00
parent 38bd245285
commit 9e8948bd92
9 changed files with 216 additions and 43 deletions

View File

@@ -2,7 +2,7 @@
cdk_version=$1
cdk_paths_unfiltered=$(jf rt search --recursive=false "cpqd-snapshot/br/com/cpqd/**/$cdk_version/" | jq -r '.[].path')
cdk_paths_unfiltered=$(jf rt search --recursive=false --include-dirs=true "cpqd-snapshot/br/com/cpqd/**/$cdk_version/" | jq -r '.[].path')
cdk_paths=$(for p in ${cdk_paths_unfiltered[@]}; do dirname $p; done | uniq)
# needs pwd to be in PATH

View File

@@ -0,0 +1,27 @@
#!/bin/bash
show_help() {
echo "Usage: $0 [--files|-f files]"
echo "Options:"
echo " --help | -h (Optional) Display help information on how to use this script"
echo " --key | -k (Required) Specify the key's name"
echo " --new-value | -v (Required) Specify the new value for the key"
echo " --file-path | -f (Required) Specify the file's path"
}
key=''
new_value=''
file_path=''
while [ "$#" -gt 0 ]; do
case "$1" in
--help|-h) show_help; exit ;;
--key|-k) key="$2"; shift 2;;
--new-value|-v) new_value="$2"; shift 2;;
--file-path|-f) file_path="$2"; shift 2;;
*) shift ;;
esac
done
old_value=`cat $file_path | grep $key | awk -F= '{print $2}'`
sed -i "s/$old_value/$new_value/g" $file_path

View File

@@ -1,30 +1,12 @@
#!/bin/bash
# Array of prefixes to look for
prefixes=("ETICS" "CDK" "IM") # Add your prefixes here
jira_ticket=$(echo $(pwd) | grep -oE "(ETICS|CDK|IM)-[0-9]+" | tail -n1)
# Get the current working directory
current_dir=$(pwd)
# Find the first occurrence of a folder containing any of the specified prefixes
for prefix in "${prefixes[@]}"; do
found_string=$(find "$current_dir" -type d -path "*${prefix}*" | head -n 1)
if [ -n "$found_string" ]; then
break
fi
done
# Check if a matching folder is found
if [ -z "$found_string" ]; then
echo "Error: No folder containing the specified prefixes found in the current directory or its subdirectories."
else
# Extract the prefix and number from the folder name
regex="${prefixes[0]}-[0-9]+" # Assuming the first prefix for simplicity
etics_number=$(echo "$found_string" | grep -oE "$regex" | tail -n 1)
# Get the commit message parameter
commit_message=$1
# Run the git commit command
git commit -m "[$etics_number] $commit_message"
if [ -z $jira_ticket ]; then
echo "[ERROR] No Jira Ticket was found in current working directory"
exit 1
fi
commit_message=$1
git commit -m "[$jira_ticket] $commit_message"

View File

@@ -0,0 +1,47 @@
#!/bin/bash
show_help() {
echo "Usage: $0 [--files|-f files]"
echo "Options:"
echo " --help | -h (Optional) Display help information on how to use this script"
echo " --deployments-folder | -d (Required) Specify the deployments folder"
echo " --new-value | -v (Required) Specify the host IP to update the file"
}
deployments_folder=''
new_value=''
while [ "$#" -gt 0 ]; do
case "$1" in
--help|-h) show_help; exit ;;
--deployments-folder|-d) deployments_folder="$2"; shift 2;;
--new-value|-n) new_value="$2"; shift 2;;
*) shift ;;
esac
done
# scripts_folder, script_explode_java_files_filename, script_configure_rmi_server_host_in_deployments_filename
source dot-env.env
rmi_filename='rmiServer.properties'
ear_files=(cpqd-etics-webdeskmapreport-ear cpqd-etics-integration-ear)
lib_jar_file='cpqd-etics-oper-integration-rmiserver-jar'
cd $deployments_folder
for ear_file in ${ear_files[@]}; do
ear_file_find=`find * -maxdepth 0 -name "$ear_file-*.ear"`
if [ -f $ear_file_find ]; then
$scripts_folder/$script_explode_java_files_filename --files $ear_file_find
fi
lib_jar_file_find=`find * -maxdepth 0 -wholename "lib/$lib_jar_file-*.jar"`
if [ -f $lib_jar_file_find ]; then
$scripts_folder/$script_explode_java_files_filename --files $lib_jar_file_find
fi
$scripts_folder/$script_configure_rmi_server_host_in_deployments_filename --key oper.server.host --new-value $new_value --file-path $ear_file_find/lib/$lib_jar_file_find/$rmi_filename
done

View File

@@ -0,0 +1,3 @@
scripts_folder=/l/disk0/mbrunhara/repos/personal/personal-devboot/scripts/shell/job/gp
script_explode_java_files_filename='explode-java-files.sh'
script_configure_rmi_server_host_in_deployments_filename='configure-rmi-server-host-in-deployments.sh'

View File

@@ -0,0 +1,31 @@
#!/bin/bash
scripts_folder=$HOME/repos/personal/personal-devboot/scripts/shell/job/gp
wildfly_files_suffix_regex='-[0-9].*\.[jew]ar'
deployments_dir=$1
messages_properties_files_dir=$2
deployment_ears_to_explode=(cpqd-etics-admweb-ear cpqd-etics-integration-ear cpqd-etics-webdeskmapreport-ear)
cd $deployments_dir
for f in "${deployment_ears_to_explode[@]}"; do
filename=`find * -regex ".*$f$wildfly_files_suffix_regex"`
if [ -f "$filename" ]; then
$scripts_folder/explode-java-files.sh --files $filename
fi
done
deployment_lib_jar_files_to_explode=($(find * -regex ".*/lib/cpqd-application-admweb$wildfly_files_suffix_regex"))
for f in "${deployment_lib_jar_files_to_explode[@]}"; do
if [ -f "$f" ]; then
$scripts_folder/explode-java-files.sh --files $f
fi
done
for d in "${deployment_lib_jar_files_to_explode[@]}"; do
if [ -d "$d" ]; then
cp -t $deployments_dir/$d $messages_properties_files_dir/Messages_*.properties
fi
done

View File

@@ -96,7 +96,9 @@ build_mvn() {
echo "[INFO] Realizando build Maven:"
echo " ${build_cur#"$repo_dir"}"
mvn --quiet clean install --file ./pom.xml --settings ~/.m2/settings.xml
# mvn --quiet clean install -DskipTests --update-snapshots --file ./pom.xml --settings ~/.m2/settings.xml
# mvn --quiet clean install -DskipTests --file ./pom.xml --settings ~/.m2/settings.xml
mvn clean install -DskipTests --file ./pom.xml --settings ~/.m2/settings.xml
if [ $? -ne 0 ]; then
echo "[INFO] A build Maven resultou em erros. O script irá encerrar agora."
@@ -139,20 +141,55 @@ get_substring_after_string() {
sort_pom_paths_for_compilation_order() {
local unsorted_pom_paths=("$@")
local -A compilation_order_list=(
['main']=''
['commons']=''
['security']=''
['tools']=''
['geo']=''
['meta']=''
['framework']=''
['faces']=''
['application']=''
['plugins']=''
['cdk']=''
['auditing']=''
)
local -A compilation_order_list=()
if [[ $repo_dir == *"cdk"* ]]; then
compilation_order_list=(
['main']=''
['commons']=''
['security']=''
['tools']=''
['geo']=''
['meta']=''
['framework']=''
['faces']=''
['application']=''
['plugins']=''
['cdk']=''
['auditing']=''
)
elif [[ $repo_dir == *"gp"* ]]; then
compilation_order_list=(
['prepare']=''
['parents']=''
['toggle']=''
['landbase']=''
['eai']=''
['oss']=''
['paralelismo1']=''
['lmcm']=''
['eng']=''
['paralelismo2']=''
['dbmanager']=''
['oper']=''
['oper:legacy']=''
['osp']=''
['isp']=''
['recon']=''
['geoa']=''
['feasibility']=''
['pxp']=''
['services']=''
['udo']=''
['etics']=''
['customers']=''
['appserver']=''
['client']=''
)
else
printf "%s\n" "${unsorted_pom_paths[@]}"
fi
local sorted_pom_paths=()
for dir in "${!compilation_order_list[@]}"; do
@@ -275,7 +312,7 @@ pom_paths=()
# TODO, add support for html, js and Messages_*.properties files
# html_files=()
# js_files=()
# msg_files=()
# msg_files=() # probably is at cdk/application/implementacao/admweb/jar/src/main/resources
for i in ${target_paths_uniq[@]}; do
if [[ $i == *.java ]]; then
@@ -289,6 +326,7 @@ done
pom_paths_uniq=$(for i in "${pom_paths[@]}"; do echo $i; done | sort -u)
sorted_pom_paths_uniq=($(sort_pom_paths_for_compilation_order "${pom_paths_uniq[@]}"))
echo "sorted_pom_paths_uniq: ${sorted_pom_paths_uniq[@]}"
echo "[INFO] Pom order"

4
scripts/shell/job/jd-gui.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
cd ~/Documentos
java -jar ./jd-gui-1.6.6.jar

View File

@@ -0,0 +1,41 @@
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
#
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]
then
cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 1
None, Down, Button5, 1
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L, Up, Shift_L|Button4
Shift_L, Down, Shift_L|Button5
EOF
fi
##########################################################
CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)
NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)
if [ "$NEW_VALUE" == "" ];
then exit 0
fi
sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.
cat ~/.imwheelrc
imwheel -kill