Compute correct URL when building containers. 66/166/1
authorEby, Robert (re2429) <re2429@att.com>
Tue, 31 Jul 2018 17:50:26 +0000 (13:50 -0400)
committerEby, Robert (re2429) <re2429@att.com>
Tue, 31 Jul 2018 17:50:26 +0000 (13:50 -0400)
Change-Id: Icfe6c204d9ab561f02fee99c87a90ff46fa10194
Signed-off-by: Eby, Robert (re2429) <re2429@att.com>
jjb/shell/build-docker.sh

index db0c177..53d4faf 100644 (file)
@@ -24,10 +24,14 @@ case "$PROJECT" in
 portal_user_interface)
     CON_NAME='akraino-portal'
     VERSION=`xmlstarlet sel -N "x=http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" AECPortalMgmt/pom.xml`
-    WARFILE="https://nexus.akraino.org/repository/maven-snapshots/org/akraino/portal/portal/${VERSION}/portal-${VERSION}.war"
-    curl -O ${WARFILE}
-    ln $(basename ${WARFILE}) AECPortalMgmt.war
 
+    XMLFILE="${NEXUS_URL}/service/local/repositories/snapshots/content/org/akraino/${PROJECT}/${VERSION}/maven-metadata.xml"
+    curl -O "${XMLFILE}"
+    V2=`grep value maven-metadata.xml | sed -e 's;</value>;;' -e 's;.*<value>;;' | uniq`
+    WARFILE="${NEXUS_URL}/service/local/repositories/snapshots/content/org/akraino/${PROJECT}/${VERSION}/${PROJECT}-${V2}.war"
+    curl -O "${WARFILE}"
+
+    ln $(basename ${WARFILE}) AECPortalMgmt.war
     (
         echo 'FROM tomcat:8.5.31'
         echo 'COPY AECPortalMgmt.war /usr/local/tomcat/webapps'
@@ -37,16 +41,25 @@ portal_user_interface)
 camunda_workflow)
     CON_NAME='akraino-camunda-workflow-engine'
     VERSION=`xmlstarlet sel -N "x=http://maven.apache.org/POM/4.0.0" -t -v "/x:project/x:version" akraino/pom.xml`
-    JARFILE="https://nexus.akraino.org/repository/maven-snapshots/org/akraino/camunda_workflow/${VERSION}/camunda_workflow-${VERSION}.jar"
+
+    XMLFILE="${NEXUS_URL}/service/local/repositories/snapshots/content/org/akraino/${PROJECT}/${VERSION}/maven-metadata.xml"
+    curl -O "${XMLFILE}"
+    V2=`grep value maven-metadata.xml | sed -e 's;</value>;;' -e 's;.*<value>;;' | uniq`
+    JARFILE="${NEXUS_URL}/service/local/repositories/snapshots/content/org/akraino/${PROJECT}/${VERSION}/${PROJECT}-${V2}.jar"
     curl -O ${JARFILE}
     ;;
 
 postgres_db_schema)
     CON_NAME='akraino_schema_db'
     source $WORKSPACE/version.properties
-    TARFILE="https://nexus.akraino.org/repository/maven-snapshots/org/akraino/yaml_builds/${VERSION}/yaml_builds-${VERSION}.tgz"
-    curl -O ${TARFILE}
-    (mkdir yaml_builds; cd yaml_builds; tar xfv ../$(basename ${TARFILE}))
+
+    # Note: for some reason the project name is in the path twice for tar files
+    XMLFILE="${NEXUS_URL}/service/local/repositories/snapshots/content/org/akraino/yaml_builds/yaml_builds/${VERSION}/maven-metadata.xml"
+    curl -O "${XMLFILE}"
+    V2=`grep value maven-metadata.xml | sed -e 's;</value>;;' -e 's;.*<value>;;' | uniq`
+    TGZFILE="${NEXUS_URL}/service/local/repositories/snapshots/content/org/akraino/yaml_builds/yaml_builds/${VERSION}/yaml_builds-${V2}.tgz"
+    curl -O "${TGZFILE}"
+    (mkdir yaml_builds; cd yaml_builds; tar xfv ../$(basename ${TGZFILE}))
     mv yaml_builds/templates akraino-j2templates
     ;;