Skip to content

Commit

Permalink
Merge pull request #173 from simondeziel/bash-array
Browse files Browse the repository at this point in the history
Fix parsing of `lxd-snapcraft -get-version`
  • Loading branch information
tomponline authored Oct 2, 2023
2 parents a1bf75e + 358a59a commit 6c13220
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
LAUNCHPAD_LXD_BOT_KEY: ${{ secrets.LAUNCHPAD_LXD_BOT_KEY }}
run: |
set -eux
mkdir -m 0700 -p ~/.ssh/
ssh-agent -a "${SSH_AUTH_SOCK}" > /dev/null
ssh-add - <<< "${{ secrets.LAUNCHPAD_LXD_BOT_KEY }}"
Expand All @@ -40,7 +41,7 @@ jobs:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
TARGET: ${{ github.ref_name }}
run: |
set -x
set -eux
git config --global transfer.fsckobjects true
git config --global user.name "Canonical LXD Bot"
git config --global user.email "[email protected]"
Expand All @@ -50,7 +51,8 @@ jobs:
localRev="$(git rev-parse HEAD)"
go install github.com/canonical/lxd-ci/lxd-snapcraft@latest
git clone -b "${TARGET}" git+ssh://[email protected]/~canonical-lxd/lxd ~/lxd-pkg-snap-lp
ver="$(lxd-snapcraft -get-version -file ~/lxd-pkg-snap-lp/snapcraft.yaml)"
# XXX: `ver` contains an array with the 2 versions
ver=($(lxd-snapcraft -get-version -file ~/lxd-pkg-snap-lp/snapcraft.yaml))
rsync -a --exclude .git --delete . ~/lxd-pkg-snap-lp/
cd ~/lxd-pkg-snap-lp
lxd-snapcraft -set-version "${ver[0]}" -set-source-commit "${ver[1]}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
env:
TARGET: ${{ github.event.pull_request.base.ref }}
run: |
set -x
set -eux
[ "${TARGET}" = "latest-edge" ] && exit 0
echo "Invalid branch target: ${TARGET}"
Expand Down

0 comments on commit 6c13220

Please sign in to comment.