Skip to content
Open
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
107 changes: 105 additions & 2 deletions .github/workflows/build_and_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:
uses: actions/checkout@v4

- name: Build images locally
run: make provisioner-localpv-image
run: |
make provisioner-localpv-image
make pvc-manager-image

- name: Setup Minikube-Kubernetes
uses: medyagh/setup-minikube@latest
Expand Down Expand Up @@ -205,9 +207,110 @@ jobs:
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}

pvc-manager:
runs-on: ubuntu-latest
needs: ['integration-test']
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go 1.19
uses: actions/setup-go@v5
with:
go-version: 1.19.13

- name: Set Image Org
# sets the default IMAGE_ORG to openebs
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV

- name: Set CI Tag
run: |
BRANCH=${{ github.ref_name }}
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
CI_TAG=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)
echo "TAG=${CI_TAG}" >> $GITHUB_ENV

- name: Set Build Date
id: date
run: |
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
# add each registry to which the image needs to be pushed here
images: |
${{ env.IMAGE_ORG }}/pvc-manager
quay.io/${{ env.IMAGE_ORG }}/pvc-manager
ghcr.io/${{ env.IMAGE_ORG }}/pvc-manager
tags: |
type=raw,value=latest,enable=false
type=raw,value=${{ env.TAG }}

- name: Print Tag info
run: |
echo "BRANCH: ${{ env.BRANCH }}"
echo "${{ steps.docker_meta.outputs.tags }}"

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v4

- name: Build pvc-manager binary
run: make pvc-manager

- name: Build and Push multi-arch Image
uses: docker/build-push-action@v4
with:
context: .
file: ./buildscripts/pvc-manager/Dockerfile
push: true
load: false
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le
tags: |
${{ steps.docker_meta.outputs.tags }}
build-args: |
DBUILD_DATE=${{ steps.date.outputs.DATE }}
DBUILD_REPO_URL=https://github.com/openebs/dynamic-localpv-provisioner
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}

release-chart:
runs-on: ubuntu-latest
needs: ['provisioner-localpv']
needs: ['provisioner-localpv', 'pvc-manager']
steps:
- uses: actions/checkout@v4
- name: Publish provisioner-localpv develop or prerelease helm chart
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ jobs:
uses: actions/checkout@v4

- name: Build images locally
run: make provisioner-localpv-image
run: |
make provisioner-localpv-image
make pvc-manager-image

- name: Setup Minikube-Kubernetes
uses: medyagh/setup-minikube@latest
Expand Down Expand Up @@ -153,3 +155,38 @@ jobs:
push: false
load: false
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le

pvc-manager:
runs-on: ubuntu-latest
needs: ['integration-test']
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v5
with:
go-version: 1.19.13

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Checkout
uses: actions/checkout@v4

- name: Build pvc-manager binary
run: make pvc-manager

- name: Build multi-arch Image
uses: docker/build-push-action@v4
with:
context: .
file: ./buildscripts/pvc-manager/Dockerfile
push: false
load: false
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,35 @@ jobs:
QY: quay.io/${{ env.IMAGE_ORG }}/provisioner-localpv:${{ env.VERSION }}
run: |
nix-shell --pure --run "crane copy --platform all ${{ env.SRC }} ${{ env.QY }}"

- name: Mirror pvc-manager multi-arch image with crane to Dockerhub
env:
SRC: ghcr.io/${{ env.IMAGE_ORG }}/dev/pvc-manager:${{ env.VERSION }}
DH: docker.io/${{ env.IMAGE_ORG }}/pvc-manager:${{ env.VERSION }}
run: |
nix-shell --pure --run "crane copy --platform all ${{ env.SRC }} ${{ env.DH }}" ./shell.nix

- name: Mirror pvc-manager multi-arch image with crane to Github
env:
SRC: ghcr.io/${{ env.IMAGE_ORG }}/dev/pvc-manager:${{ env.VERSION }}
GH: ghcr.io/${{ env.IMAGE_ORG }}/pvc-manager:${{ env.VERSION }}
run: |
nix-shell --pure --run "crane copy --platform all ${{ env.SRC }} ${{ env.GH }}" ./shell.nix

