create repo
This commit is contained in:
82
amisearch
Executable file
82
amisearch
Executable file
@@ -0,0 +1,82 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ESC=`printf "\033"`;
|
||||||
|
REGION=$1;
|
||||||
|
|
||||||
|
input_key() {
|
||||||
|
read -s -n3 INPUT;
|
||||||
|
echo $INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
check_selected() {
|
||||||
|
if [ $1 = $2 ];
|
||||||
|
then echo " => "
|
||||||
|
else echo " "
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
select_menu() {
|
||||||
|
SELECTED=1;
|
||||||
|
INPUT="";
|
||||||
|
MIN_MENU=1;
|
||||||
|
MAX_MENU=$#;
|
||||||
|
while true;
|
||||||
|
do
|
||||||
|
for (( i=1; i<=$#; i++))
|
||||||
|
do
|
||||||
|
printf "$ESC[2K$(check_selected $i $SELECTED) $i. ${!i}\n";
|
||||||
|
done
|
||||||
|
printf "\n$ESC[2KMake AMI!\n\n";
|
||||||
|
INPUT=$(input_key);
|
||||||
|
if [[ $INPUT = "" ]];
|
||||||
|
then break;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $INPUT = $ESC[A ]];
|
||||||
|
then SELECTED=$(expr $SELECTED - 1);
|
||||||
|
elif [[ $INPUT = $ESC[B ]];
|
||||||
|
then SELECTED=$(expr $SELECTED + 1);
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $SELECTED -lt $MIN_MENU ]];
|
||||||
|
then SELECTED=${MIN_MENU};
|
||||||
|
elif [[ $SELECTED -gt $MAX_MENU ]];
|
||||||
|
then SELECTED=${MAX_MENU};
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf "$ESC[$(expr $# + 3)A";
|
||||||
|
done
|
||||||
|
return `expr ${SELECTED} - 1`;
|
||||||
|
}
|
||||||
|
|
||||||
|
select_test() {
|
||||||
|
if [ -z $REGION ]
|
||||||
|
then
|
||||||
|
echo "./amisearch region"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
arr_params=("amazon" "centos" "ubuntu" "redhat");
|
||||||
|
echo "\nWelmcome! AWS AMI Selector\n";
|
||||||
|
select_menu "${arr_params[@]}";
|
||||||
|
local SELECTED=$?;
|
||||||
|
SELECTED_MODE=${arr_params[${SELECTED}]};
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
select_test;
|
||||||
|
if [ $SELECTED -eq 1 ]
|
||||||
|
then
|
||||||
|
aws ec2 describe-images --owners 137112412989 --query 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' --filters "Name=name,Values=amzn2*" --region $REGION --output table
|
||||||
|
elif [ $SELECTED -eq 2 ]
|
||||||
|
then
|
||||||
|
aws ec2 describe-images --owners 125523088429 --query 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' --filters "Name=name,Values=Cent*" --region $REGION --output table
|
||||||
|
elif [ $SELECTED -eq 3 ]
|
||||||
|
then
|
||||||
|
aws ec2 describe-images --owners 099720109477 --query 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' --filters "Name=name,Values=ubuntu-minimal/images/hvm-ssd*" --region $REGION --output table
|
||||||
|
elif [ $SELECTED -eq 4 ]
|
||||||
|
then
|
||||||
|
aws ec2 describe-images --owners 309956199498 --query 'sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]' --filters "Name=name,Values=RHEL-8*" --region $REGION --output table
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
8
clone.sh
Executable file
8
clone.sh
Executable file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export USER="ByeonJungHun"
|
||||||
|
export GITKEY="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"
|
||||||
|
export REPO=$1
|
||||||
|
|
||||||
|
echo ${REPO/\/\//\/\/$USER:$GITKEY@}
|
||||||
|
git clone ${REPO/\/\//\/\/$USER:$GITKEY@}
|
||||||
20
imageslist
Normal file
20
imageslist
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
manual
|
||||||
|
metric-agent
|
||||||
|
metric-collector
|
||||||
|
jspdlitecollector
|
||||||
|
topology-agent
|
||||||
|
cmoa-collector
|
||||||
|
trace-agent
|
||||||
|
datagate
|
||||||
|
metric_analyzer_worker
|
||||||
|
metric_analyzer
|
||||||
|
notification-server
|
||||||
|
eureka-server
|
||||||
|
api-server
|
||||||
|
zuul-server
|
||||||
|
kube-info-connector
|
||||||
|
kafka-stream-txntrend
|
||||||
|
ui-server
|
||||||
|
kube-info-batch
|
||||||
|
kube-info-flat
|
||||||
|
auth-server
|
||||||
64
rel.sh
Executable file
64
rel.sh
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 이미지 리스트
|
||||||
|
images_list="./imageslist"
|
||||||
|
|
||||||
|
# repo
|
||||||
|
nexus="10.10.31.243:5000"
|
||||||
|
dkrepo="exemdev2"
|
||||||
|
|
||||||
|
# release version
|
||||||
|
repo=$1
|
||||||
|
version=rel$2
|
||||||
|
|
||||||
|
nexus() {
|
||||||
|
|
||||||
|
# images pull & tag & push nexus
|
||||||
|
while IFS= read -r image_name; do
|
||||||
|
|
||||||
|
echo -e "\n\n\033[93m${image_name}:${version} pulling!\n\n\033[0m"
|
||||||
|
docker pull ${nexus}/cmoa/${image_name}:${version}
|
||||||
|
|
||||||
|
echo -e "\n\n\033[93${image_name}:${version} taging!\n\n\033[0m"
|
||||||
|
docker tag ${nexus}/cmoa/${image_name}:${version} ${nexus}/cmoa3/${image_name}:${version}
|
||||||
|
|
||||||
|
echo -e "\n\n\033[93${image_name}:${version} push!\n\n\033[0m"
|
||||||
|
#docker push ${nexus}/cmoa3/${image_name}:${version}
|
||||||
|
|
||||||
|
done <"${images_list}"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
dockerhub() {
|
||||||
|
|
||||||
|
# images pull & tag & push nexus
|
||||||
|
while IFS= read -r image_name; do
|
||||||
|
|
||||||
|
echo -e "\n\033[93m${image_name}:${version} pulling!\n\033[0m"
|
||||||
|
docker pull ${nexus}/cmoa/${image_name}:${version}
|
||||||
|
|
||||||
|
echo -e "\n\033[93${image_name}:${version} taging!\n\033[0m"
|
||||||
|
docker tag ${nexus}/cmoa/${image_name}:${version} ${dkrepo}/${image_name}:${version}
|
||||||
|
|
||||||
|
echo -e "\n\033[93${image_name}:${version} push!\n\033[0m"
|
||||||
|
ddocker push ${dkrepo}/${image_name}:${version}
|
||||||
|
|
||||||
|
done <"${images_list}"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main(){
|
||||||
|
if [ "${repo}" = "nexus" ]
|
||||||
|
then
|
||||||
|
nexus
|
||||||
|
elif [ "${repo}" = "docker" ]
|
||||||
|
then
|
||||||
|
dockerhub
|
||||||
|
elif [ "${repo}" != "nexus" ] && [ "${repo}" != "docker" ]
|
||||||
|
then
|
||||||
|
echo -e "\n\033[93m./rel.sh nexus version\033[0m"
|
||||||
|
echo -e "\033[93m./rel.sh docker version\033[0m"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
Reference in New Issue
Block a user