add option for agent build

pull/1/head
oscar 2022-05-19 12:36:38 +12:00
parent 7793f7e5f9
commit c039838a9e
1 changed files with 30 additions and 13 deletions

View File

@ -15,7 +15,7 @@ HIGHLIGHT_COLOR='\033[0;32m';
NO_COLOR='\033[0m'; NO_COLOR='\033[0m';
function choose_repo() { function choose_repo() {
read -p "Choose the working project EE/(CE)/(k8s):" REPO read -p "Choose the working project EE/(CE)/(k8s)/(agent):" REPO
if [ -z "$REPO" ]; then if [ -z "$REPO" ]; then
REPO="EE"; REPO="EE";
@ -29,6 +29,9 @@ function choose_repo() {
elif [[ "${REPO}" == "k8s" || "${REPO}" == "ks" ]]; then elif [[ "${REPO}" == "k8s" || "${REPO}" == "ks" ]]; then
cd ${WORKDIR}/k8s cd ${WORKDIR}/k8s
elif [[ "${REPO}" == "ag" || "${REPO}" == "agent" ]]; then
cd ${WORKDIR}/agent
fi fi
} }
@ -129,6 +132,16 @@ function build_portainer_backend() {
build_portainer_backend_without_prompt build_portainer_backend_without_prompt
} }
function build_portainer_agent() {
choose_repo
if ! check_branch; then
exit;
fi
./dev.sh compile
}
function build_portainer_all() { function build_portainer_all() {
printf "${HIGHLIGHT_COLOR}Build Portainer all${NO_COLOR}\n" printf "${HIGHLIGHT_COLOR}Build Portainer all${NO_COLOR}\n"
@ -179,36 +192,40 @@ function run_before_commit_k8s() {
function menu() { function menu() {
PS3='Please select the option: ' PS3='Please select the option: '
OPTIONS=( OPTIONS=(
'Build Portainer All' 'Build Portainer EE/CE All'
'Build Portainer Frontend' 'Build Portainer EE/CE Frontend'
'Build Portainer Backend' 'Build Portainer EE/CE Backend'
'Run Before Commit' 'Run Before Commit [Portainer EE/CE]'
'Run Before Commit [k8s]'
'Build Portainer Agent'
'Cleanup Temporary Volume' 'Cleanup Temporary Volume'
'Run Before COmmit (k8s)'
'Quit' 'Quit'
) )
select opt in "${OPTIONS[@]}" select opt in "${OPTIONS[@]}"
do do
case $opt in case $opt in
'Build Portainer All') 'Build Portainer EE/CE All')
build_portainer_all build_portainer_all
;; ;;
'Build Portainer Frontend') 'Build Portainer EE/CE Frontend')
build_portainer_frontend build_portainer_frontend
;; ;;
'Build Portainer Backend') 'Build Portainer EE/CE Backend')
build_portainer_backend build_portainer_backend
;; ;;
'Run Before Commit') 'Run Before Commit [Portainer EE/CE]')
run_before_commit run_before_commit
;; ;;
'Run Before Commit [k8s]')
run_before_commit_k8s
;;
'Build Portainer Agent')
build_portainer_agent
;;
'Cleanup Temporary Volume') 'Cleanup Temporary Volume')
cleanup_temporary_volume cleanup_temporary_volume
;; ;;
'Run Before COmmit (k8s)')
run_before_commit_k8s
;;
'Quit') 'Quit')
break break
;; ;;