Refactor scripts names and location
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cdk_version=$1
|
||||||
|
|
||||||
|
cdk_paths_unfiltered=$(jf rt search --recursive=false 'cpqd-snapshot/br/com/cpqd/**/13.30.132-SNAPSHOT/' | jq -r '.[].path')
|
||||||
|
cdk_paths=$(for p in ${cdk_paths_unfiltered[@]}; do dirname $p; done | uniq)
|
||||||
|
|
||||||
|
# needs pwd to be in PATH
|
||||||
|
for p in ${cdk_paths[@]}; do artifactory-rebuild-maven-metadata-xml.sh $p; done
|
||||||
5
scripts/shell/job/artifactory-rebuild-maven-metadata-xml.sh
Executable file
5
scripts/shell/job/artifactory-rebuild-maven-metadata-xml.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
metadata_path=$1
|
||||||
|
|
||||||
|
curl -v -X POST https://artifactory.cpqd.com.br/artifactory/api/maven/calculateMetadata/$metadata_path
|
||||||
30
scripts/shell/job/git-commit-with-jira.sh
Executable file
30
scripts/shell/job/git-commit-with-jira.sh
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Array of prefixes to look for
|
||||||
|
prefixes=("ETICS" "CDK" "IM") # Add your prefixes here
|
||||||
|
|
||||||
|
# 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"
|
||||||
|
fi
|
||||||
33
scripts/shell/job/jira-get-packages-with-closed-issues.sh
Executable file
33
scripts/shell/job/jira-get-packages-with-closed-issues.sh
Executable file
@@ -0,0 +1,33 @@
|
|||||||
|
# !/bin/bash
|
||||||
|
|
||||||
|
GP_REPOS=(oss-package-dev/gp oss-package-rel/gp cpqd-snapshot/br/com/cpqd/etics/cpqd-etics cpqd-release/br/com/cpqd/etics/cpqd-etics)
|
||||||
|
|
||||||
|
echo -n Password for user "$USER":
|
||||||
|
read -s password
|
||||||
|
|
||||||
|
for gp_repo in ${GP_REPOS[@]}; do
|
||||||
|
packages_path=`jf rt search --include-dirs=true --recursive=false "$gp_repo/*" | jq -r '.[].path' | grep 'ETICS-'`
|
||||||
|
|
||||||
|
for package in ${packages_path[@]}; do
|
||||||
|
package_jira=`grep -Eo 'ETICS-[[:digit:]]*' <<< "$package"`
|
||||||
|
|
||||||
|
jira_json=`curl --silent --user $USER:$password https://jira.cpqd.com.br/rest/api/2/issue/$package_jira`
|
||||||
|
|
||||||
|
jira_fields=`jq '.fields' <<< $jira_json`
|
||||||
|
jira_status=`jq '.status.name' <<< $jira_fields`
|
||||||
|
|
||||||
|
if [[ $jira_status == *"Closed"* ]]; then
|
||||||
|
jira_assignee=`jq '.assignee.name' <<< $jira_fields`
|
||||||
|
jira_reporter=`jq '.reporter.name' <<< $jira_fields`
|
||||||
|
|
||||||
|
echo -e "\n"
|
||||||
|
|
||||||
|
echo "Pacote: \"$package\""
|
||||||
|
echo "Jira fechado: \"$package_jira\" (https://jira.cpqd.com.br/browse/$package_jira)"
|
||||||
|
echo "Responsável: $jira_assignee"
|
||||||
|
echo "Reportador: $jira_reporter"
|
||||||
|
|
||||||
|
echo -e "\n\n\n"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
4
scripts/shell/job/k8s-ssh-control-plane.sh
Executable file
4
scripts/shell/job/k8s-ssh-control-plane.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
control_plane_ip=`kubectl get nodes --no-headers --selector 'node-role.kubernetes.io/control-plane' -o wide | awk '{print $6}'`
|
||||||
|
ssh k8s@$control_plane_ip
|
||||||
0
job/rcloneSyncObsidian.sh → scripts/shell/job/rclone-sync-obsidian.sh
Normal file → Executable file
0
job/rcloneSyncObsidian.sh → scripts/shell/job/rclone-sync-obsidian.sh
Normal file → Executable file
1
scripts/shell/job/svn-get-folder-size.sh
Executable file
1
scripts/shell/job/svn-get-folder-size.sh
Executable file
@@ -0,0 +1 @@
|
|||||||
|
svn list -vR $1 | awk '{tmp=match($3,/[0-9]/);if(tmp){sum+=$3; i++}} END {print "\ntotal size= " sum/1024000" MB" "\nnumber of files= " i/1000 " K"}'
|
||||||
4
scripts/shell/job/svn-log-stop-on-copy.sh
Executable file
4
scripts/shell/job/svn-log-stop-on-copy.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
# !/bin/bash
|
||||||
|
|
||||||
|
SVN_DIR=$1
|
||||||
|
svn log -v --stop-on-copy $SVN_DIR | less
|
||||||
Reference in New Issue
Block a user