Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding saml2 support #62

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
1 change: 1 addition & 0 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ parts:
- python3-natsort
- sharutils
- lsof
- python3-onelogin-saml2

kubectl:
plugin: go
Expand Down
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 "$@"
Loading