Skip to content

Commit

Permalink
Merge pull request #59 from sabre1041/fix-libs-csv
Browse files Browse the repository at this point in the history
Fix libraries and pipeline
  • Loading branch information
raffaelespazzoli authored Dec 27, 2020
2 parents cd78d21 + 006606a commit 5454dc6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ jobs:
steps:
- name: set repo name
shell: bash
env:
QUAY_REGISTRY: ${{ secrets.QUAY_REGISTRY }}
run: |
DEFAULT_QUAY_REGISTRY=${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY)
echo "REPOSITORY_NAME=$(basename $GITHUB_REPOSITORY)" >> $GITHUB_ENV
echo "QUAY_REGISTRY=${QUAY_REGISTRY:-DEFAULT_QUAY_REGISTRY}" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -47,12 +51,12 @@ jobs:

- name: build bundle
shell: bash
run: make bundle IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):0.0.1 VERSION=0.0.1 DEFAULT_CHANNEL=alpha
run: make bundle IMG=quay.io/${QUAY_REGISTRY}:0.0.1 VERSION=0.0.1 DEFAULT_CHANNEL=alpha

- name: verify bundle
shell: bash
run: operator-sdk bundle validate ./bundle --select-optional name=operatorhub

- name: build chart
shell: bash
run: make helmchart VERSION=0.0.1 IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):0.0.1
run: make helmchart VERSION=0.0.1 IMG=quay.io/${QUAY_REGISTRY}:0.0.1
43 changes: 28 additions & 15 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ jobs:
steps:
- name: set repo name
shell: bash
env:
QUAY_REGISTRY: ${{ secrets.QUAY_REGISTRY }}
run: |
DEFAULT_QUAY_REGISTRY=${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY)
echo "REPOSITORY_NAME=$(basename $GITHUB_REPOSITORY)" >> $GITHUB_ENV
echo "QUAY_REGISTRY=${QUAY_REGISTRY:-DEFAULT_QUAY_REGISTRY}" >> $GITHUB_ENV
- name: Set up Go 1.x
uses: actions/setup-go@v2
Expand Down Expand Up @@ -62,8 +66,8 @@ jobs:
shell: bash
run: |
echo "OPERATOR_IMAGE_TAG=latest" >> $GITHUB_ENV
echo "BUNDLE_IMAGE_TAG=v0.0.0" >> $GITHUB_ENV
echo "BUNDLE_VERSION=0.0.0" >> $GITHUB_ENV
echo "BUNDLE_IMAGE_TAG=v0.0.1" >> $GITHUB_ENV
echo "BUNDLE_VERSION=0.0.1" >> $GITHUB_ENV
- name: build code
run: make
Expand All @@ -72,15 +76,15 @@ jobs:
- name: build bundle
shell: bash
run: |
make bundle IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):${OPERATOR_IMAGE_TAG} VERSION=${BUNDLE_VERSION} DEFAULT_CHANNEL=alpha
make bundle IMG=quay.io/${QUAY_REGISTRY}:${OPERATOR_IMAGE_TAG} VERSION=${BUNDLE_VERSION} DEFAULT_CHANNEL=alpha
- name: verify bundle
shell: bash
run: operator-sdk bundle validate ./bundle --select-optional name=operatorhub

- name: build chart
shell: bash
run: make helmchart VERSION=${BUNDLE_VERSION} IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):${OPERATOR_IMAGE_TAG}
run: make helmchart VERSION=${BUNDLE_VERSION} IMG=quay.io/${QUAY_REGISTRY}:${OPERATOR_IMAGE_TAG}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand All @@ -91,7 +95,7 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: quay.io/${{ github.repository_owner }}
registry: quay.io/${{ env.QUAY_REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

Expand All @@ -101,19 +105,19 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: "quay.io/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}:${{ env.OPERATOR_IMAGE_TAG }}"
tags: "quay.io/${{ env.QUAY_REGISTRY }}:${{ env.OPERATOR_IMAGE_TAG }}"

- name: "Build and Push Bundle Image"
uses: docker/build-push-action@v2
with:
context: .
file: ./bundle.Dockerfile
push: true
tags: "quay.io/${{ github.repository_owner }}/${{ env.REPOSITORY_NAME }}-bundle:${{ env.BUNDLE_IMAGE_TAG }}"
tags: "quay.io/${{ env.QUAY_REGISTRY }}-bundle:${{ env.BUNDLE_IMAGE_TAG }}"

- name: "Verify bundle image"
shell: bash
run: operator-sdk bundle validate quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY)-bundle:${BUNDLE_IMAGE_TAG} --select-optional name=operatorhub
run: operator-sdk bundle validate quay.io/${QUAY_REGISTRY}-bundle:${BUNDLE_IMAGE_TAG} --select-optional name=operatorhub

release-helm-chart:
name: Helm Chart Release
Expand All @@ -123,8 +127,13 @@ jobs:
steps:
- name: set repo name
shell: bash
env:
QUAY_REGISTRY: ${{ secrets.QUAY_REGISTRY }}
run: |
DEFAULT_QUAY_REGISTRY=${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY)
echo "REPOSITORY_NAME=$(basename $GITHUB_REPOSITORY)" >> $GITHUB_ENV
echo "QUAY_REGISTRY=${QUAY_REGISTRY:-DEFAULT_QUAY_REGISTRY}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2

Expand All @@ -145,11 +154,11 @@ jobs:

- name: Build helm chart repo
shell: bash
run: make helmchart-repo VERSION=${VERSION} IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):${version} CHART_REPO_URL=https://${{ github.repository_owner }}.github.io/$(basename $GITHUB_REPOSITORY) HELM_REPO_DEST=./tmp/gh-pages
run: make helmchart-repo VERSION=${VERSION} IMG=quay.io/${QUAY_REGISTRY}:${version} CHART_REPO_URL=https://${{ github.repository_owner }}.github.io/$(basename $GITHUB_REPOSITORY) HELM_REPO_DEST=./tmp/gh-pages

