[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} && \