- name: Mirror pvc-manager multi-arch image with crane to Quay
env:
SRC: ghcr.io/${{ env.IMAGE_ORG }}/dev/pvc-manager:${{ env.VERSION }}
QY: quay.io/${{ env.IMAGE_ORG }}/pvc-manager:${{ env.VERSION }}
run: |
nix-shell --pure --run "crane copy --platform all ${{ env.SRC }} ${{ env.QY }}"

- name: Update the registry and the repository
run: |
nix-shell --pure --run "./scripts/update-reg-repo.sh --registry docker.io/ --repository ${{ env.IMAGE_ORG }}/provisioner-localpv" ./shell.nix

- name: Update the registry and the repository for pvc-manager
run: |
nix-shell --pure --run "./scripts/update-reg-repo.sh --registry docker.io/ --repository ${{ env.IMAGE_ORG }}/pvc-manager --component pvc-manager" ./shell.nix

- name: Publish chart via helm-gh-pages
uses: stefanprodan/helm-gh-pages@master
Expand Down
95 changes: 93 additions & 2 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ jobs:
uses: actions/checkout@v4

- name: Build images locally
run: make provisioner-localpv-image || exit 1;
run: |
make provisioner-localpv-image || exit 1;
make pvc-manager-image || exit 1;

- name: Setup Minikube-Kubernetes
uses: medyagh/setup-minikube@latest
Expand Down Expand Up @@ -194,9 +196,94 @@ jobs:
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}

pvc-manager:
needs: ['integration-test']
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: cachix/install-nix-action@v22
- name: Pre-populate nix-shell
run: |
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r)
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV
nix-shell --pure --run "echo" ./shell.nix

- name: Check if the chart is publishable
run: |
nix-shell --pure --run "./scripts/update-chart-version.sh --tag ${TAG} --publish-release" ./shell.nix

- name: Set Image Org
run: |
[ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}}
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV

- name: Set IMAGE_TAG and BRANCH
run: |
BRANCH=${{ github.ref_name }}
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
echo "IMAGE_TAG=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)" >> $GITHUB_ENV

- name: Set Build Date
id: date
run: |
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ env.IMAGE_ORG }}/dev/pvc-manager
tags: |
type=raw,value=latest,enable=false
type=raw,value=${{ env.IMAGE_TAG }}

- name: Print Tag info
run: |
echo "BRANCH: ${{ env.BRANCH }}"
echo "RELEASE_TAG: ${{ steps.docker_meta.outputs.tags }}"

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: v0.5.1

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build pvc-manager binary
run: make pvc-manager

- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: .
file: ./buildscripts/pvc-manager/Dockerfile
push: true
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le
tags: |
${{ steps.docker_meta.outputs.tags }}
build-args: |
DBUILD_DATE=${{ steps.date.outputs.DATE }}
DBUILD_REPO_URL=https://github.com/openebs/dynamic-localpv-provisioner
DBUILD_SITE_URL=https://openebs.io
BRANCH=${{ env.BRANCH }}

release-chart:
runs-on: ubuntu-latest
needs: ["provisioner-localpv"]
needs: ["provisioner-localpv", "pvc-manager"]
steps:
- uses: actions/checkout@v4

Expand All @@ -220,6 +307,10 @@ jobs:
run: |
nix-shell --pure --run "./scripts/update-reg-repo.sh --registry ghcr.io/ --repository ${{ env.IMAGE_ORG }}/dev/provisioner-localpv" ./shell.nix

- name: Update the registry and repository for pvc-manager in values.yaml
run: |
nix-shell --pure --run "./scripts/update-reg-repo.sh --registry ghcr.io/ --repository ${{ env.IMAGE_ORG }}/dev/pvc-manager --component pvc-manager" ./shell.nix

- name: Set Chart Version
run: |
TAG=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)
Expand Down
Loading