- source $WORKSPACE/version.properties
-
- # 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}"
+ # Unfortunatly, there is another apt running in the background at this point, so this apt will always fail.
+ # E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
+ # Since it probably is not needed, I am just removing it.
+ # sudo apt install -y dos2unix
+ # dos2unix "${WORKSPACE}/version.properties"
+ source "$WORKSPACE/version.properties"
+
+ if [ -n "$STAGING_BUILD" -a -n "$AUTOSTAGING" ]
+ then
+ # For a staging build, the $VERSION is fixed
+ # Note: yaml_builds version MUST match the postgres_db_schema version
+ VERSION=$(echo "$VERSION" | sed 's/-SNAPSHOT//')
+ TGZFILE="${NEXUS_URL}/content/repositories/autostaging-${AUTOSTAGING}/yaml_builds-${VERSION}.tgz"
+ DOCKER_REPO='nexus3.akraino.org:10004'
+ curl -O "${TGZFILE}"
+ else
+ # For a snapshot build - find the latest snapshot
+ # 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}"
+ fi