- name: push helm repo to gh-pages
shell: bash
run: make helmchart-repo-push VERSION=${VERSION} IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):${version} CHART_REPO_URL=https://${{ github.repository_owner }}.github.io/$(basename $GITHUB_REPOSITORY) HELM_REPO_DEST=./tmp/gh-pages
run: make helmchart-repo-push VERSION=${VERSION} IMG=quay.io/${QUAY_REGISTRY}:${version} CHART_REPO_URL=https://${{ github.repository_owner }}.github.io/$(basename $GITHUB_REPOSITORY) HELM_REPO_DEST=./tmp/gh-pages

release-github:
name: GitHub Release
Expand Down Expand Up @@ -197,8 +206,12 @@ jobs:
steps:
- name: set repo name
shell: bash
env:
QUAY_REGISTRY: ${{ secrets.QUAY_REGISTRY }}
run: |
DEFAULT_QUAY_REGISTRY=${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY)
echo "REPOSITORY_NAME=$(basename $GITHUB_REPOSITORY)" >> $GITHUB_ENV
echo "QUAY_REGISTRY=${QUAY_REGISTRY:-DEFAULT_QUAY_REGISTRY}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -236,7 +249,7 @@ jobs:
- name: create and copy bundle to community operators
shell: bash
run: |
make bundle IMG=quay.io/${{ github.repository_owner }}/$(basename $GITHUB_REPOSITORY):v${VERSION} VERSION=${VERSION} DEFAULT_CHANNEL=alpha
make bundle IMG=quay.io/${QUAY_REGISTRY}:v${VERSION} VERSION=${VERSION} DEFAULT_CHANNEL=alpha
sed 's/bundle\///g' bundle.Dockerfile > bundle/Dockerfile
sed -i '/replaces: '"$(basename $GITHUB_REPOSITORY)"'/d' ./bundle/manifests/$(basename $GITHUB_REPOSITORY).clusterserviceversion.yaml
mkdir -p ./tmp/community-operators/community-operators/$(basename $GITHUB_REPOSITORY)/${VERSION}
Expand All @@ -248,8 +261,8 @@ jobs:
with:
path: ./tmp/community-operators
commit-message: ${{ env.REPOSITORY_NAME }} release ${{ env.VERSION }}
committer: ${{ github.actor }} <raffaele.spazzoli@gmail.com>
author: ${{ github.actor }} <raffaele.spazzoli@gmail.com>
committer: ${{ github.actor }} <andy.block@gmail.com>
author: ${{ github.actor }} <andy.block@gmail.com>
signoff: true
branch: ${{ env.REPOSITORY_NAME }}-${{ env.VERSION }}
delete-branch: true
Expand Down Expand Up @@ -312,8 +325,8 @@ jobs:
with:
path: ./tmp/community-operators
commit-message: ${{ env.REPOSITORY_NAME }} release ${{ env.VERSION }}
committer: ${{ github.actor }} <raffaele.spazzoli@gmail.com>
author: ${{ github.actor }} <raffaele.spazzoli@gmail.com>
committer: ${{ github.actor }} <andy.block@gmail.com>
author: ${{ github.actor }} <andy.block@gmail.com>
signoff: true
branch: ${{ env.REPOSITORY_NAME }}-${{ env.VERSION }}
delete-branch: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
repository: https://github.com/redhat-cop/group-sync-operator
support: Red Hat Community of Practice
name: group-sync-operator.vX.Y.Z
name: group-sync-operator.v0.0.1
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require (
github.com/onsi/gomega v1.10.2
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
github.com/openshift/library-go v0.0.0-20200527213645-a9b77f5402e3
github.com/operator-framework/operator-lib v0.1.0 // indirect
github.com/prometheus/common v0.10.0
github.com/redhat-cop/operator-utils v1.0.0
github.com/robfig/cron v0.0.0-20170526150127-736158dc09e1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ github.com/openshift/build-machinery-go v0.0.0-20200424080330-082bf86082cc/go.mo
github.com/openshift/client-go v0.0.0-20200521150516-05eb9880269c/go.mod h1:kCMeo6IE4o4qvnepM9lgHQ4j/ZFfvY/N/2G/jpJdwm4=
github.com/openshift/library-go v0.0.0-20200527213645-a9b77f5402e3 h1:xCOXlKSaInOrnS1iTwzB44Co+4FQCykmb8GZcji4K8M=
github.com/openshift/library-go v0.0.0-20200527213645-a9b77f5402e3/go.mod h1:dJqjuQMmC/T1nhi5yGbRf7qGxnO+vRa2j99y6oVYDZQ=
github.com/operator-framework/operator-lib v0.1.0 h1:7Qy6v2ZccvCeFLWEkrGnN+U+DkaeIWp0gAZaBM9T3DI=
github.com/operator-framework/operator-lib v0.1.0/go.mod h1:HLw61JTIEeq0YLeVf4dwYx/zt4DmLGZUVWI1y3Lf5Hg=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
Expand Down

0 comments on commit 5454dc6

Please sign in to comment.