[AETHER-679] Fix TOST build and update up4

- Moves up4 and fabric-tna to SSH
- Improves fetch/update targets (fix a bug where a stale
  branch was not properly checked out)
- Improves README

Change-Id: I3c39951d108c77f8cec37d688e9029ea81e617fa
diff --git a/Makefile b/Makefile
index b08f826..cac1126 100644
--- a/Makefile
+++ b/Makefile
@@ -69,28 +69,16 @@
 export FABRIC_TOFINO_REPO    := https://gerrit.opencord.org/fabric-tofino
 
 # Up4 related
-OMECPROJECT_API              ?=
 export UP4_ROOT              := $(shell pwd)/up4
-
-ifeq ($(OMECPROJECT_API),)
-  export UP4_REPO = https://github.com/omec-project/up4.git
-else
-  export UP4_REPO = https://omecproject:${OMECPROJECT_API}@github.com/omec-project/up4.git
-endif
+export UP4_REPO              := git@github.com:omec-project/up4.git
 
 # Kafka-onos related
 export KAFKA_ONOS_ROOT       := $(shell pwd)/kafka-onos
 export KAFKA_ONOS_REPO       := https://gerrit.opencord.org/kafka-onos
 
 # Fabric-TNA related
-ONOS_BUILDER_API             ?=
 export FABRIC_TNA_ROOT       := $(shell pwd)/fabric-tna
-
-ifeq ($(ONOS_BUILDER_API),)
-  export FABRIC_TNA_REPO = https://github.com/stratum/fabric-tna.git
-else
-  export FABRIC_TNA_REPO = https://onos-builder:${ONOS_BUILDER_API}@github.com/stratum/fabric-tna.git
-endif
+export FABRIC_TNA_REPO       := git@github.com:stratum/fabric-tna.git
 
 .PHONY: onos trellis-control trellis-t3 fabric-tofino up4 kafka-onos fabric-tna
 
@@ -141,7 +129,7 @@
 		exit 1; \
 	fi
 
-	# Try the git checkout first otherwise git review
+	# Try the git checkout first otherwise we download the review
 	if ! (cd ${TRELLIS_CONTROL_ROOT} && git checkout ${TRELLIS_CONTROL_VERSION}); then \
 	if ! (cd ${TRELLIS_CONTROL_ROOT} && git fetch ${TRELLIS_CONTROL_REPO} ${TRELLIS_CONTROL_VERSION} && git checkout FETCH_HEAD); then \
 		echo "Unable to fetch the changes from the trellis-control repository"; \
@@ -151,9 +139,15 @@
 trellis-control-build: mvn_settings.xml local-apps trellis-control  ## : Builds trellis-control using local app or mvn
 	@./app-build.sh $@
 
-trellis-control-fetch: ## : downloads commits, files, and refs from remote trellis-control
+trellis-control-update: ## : downloads commits, files, and refs from remote trellis-control
 	cd ${TRELLIS_CONTROL_ROOT} && git fetch
 
+	# Try to pull - but fails if we have not checked a branch
+	if ! (cd ${TRELLIS_CONTROL_ROOT} && git pull); then \
+		echo "Unable to pull from the trellis-control repository"; \
+		exit 1; \
+	fi
+
 trellis-t3: ## : Checkout trellis-t3 code
 	if [ ! -d "trellis-t3" ]; then \
 		git clone ${TRELLIS_T3_REPO}; \
@@ -174,9 +168,14 @@
 trellis-t3-build: mvn_settings.xml local-apps trellis-t3  ## : Builds trellis-t3 using local app or mvn
 	@./app-build.sh $@
 
-trellis-t3-fetch: ## : downloads commits, files, and refs from remote trellis-t3
+trellis-t3-update: ## : downloads commits, files, and refs from remote trellis-t3
 	cd ${TRELLIS_T3_ROOT} && git fetch
 
+	if ! (cd ${TRELLIS_T3_ROOT} && git pull); then \
+		echo "Unable to pull from the trellis-t3 repository"; \
+		exit 1; \
+	fi
+
 fabric-tofino: ## : Checkout fabric-tofino code
 	if [ ! -d "fabric-tofino" ]; then \
 		git clone ${FABRIC_TOFINO_REPO}; \
@@ -198,9 +197,14 @@
 fabric-tofino-build: mvn_settings.xml local-apps fabric-tofino  ## : Builds fabric-tofino using local app or mvn
 	@./app-build.sh $@
 
-fabric-tofino-fetch: ## : downloads commits, files, and refs from remote fabric-tofino
+fabric-tofino-update: ## : downloads commits, files, and refs from remote fabric-tofino
 	cd ${FABRIC_TOFINO_ROOT} && git fetch
 
