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

Ci action #4

Merged
merged 19 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f70ca3e
Merge pull request #567 from rook/master
travisn Feb 6, 2024
f31b514
Merge pull request #570 from red-hat-storage/sync_us--master
travisn Feb 9, 2024
7068a95
Merge pull request #571 from red-hat-storage/sync_us--master
travisn Feb 13, 2024
e828b65
Merge pull request #573 from red-hat-storage/sync_us--master
travisn Feb 14, 2024
9047f88
Merge pull request #575 from red-hat-storage/sync_us--master
travisn Feb 15, 2024
b170ccf
Merge pull request #576 from red-hat-storage/sync_us--master
travisn Feb 20, 2024
6c97e9e
Merge pull request #579 from red-hat-storage/sync_us--master
travisn Feb 22, 2024
7864271
Merge pull request #580 from red-hat-storage/sync_us--master
travisn Feb 28, 2024
e709505
Merge pull request #582 from red-hat-storage/sync_us--master
travisn Mar 5, 2024
a88fe5f
Merge pull request #586 from red-hat-storage/sync_us--master
travisn Mar 7, 2024
503f0b3
Merge pull request #587 from red-hat-storage/sync_us--master
travisn Mar 8, 2024
ed1ad43
Merge pull request #588 from red-hat-storage/sync_us--master
travisn Mar 11, 2024
f208577
build: add rbac for default sa
parth-gr Mar 12, 2024
ccb22b3
Merge pull request #590 from red-hat-storage/sync_us--master
travisn Mar 13, 2024
afff23d
Merge pull request #589 from parth-gr/sa-default
travisn Mar 13, 2024
d4e514a
Merge pull request #591 from red-hat-storage/sync_us--master
travisn Mar 15, 2024
6be2eb7
Merge pull request #592 from red-hat-storage/sync_us--master
travisn Mar 18, 2024
c4611b1
Merge pull request #593 from red-hat-storage/sync_us--master
subhamkrai Mar 19, 2024
fdf320d
ci: push downstream image to ocs/dev
parth-gr Mar 19, 2024
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
59 changes: 59 additions & 0 deletions .github/workflows/push-build-downstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Push Image Build Downstream
on:
push:
branches:
- master
- release-*
tags:
- v*
pull_request:
branches:
- master

defaults:
run:
# reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
shell: bash --noprofile --norc -eo pipefail -x {0}

permissions:
contents: read

jobs:
push-image-to-container-registry:
runs-on: ubuntu-latest
if: github.repository == 'parth-gr/rook'
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-go@v5
with:
go-version: "1.21"

# docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host.
- name: set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: log in to container registry
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_OCS_DEV_ROBOT_USER }}
password: ${{ secrets.QUAY_OCS_DEV_ROBOT_PASSWORD }}

# creating custom env var
- name: set env
run: |
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "GITHUB_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
- name: build and release
env:
BRANCH_NAME: ${{ env.BRANCH_NAME }}
GITHUB_SHA: $ {{ env.GITHUB_SHA }}
run: |
tests/scripts/build-release-downstream.sh
10 changes: 10 additions & 0 deletions deploy/charts/library/templates/_cluster-role.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,14 @@ rules:
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "update", "delete", "list"]
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rook-ceph-default
namespace: {{ .Release.Namespace }} # namespace:cluster
rules:
- apiGroups: [""]
resources: [""]
verbs: [""]
{{- end }}
14 changes: 14 additions & 0 deletions deploy/charts/library/templates/_cluster-rolebinding.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,18 @@ subjects:
- kind: ServiceAccount
name: rook-ceph-purge-osd
namespace: {{ .Release.Namespace }} # namespace:cluster
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rook-ceph-default
namespace: {{ .Release.Namespace }} # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rook-ceph-default
subjects:
- kind: ServiceAccount
name: rook-ceph-default
namespace: {{ .Release.Namespace }} # namespace:cluster
{{- end }}
24 changes: 24 additions & 0 deletions deploy/examples/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,16 @@ rules:
- update
- delete
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rook-ceph-default
namespace: rook-ceph # namespace:cluster
rules:
- apiGroups: [""]
resources: [""]
verbs: [""]
---
# Aspects of ceph-mgr that operate within the cluster's namespace
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -1052,6 +1062,20 @@ subjects:
name: rook-ceph-cmd-reporter
namespace: rook-ceph # namespace:cluster
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: rook-ceph-default
namespace: rook-ceph # namespace:cluster
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: rook-ceph-default
subjects:
- kind: ServiceAccount
name: rook-ceph-default
namespace: rook-ceph # namespace:cluster
---
# Allow the ceph mgr to access resources scoped to the CephCluster namespace necessary for mgr modules
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down
16 changes: 16 additions & 0 deletions tests/scripts/build-release-downstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex

# Load dot env file if available
if [ -f .env ]; then
# shellcheck disable=SC2046
export $(grep -v '^#' .env | xargs -d '\n')
fi

MAKE='make --debug=v --output-sync'
$MAKE build BUILD_REGISTRY=local
build_Image="local/ceph-amd64:latest"
git_hash=$(git rev-parse --short "${GITHUB_SHA}")
tag_Image=quay.io/ocs-dev/rook-ceph:v${BRANCH_NAME}-$git_hash
docker tag "$build_Image" "$tag_Image"
docker push "$tag_Image"
Loading