VNFRQTS - Update JJB to upload artifacts 47/78247/15
authorHagop Bozawglanian <hagop.bozawglanian@att.com>
Mon, 11 Feb 2019 19:47:37 +0000 (19:47 +0000)
committerHagop Bozawglanian <hagop.bozawglanian@att.com>
Tue, 12 Feb 2019 00:42:28 +0000 (00:42 +0000)
Update the VNFRQTS JJB to upload RAW artifacts
to nexus.

Change-Id: I34a3239bbe6d0f757c3f71591c8a2c358e67a0e5
Issue-ID: VNFRQTS-538
Signed-off-by: Hagop Bozawglanian <hagop.bozawglanian@att.com>
jjb/vnfrqts/build-and-upload.yaml
jjb/vnfrqts/post-upload-artifact.sh [new file with mode: 0644]
jjb/vnfrqts/pre-build-needs.sh [moved from jjb/vnfrqts/build-needs.sh with 91% similarity]
jjb/vnfrqts/vnfrqts-requirements.yaml

index b97fd46..bf804f3 100644 (file)
@@ -6,6 +6,10 @@
 
     name: '{project-name}-{stream}-build-and-upload'
 
+    pre_script: ''
+    post_script: ''
+    artifact_name: ''
+
     project-type: freestyle
     concurrent: true
     node: '{build-node}'
       - timed: 'H H * * *'
 
     builders:
-      - shell: '{script}'
+      - shell: '{obj:pre_script}'
+      - lf-infra-create-netrc:
+          server-id: ecomp-raw
+      - inject:
+          properties-content: |
+            ARTIFACT_NAME={artifact_name}
+      - shell: '{obj:post_script}'
+      - lf-provide-maven-settings-cleanup
 
     publishers:
       - infra-shiplogs:
-          maven-version: '{maven-version}'
+          maven-version: '{maven-version}'
\ No newline at end of file
diff --git a/jjb/vnfrqts/post-upload-artifact.sh b/jjb/vnfrqts/post-upload-artifact.sh
new file mode 100644 (file)
index 0000000..7719312
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+set -e -o pipefail
+echo "-n --upload-file $ARTIFACT_NAME https://nexus.onap.org/content/sites/raw/$JOB_BASE_NAME/$GERRIT_BRANCH/$ARTIFACT_NAME"
+curl -n --upload-file "$ARTIFACT_NAME" "https://nexus.onap.org/content/sites/raw/$JOB_BASE_NAME/$GERRIT_BRANCH/$ARTIFACT_NAME"
\ No newline at end of file
similarity index 91%
rename from jjb/vnfrqts/build-needs.sh
rename to jjb/vnfrqts/pre-build-needs.sh
index 85de18b..da1d5e2 100644 (file)
@@ -1,7 +1,8 @@
 #!/bin/bash
+
 virtualenv $WORKSPACE/venv-tox
 source $WORKSPACE/venv-tox/bin/activate
 pip install --upgrade pip
 pip install -r etc/requirements.txt
 ls
-tox -e docs
\ No newline at end of file
+tox -e needs
\ No newline at end of file
index 9d1a483..5442aae 100644 (file)
@@ -17,5 +17,6 @@
           branch: 'master'
     jobs:
       - '{project-name}-{stream}-build-and-upload':
-          script:
-              !include-raw-escape: 'build-needs.sh'
+          pre_script: !include-raw-escape: pre-build-needs.sh
+          artifact_name: docs/data/needs.json
+          post_script: !include-raw-escape: post-upload-artifact.sh