+	if ! (cd ${FABRIC_TOFINO_ROOT} && git pull); then \
+		echo "Unable to pull from the fabric-tofino repository"; \
+		exit 1; \
+	fi
+
 up4: ## : Checkout up4 code
 	if [ ! -d "up4" ]; then \
 		git clone ${UP4_REPO}; \
@@ -222,9 +226,14 @@
 up4-build: mvn_settings.xml local-apps up4  ## : Builds up4 using local app
 	@./app-build.sh $@
 
-up4-fetch: ## : downloads commits, files, and refs from remote up4
+up4-update: ## : downloads commits, files, and refs from remote up4
 	cd ${UP4_ROOT} && git fetch
 
+	if ! (cd ${UP4_ROOT} && git pull); then \
+		echo "Unable to pull from the up4 repository"; \
+		exit 1; \
+	fi
+
 kafka-onos: ## : Checkout kafka-onos code
 	if [ ! -d "kafka-onos" ]; then \
 		git clone ${KAFKA_ONOS_REPO}; \
@@ -245,9 +254,14 @@
 kafka-onos-build: mvn_settings.xml local-apps kafka-onos  ## : Builds kafka-onos using local app or mvn
 	@./app-build.sh $@
 
-kafka-onos-fetch: ## : downloads commits, files, and refs from remote kafka-onos
+kafka-onos-update: ## : downloads commits, files, and refs from remote kafka-onos
 	cd ${KAFKA_ONOS_ROOT} && git fetch
 
+	if ! (cd ${KAFKA_ONOS_ROOT} && git pull); then \
+		echo "Unable to pull from the kafka-onos repository"; \
+		exit 1; \
+	fi
+
 fabric-tna: ## : Checkout fabric-tna code
 	if [ ! -d "fabric-tna" ]; then \
 		git clone ${FABRIC_TNA_REPO}; \
@@ -269,10 +283,15 @@
 fabric-tna-build: mvn_settings.xml local-apps fabric-tna  ## : Builds fabric-tna using local app
 	@./app-build.sh $@
 
-fabric-tna-fetch: ## : downloads commits, files, and refs from remote fabric-tna
+fabric-tna-update: ## : downloads commits, files, and refs from remote fabric-tna
 	cd ${FABRIC_TNA_ROOT} && git fetch
 
-apps-fetch: trellis-control-fetch trellis-t3-fetch fabric-tofino-fetch up4-fetch kafka-onos-fetch fabric-tna-fetch ## : downloads commits, files, and refs from remotes
+	if ! (cd ${FABRIC_TNA_ROOT} && git pull); then \
+		echo "Unable to pull from the fabric-tna repository"; \
+		exit 1; \
+	fi
+
+apps-update: trellis-control-update trellis-t3-update fabric-tofino-update up4-update kafka-onos-update fabric-tna-update ## : downloads commits, files, and refs from remotes
 
 apps-build: trellis-control-build trellis-t3-build fabric-tofino-build up4-build kafka-onos-build fabric-tna-build ## : Build the onos apps
 
@@ -295,6 +314,14 @@
 	fi \
 	fi
 
+onos-update: ## : downloads commits, files, and refs from remote onos
+	cd ${ONOS_ROOT} && git fetch
+
+	if ! (cd ${ONOS_ROOT} && git pull); then \
+		echo "Unable to pull from the onos repository"; \
+		exit 1; \
+	fi
+
 onos-build: onos ## : Builds the tost-onos docker image
 	# Set some env variables
 	cd ${ONOS_ROOT} && \
diff --git a/Makefile.vars b/Makefile.vars
index 1793c18..6a95d52 100644
--- a/Makefile.vars
+++ b/Makefile.vars
@@ -30,6 +30,6 @@
 export TRELLIS_CONTROL_VERSION ?= 3.0.0
 export TRELLIS_T3_VERSION      ?= 3.0.0
 export FABRIC_TOFINO_VERSION   ?= e1cf4551b4ab74bb82a7cecf19d197698ffbc1cb
-export UP4_VERSION             ?= 74b8c5fad3315dd7d48f299abbd044b010638c13
+export UP4_VERSION             ?= b65aa0ff16627ae638c344d2b014c8e54b49a502
 export KAFKA_ONOS_VERSION      ?= 2.4.0-SNAPSHOT
 export FABRIC_TNA_VERSION      ?= ec40b45e229ff94821ed1f176ea4cce333f74cce
diff --git a/README.md b/README.md
index 2d4304a..a6f8d36 100644
--- a/README.md
+++ b/README.md
@@ -58,18 +58,18 @@
 make tost-build
 ```
 
-## Fetch
+## Update
 
-Use `fetch` targets to downloads commits, files, and refs from remotes.
+Use `update` targets to downloads commits, files, and refs from remotes.
 
 ```sh
 # Update up4 app.
-make up4-fetch
+make up4-update
 ```
 
 ```sh
 # Update one by one all the apps.
-make apps-fetch
+make apps-update
 ```
 
 ## Clean