diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2018-04-27 08:11:05 +0300 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2018-04-27 08:11:05 +0300 |
commit | 5e8ab00127d8cc5df5125109e02e20c25f1418cd (patch) | |
tree | 53a7ccd201e19a7aa14e2ae959d821c465a8e207 /lava | |
parent | 38cb84b62b9c657be3dde7643312b18b9d617b75 (diff) |
lava-dispatcher: fix the version parsing
The build script is currently failing with:
invalid argument "linaro/lava-dispatcher-debian-stretch-amd64:Source:" for --tag=linaro/lava-dispatcher-debian-stretch-amd64:Source:: Error parsing reference: "linaro/lava-dispatcher-debian-stretch-amd64:Source:" is not a valid repository/tag
Change the parsing of the Packages file:
1. extract the lava-dispatcher package section and print 5 lines,
which should be more than enough to contain the version.
2. extract the version line from the previous strings extraction, ensuring
the version belongs to the lava-dispatcher package.
3. get only the value of the Version field.
4. filter out unwanted characters with sed.
Change-Id: Ic15a4f9ebc9d90ee3cb3daedfff7cb39ebecce68
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Diffstat (limited to 'lava')
-rwxr-xr-x | lava/dispatcher/production/stretch-amd64/build.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lava/dispatcher/production/stretch-amd64/build.sh b/lava/dispatcher/production/stretch-amd64/build.sh index cdf52809..d7f69b33 100755 --- a/lava/dispatcher/production/stretch-amd64/build.sh +++ b/lava/dispatcher/production/stretch-amd64/build.sh @@ -9,10 +9,10 @@ ARCHITECTURE=$(basename ${PWD} | cut -f2 -d '-') REPO=$(basename $(dirname ${PWD})) # Get version by parsing Packages file from respective repo. -VERSION=$(wget -qO - \ - http://images.validation.linaro.org/${REPO}-repo/dists/${DISTRIBUTION}-backports/main/binary-${ARCHITECTURE}/Packages | \ - sed -n '/Package: lava-dispatcher/{n;p}' | \ - sed 's/Version: //' | sed 's/[~|+].*//') +VERSION=$(wget -qO - http://images.validation.linaro.org/${REPO}-repo/dists/${DISTRIBUTION}-backports/main/binary-${ARCHITECTURE}/Packages \ + | grep -A5 '^Package: lava-dispatcher' | grep '^Version: ' \ + | awk '{ print $2 }' \ + | sed 's/[~|+].*//') image=linaro/lava-dispatcher-debian-${DISTRIBUTION}-${ARCHITECTURE}:${VERSION} docker build --no-cache --pull --tag=$image . |