Removed hard coded reference to treasuremap gerrit repo 40/71440/4
authorJames Gu <james.gu@att.com>
Sat, 21 Nov 2020 00:13:16 +0000 (16:13 -0800)
committerJames Gu <james.gu@att.com>
Mon, 23 Nov 2020 14:46:58 +0000 (06:46 -0800)
Removed hard coded reference to treasuremap gerrit repo  in deploy script
in favor of the global repo url defined in site definiton yaml.

Signed-off-by: James Gu <james.gu@att.com>
Change-Id: I67cb889174d04a6e18b454b552d31e59d2f2fd30

tools/deploy.sh

index b27607e..b5b97a2 100755 (executable)
@@ -76,8 +76,8 @@ read_yaml() {
 }
 
 git_checkout() {
-  git clone $1
-  cd ${1##*/}
+  git clone $1 $3
+  cd $3
 
   # check refs for patchsets
   if [[ $2 == *"refs"* ]]; then
@@ -96,18 +96,23 @@ clone_repos() {
     echo "Found existing airship folder. Skip repo clone."
   else
     # clone/checkout site manifests
-    git_checkout 'https://gerrit.opnfv.org/gerrit/airship' $GERRIT_REFSPEC
+    git_checkout 'https://gerrit.opnfv.org/gerrit/airship' $GERRIT_REFSPEC airship
   fi
 
   if [ -d "treasuremap" ]; then
     echo "Found existing treasuremap folder in the working directory. Skip repo clone."
   else
-    # clone treasuremap (only required for tools/airship)
+    # clone treasuremap
     # match treasuremap to global from site-definition
-    SITE_DEF_KEY="['data']['repositories']['global']['revision']"
-    TREASUREMAP_REF=$(read_yaml $SITE_DEF "$SITE_DEF_KEY")
+    GLOBAL_URL_KEY="['data']['repositories']['global']['url']"
+    TREASUREMAP_URL=$(read_yaml $SITE_DEF "$GLOBAL_URL_KEY")
+    echo "TREASUREMAP_URL $TREASUREMAP_URL"
+
+    GLOBAL_REF_KEY="['data']['repositories']['global']['revision']"
+    TREASUREMAP_REF=$(read_yaml $SITE_DEF "$GLOBAL_REF_KEY")
     echo "TREASUREMAP_REF $TREASUREMAP_REF"
-    git_checkout 'https://review.opendev.org/airship/treasuremap' $TREASUREMAP_REF
+
+    git_checkout $TREASUREMAP_URL $TREASUREMAP_REF treasuremap
   fi
 }
 
@@ -255,7 +260,9 @@ case "$2" in
   pre_genesis
   genesis_deploy
   site_action $2
-#  create_public_network
+  create_cirros_image
+  create_dpdk_flavor
+  create_public_network
   ;;
 'update_site')
   clone_repos
@@ -268,10 +275,6 @@ case "$2" in
   site_action $2
   ;;
 'init_cloud')
-#  wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
-#  openstack image create --disk-format qcow2 --container-format bare --public --file /target/cirros-0.5.1-x86_64-disk.img cirros
-#  rm -rf cirros-0.5.1-x86_64-disk.img cirros
-#  openstack flavor create --ram 1024 --disk 1 --vcpus 1 --public --hw:mem_page_size=large dpdk.tiny
   create_cirros_image
   create_dpdk_flavor
   create_public_network