~landscape/landscape-bundles/trunk

« back to all changes in this revision

Viewing changes to charm-store

  • Committer: Simon Poirier
  • Date: 2021-07-26 23:43:06 UTC
  • mfrom: (55.1.1 trunk)
  • Revision ID: simon.poirier@canonical.com-20210726234306-y5d5pyvkdt2mfi8i
Merge bash_quotes [f=] [r=roadmr] [a=Simon Poirier]
Updated charm rev and fixed charm publish script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# Needs make clean, make render called first.
5
5
#
6
6
 
7
 
ACTION=$1
8
 
STORE_USER=${2:-landscape}
9
 
CHANNEL=${3}
 
7
ACTION="$1"
 
8
STORE_USER="${2:-landscape}"
 
9
CHANNEL="${3}"
10
10
INITIAL_CHANNEL="edge"
11
11
RELEASE_CHANNEL="stable"
12
12
 
31
31
for target in landscape-dense-maas landscape-dense landscape-scalable; do
32
32
 
33
33
    if [ "$ACTION" == "diff" ]; then
34
 
        if [ -z $CHANNEL ]; then
 
34
        if [ -z "$CHANNEL" ]; then
35
35
            CHANNEL=$RELEASE_CHANNEL
36
36
        fi
37
37
        echo "# [$target] Pulling fresh copy from $CHANNEL channel"
46
46
 
47
47
    if [ "$ACTION" == "push" ]; then
48
48
        echo "# [$target] Pushing to namespace ~${STORE_USER}, unpublished channel"
49
 
        url=$( (set -x; charm push build/${target} cs:~${STORE_USER}/bundle/${target}) | grep ^url | awk '{ print $2 }')
 
49
        url=$( (set -x; charm push "build/${target}" "cs:~${STORE_USER}/bundle/${target}") | grep ^url | awk '{ print $2 }')
50
50
 
51
 
        if [ -n $CHANNEL ]; then
 
51
        if [ -n "$CHANNEL" ]; then
52
52
            echo "# [$target] Publishing to ${CHANNEL} channel"
53
 
            (set -x; charm release --channel ${CHANNEL} $url)
 
53
            (set -x; charm release --channel "${CHANNEL}" "$url")
54
54
        fi
55
55
    fi
56
56
 
57
57
    if [ "$ACTION" == "publish-latest" ]; then
58
 
        latest=$(charm show --channel unpublished --all --format=json cs:~${STORE_USER}/bundle/${target} | jq -r '.id.Id')
 
58
        latest=$(charm show --channel unpublished --all --format=json "cs:~${STORE_USER}/bundle/${target}" | jq -r '.id.Id')
59
59
 
60
60
        if [ -z $CHANNEL ]; then
61
61
            CHANNEL=$RELEASE_CHANNEL
62
62
        fi
63
63
        echo "# [$target] Publishing latest unpublished revision to ${CHANNEL} channel"
64
 
        (set -x; charm release --channel ${CHANNEL} $latest)
 
64
        (set -x; charm release --channel "${CHANNEL}" "$latest")
65
65
    fi
66
66
 
67
67
done