Fix packagecloud match_release function and docs. 96/62796/8
authorHoua Yang <hyang@contractor.linuxfoundation.org>
Tue, 14 Jan 2020 17:57:08 +0000 (11:57 -0600)
committerHoua Yang <hyang@contractor.linuxfoundation.org>
Tue, 14 Jan 2020 23:16:05 +0000 (17:16 -0600)
Fix search for string that matches the output used by
packagecloud gem when pushing packages.
Correct docs to reflect not having the version in the package name.

Signed-off-by: Houa Yang <hyang@contractor.linuxfoundation.org>
Change-Id: I1a696c77be94f3057c30764ae6ba710beed8bb84

docs/jjb/lf-release-jobs.rst
releasenotes/notes/fix-packagecloud-match-release-76c652e0963b3c6c.yaml [new file with mode: 0644]
shell/release-job.sh

index 65cfb79..5966cd6 100644 (file)
@@ -196,10 +196,12 @@ must start with "packagecloud". For example releases/packagecloud-1.6-tree.yaml
 
     $ cat releases/packagecloud-1.6-tree.yaml
     ---
-    package_name: tree-1.6.0
+    package_name: tree
     packages:
-        - name: tree-1.6.0-10.el7.x86_64.rpm
-        - name: test.rpm
+        - name: tree_1.6.0_amd64.deb
+        - name: tree-dev_1.6.0_amd64.deb
+        - name: tree-devel-1.6.0-1.x86_64.rpm
+        - name: tree-1.6.0-1.x86_64.rpm
     ref: 5555cd2dd345fbeec0d3e2162e00835852342cda
     log_dir: example-project-packagecloud-merge/21
     version: 1.6.0
diff --git a/releasenotes/notes/fix-packagecloud-match-release-76c652e0963b3c6c.yaml b/releasenotes/notes/fix-packagecloud-match-release-76c652e0963b3c6c.yaml
new file mode 100644 (file)
index 0000000..bd8e784
--- /dev/null
@@ -0,0 +1,9 @@
+---
+fixes:
+  - |
+    Fix zgrep pattern for verify_packagecloud_match_release function. Function
+    was looking for "Successfully Uploaded" pattern, which is not the correct
+    response when using packagecloud gem to push packages to packagecloud.
+
+    Fix lf-release docs example to reflect changes to package_name. Package_name
+    should not include the version in the name.
index 220f016..5527688 100644 (file)
@@ -240,7 +240,7 @@ verify_packagecloud_match_release(){
     echo "INFO: Fetching console log from $logs_url"
     wget -q -P /tmp "${logs_url}/"console.log.gz
     echo "INFO: Searching for uploaded step, package name $PACKAGE_NAME and version $VERSION in job log"
-    if zgrep "Successfully uploaded" /tmp/console.log.gz | grep "$PACKAGE_NAME" | grep "$VERSION"; then
+    if  zgrep -E "Pushing.*$PACKAGE_NAME.*$VERSION.*success\!" /tmp/console.log.gz; then
         echo "INFO: found expected strings in job log"
     else
         echo "ERROR: failed to find expected strings in job log"