Merge ~morphis/snappy-hwe-snaps/+git/build-scripts:b/multiple-name-fields into ~snappy-hwe-team/snappy-hwe-snaps/+git/build-scripts:master

Proposed by Simon Fels
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: fa8193bf2dd64e1474e924382a881921bb56abef
Merged at revision: caedce7ed09bd2862b341e89ca1990635e95dd1b
Proposed branch: ~morphis/snappy-hwe-snaps/+git/build-scripts:b/multiple-name-fields
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/build-scripts:master
Diff against target: 15 lines (+4/-1)
1 file modified
jobs/generic-build-snap-worker (+4/-1)
Reviewer Review Type Date Requested Status
Simon Fels continuous-integration Approve
System Enablement Bot continuous-integration Needs Fixing
Alfonso Sanchez-Beato Approve
Review via email: mp+319427@code.launchpad.net

Description of the change

Check only first five lines of snapcraft.yaml for the name: field

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/jobs/generic-build-snap-worker b/jobs/generic-build-snap-worker
2index 24b1ce9..83345f5 100755
3--- a/jobs/generic-build-snap-worker
4+++ b/jobs/generic-build-snap-worker
5@@ -48,7 +48,10 @@ if [ ! -e snapcraft.yaml ] ; then
6 fi
7
8 REPO_NAME=$(awk -v a="$TARGET_GIT_REPO" 'BEGIN{print substr(a, index(a, "+git/") + 5)}')
9-SNAP_NAME=$(grep "name:" snapcraft.yaml | awk '{print $2}')
10+# We rely on the snapcraft.yaml to have the snap name in the first five lines
11+# which is the case for all our snaps. This is a bit lazy but the best way to
12+# ensure we don't fetch any other name: fields which might be present in the file.
13+SNAP_NAME=$(head -n 5 snapcraft.yaml | grep "^name:" | awk '{print $2}')
14 SNAP_REV=$(git rev-parse --short HEAD)
15 CI_REPO=$REPO_NAME-$BUILD_ID-$SNAP_REV
16

Subscribers

People subscribed via source and target branches

to all changes: