Use GS_URL as it is now defined by Jenkins and detect Jenkins job name
[ovsnfv.git] / ci / buildovs.sh
index b731bd1..b967c16 100755 (executable)
@@ -13,8 +13,6 @@
 if [ -z ${WORKSPACE+1} ]; then
     # We are not being run by Jenkins.
     export WORKSPACE=$HOME/opnfv/ovsnfv
-else
-    export JENKINS=true
 fi
 
 
@@ -33,9 +31,10 @@ export BUILD_BASE=$WORKSPACE/build
 if [ ! -d $BUILD_BASE ]
 then
     mkdir -p $BUILD_BASE
-    if [ ! -f $BUILD_BASE/config ]; then
-        touch $BUILd_BASE/config
-    fi
+fi
+
+if [ ! -f $BUILD_BASE/config ]; then
+    touch $BUILD_BASE/config
 fi
 
 export PATH=$PATH:$WORKSPACE/ci:$BUILD_BASE
@@ -56,7 +55,6 @@ echo "--------------------------------------------------"
 echo "Build OVS RPM from upstream git $TAG"
 echo
 
-mkdir -p $RPMDIR/BUILD
 mkdir -p $RPMDIR/RPMS
 mkdir -p $RPMDIR/SOURCES
 mkdir -p $RPMDIR/SPECS
@@ -167,7 +165,7 @@ fi
 
 # copy artifacts.
 
-if [ ! -z ${JENKINS+1} ]; then
+if [ "$JOB_NAME" == "daily" ]; then
     upload_artifacts.sh
 fi