Skip to content

Commit

Permalink
Pinned LXD to 5.21/edge
Browse files Browse the repository at this point in the history
To unblock GH CI for building ceph rocks

Signed-off-by: Utkarsh Bhatt <[email protected]>
(cherry picked from commit 2565c85)
  • Loading branch information
UtkarshBhatthere authored and xtrusia committed Sep 3, 2024
1 parent 770b5e2 commit c78491f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 47 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@ defaults:
jobs:
build-rock:
runs-on: ubuntu-latest
outputs:
rock: ${{ steps.rockcraft.outputs.rock }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: 5.21/edge
- name: Prepare Rock
uses: canonical/craft-actions/rockcraft-pack@main
id: rockcraft
run: ./scripts/test-helper.sh build_rock
- uses: actions/upload-artifact@v3
with:
name: rock
path: ${{ steps.rockcraft.outputs.rock }}
path: ceph.rock

CephAdmScriptTest:
runs-on: ubuntu-latest
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/publish_edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@ jobs:
runs-on: ubuntu-22.04
permissions:
packages: write
outputs:
rock: ${{ steps.rockcraft.outputs.rock }}
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Setup LXD
uses: canonical/[email protected]
with:
channel: 5.20/stable
channel: 5.21/edge

- name: Install deps and clean legacy rules.
run: |
Expand Down Expand Up @@ -59,19 +57,10 @@ jobs:
type=raw,value=dev-edge,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
- name: Prepare Rock
uses: canonical/craft-actions/rockcraft-pack@main
id: rockcraft
run: ./scripts/test-helper.sh build_rock

- name: Load to Docker daemon
run: |
# iterate through the tags
for tag in $TAGS; do
echo "$tag"
skopeo --insecure-policy copy oci-archive:${{ steps.rockcraft.outputs.rock }} docker-daemon:$tag
done
docker image ls -a
sleep 10
docker push ghcr.io/canonical/ceph --all-tags
run: ./scripts/test-helper.sh load_to_docker $TAGS
env:
TAGS: ${{ steps.meta.outputs.tags }}

17 changes: 3 additions & 14 deletions .github/workflows/publish_hotfix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
runs-on: ubuntu-22.04
permissions:
packages: write
outputs:
rock: ${{ steps.rockcraft.outputs.rock }}
steps:
- run: |
echo Publishing container image for PR# $NUMBER
Expand All @@ -34,7 +32,7 @@ jobs:
- name: Setup LXD
uses: canonical/[email protected]
with:
channel: 5.20/stable
channel: 5.21/edge

- name: Install deps and clean legacy rules.
run: |
Expand Down Expand Up @@ -70,19 +68,10 @@ jobs:
type=raw,value=hotfix-${{ github.event.pull_request.number }}-${{ steps.versioning.outputs.ceph_version }}
- name: Prepare Rock
uses: canonical/craft-actions/rockcraft-pack@main
id: rockcraft
run: ./scripts/test-helper.sh build_rock

- name: Load to Docker daemon
run: |
# iterate through the tags
for tag in $TAGS; do
echo "$tag"
skopeo --insecure-policy copy oci-archive:${{ steps.rockcraft.outputs.rock }} docker-daemon:$tag
done
docker image ls -a
sleep 10
docker push ghcr.io/canonical/ceph --all-tags
run: ./scripts/test-helper.sh load_to_docker $TAGS
env:
TAGS: ${{ steps.meta.outputs.tags }}

17 changes: 3 additions & 14 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@ jobs:
runs-on: ubuntu-22.04
permissions:
packages: write
outputs:
rock: ${{ steps.rockcraft.outputs.rock }}
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Setup LXD
uses: canonical/[email protected]
with:
channel: 5.20/stable
channel: 5.21/edge

- name: Install deps and clean legacy rules.
run: |
Expand Down Expand Up @@ -60,18 +58,9 @@ jobs:
type=raw,value=reef,enable=${{ startsWith(steps.versioning.outputs.ceph_version, '18') }}
- name: Prepare Rock
uses: canonical/craft-actions/rockcraft-pack@main
id: rockcraft
run: ./scripts/test-helper.sh build_rock

- name: Load to Docker daemon
run: |
# iterate through the tags
for tag in $TAGS; do
echo "$tag"
skopeo --insecure-policy copy oci-archive:${{ steps.rockcraft.outputs.rock }} docker-daemon:$tag
done
docker image ls -a
sleep 10
docker push ghcr.io/canonical/ceph --all-tags
run: ./scripts/test-helper.sh load_to_docker $TAGS
env:
TAGS: ${{ steps.meta.outputs.tags }}
32 changes: 32 additions & 0 deletions scripts/test-helper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -xeEo pipefail


function build_rock() {
sudo snap install rockcraft --classic
rockcraft clean
rockcraft pack -v
mv ceph*.rock ceph.rock
}

function load_to_docker() {
local tags=${1:?missing}
# iterate through the tags
for tag in $tags; do
echo "$tag"
skopeo --insecure-policy copy oci-archive:ceph.rock docker-daemon:$tag
done
# Check all images
docker image ls -a
sleep 10
docker push ghcr.io/canonical/ceph --all-tags
}



FUNCTION="$1"
shift # remove function arg now that we've recorded it
# call the function with the remainder of the user-provided args
# -e, -E, and -o=pipefail will ensure this script returns a failure if a part of the function fails
$FUNCTION "$@"

0 comments on commit c78491f

Please sign in to comment.