-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To unblock GH CI for building ceph rocks Signed-off-by: Utkarsh Bhatt <[email protected]> (cherry picked from commit 2565c85)
- Loading branch information
1 parent
770b5e2
commit c78491f
Showing
5 changed files
with
47 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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: | | ||
|
@@ -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 }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "$@" |