From f98514af5476c3016b0fae22982b35f2ad5a4162 Mon Sep 17 00:00:00 2001 From: Roger Cundiff Date: Fri, 13 Mar 2020 14:12:51 -0500 Subject: [PATCH] Update scripts to use common project and build lists --- branches.sh | 4 +++- build.sh | 3 ++- checkout.sh | 7 ++++--- clone.sh | 4 +++- projectList.sh | 5 +++-- pull.sh | 3 ++- pushKAppNavToDockerHub.sh | 3 ++- pushimages.sh | 13 +++++++------ status.sh | 3 ++- 9 files changed, 28 insertions(+), 17 deletions(-) diff --git a/branches.sh b/branches.sh index d44eb33..b49e8df 100755 --- a/branches.sh +++ b/branches.sh @@ -17,7 +17,6 @@ #***************************************************************** # shows all branches arg=$1 -projs='README build samples apis controller operator ui' # make sure running in build directory if [ $(echo $PWD | awk '{ n=split($0,d,"/"); print d[n] }') != 'build' ]; then @@ -36,6 +35,9 @@ if [ x$arg == x'--?' ]; then exit 1 fi +. ./projectList.sh +projs=$ALL_PROJECTS + for p in $projs; do if [ -d ../$p ]; then cd ../$p diff --git a/build.sh b/build.sh index 6909962..fe29dfa 100755 --- a/build.sh +++ b/build.sh @@ -37,7 +37,8 @@ fi # determine if building all projects or just one if [ x$proj == x ]; then - projs='apis controller operator ui' + . ./projectList.sh + projs=$BUILD_PROJECTS else projs=$proj fi diff --git a/checkout.sh b/checkout.sh index 3525047..a4d7e1a 100755 --- a/checkout.sh +++ b/checkout.sh @@ -17,10 +17,8 @@ #***************************************************************** # does check out of specified branch across all kappnav projects branch=$1 - -projs='README build samples apis controller operator ui' - arg=$branch + # make sure running in build directory if [ $(echo $PWD | awk '{ n=split($0,d,"/"); print d[n] }') != 'build' ]; then echo 'Error: $kappnav/build dir must be current dir.' @@ -37,6 +35,9 @@ if [ x$arg == x'--?' ] || [ x$arg == 'x' ]; then exit 0 fi +. ./projectList.sh +projs=$ALL_PROJECTS + # build projects for p in $projs; do if [ -d ../$p ]; then diff --git a/clone.sh b/clone.sh index b718ec9..b0873bf 100755 --- a/clone.sh +++ b/clone.sh @@ -17,7 +17,6 @@ #***************************************************************** # clone all development directories except website arg=$1 -projs='README build samples apis controller operator ui' # make sure running in build directory if [ $(echo $PWD | awk '{ n=split($0,d,"/"); print d[n] }') != 'build' ]; then @@ -35,6 +34,9 @@ if [ x$arg == x'--?' ]; then exit 0 fi +. ./projectList.sh +projs=$ALL_PROJECTS + # clone all projects for p in $projs; do git clone https://github.com/kappnav/$p.git ../$p diff --git a/projectList.sh b/projectList.sh index 2b8c204..5a93a5e 100755 --- a/projectList.sh +++ b/projectList.sh @@ -17,5 +17,6 @@ #***************************************************************** # Defines the list of kAppNav projects for use by other scripts -BUILD_PROJECTS='apis controller inv operator ui' -ALL_PROJECTS=$BUILD_PROJECTS' README build samples kappnav-website' \ No newline at end of file +BUILD_PROJECTS='apis controller inventory operator ui' +ALL_PROJECTS=$BUILD_PROJECTS' README build samples kappnav-website' +IMAGES='apis controller inv operator ui' \ No newline at end of file diff --git a/pull.sh b/pull.sh index f86e86c..dde0014 100755 --- a/pull.sh +++ b/pull.sh @@ -36,7 +36,8 @@ if [ x$arg == x'--?' ]; then exit 1 fi -projs='README samples apis controller operator ui build' +. ./projectList.sh +projs=$ALL_PROJECTS for p in $projs; do if [ -d ../$p ]; then diff --git a/pushKAppNavToDockerHub.sh b/pushKAppNavToDockerHub.sh index 01f1abd..7dcfe81 100755 --- a/pushKAppNavToDockerHub.sh +++ b/pushKAppNavToDockerHub.sh @@ -36,7 +36,8 @@ if [ x$1 == x'--?' ] || [ x$1 == x'-?' ]; then fi if [ x$image == x ]; then - imagelist="inv apis controller operator ui" + . ./projectList.sh + imagelist=$IMAGES else imagelist=$image fi diff --git a/pushimages.sh b/pushimages.sh index 02066f3..6abcb40 100755 --- a/pushimages.sh +++ b/pushimages.sh @@ -46,14 +46,15 @@ fi docker login if [ x$image == x ]; then - imagelist="kappnav-inv kappnav-ui kappnav-apis kappnav-controller kappnav-operator" + . ./projectList.sh + imagelist=$IMAGES else - imagelist="kappnav-"$image + imagelist=$image fi tag=latest for image in $imagelist; do - echo docker tag $image:$tag $org/$image:$tag - docker tag $image:$tag $org/$image:$tag - echo docker push $org/$image:$tag - docker push $org/$image:$tag + echo docker tag kappnav-$image:$tag $org/kappnav-$image:$tag + docker tag kappnav-$image:$tag $org/kappnav-$image:$tag + echo docker push $org/kappnav-$image:$tag + docker push $org/kappnav-$image:$tag done diff --git a/status.sh b/status.sh index 9c68ed7..7844955 100755 --- a/status.sh +++ b/status.sh @@ -36,7 +36,8 @@ if [ x$arg == x'--?' ]; then exit 1 fi -projs='README build samples apis controller operator ui' +. ./projectList.sh +projs=$ALL_PROJECTS for p in $projs; do if [ -d ../$p ]; then