Skip to content

Commit

Permalink
Merge pull request #15 from redhat-marketplace/release/0.1.2
Browse files Browse the repository at this point in the history
Release 0.1.2
  • Loading branch information
zach-source authored Jun 5, 2020
2 parents eb872ed + 25e5dea commit feb2287
Show file tree
Hide file tree
Showing 110 changed files with 7,223 additions and 1,726 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**OpenShift (please complete the following information):**
- Version: [e.g. 4.2, 4.3]

**Additional context**
Add any other context about the problem here.

**Log Output**
Add any logs from the operator pod here.
97 changes: 97 additions & 0 deletions .github/workflows/create-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Create Manifest

on:
push:
branches:
- 'release/**'
- 'hotfix/**'
paths-ignore:
- 'docs/**'
- 'deploy/olm-catalog/redhat-marketplace-operator/**'
env:
pushImage: true

jobs:
create-bundle:
name: Create Bundle
runs-on: ubuntu-latest
strategy:
matrix:
channel: ['stable']
include:
- channel: 'stable'
tags: ['release']
draft: 'false'
message: 'Stable release should be merged.'
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
token: ${{ secrets.pullRequestSecret }}

- name: Get Vars
id: vars
run: |
echo ::set-env name=pr_branch::$(echo $BRANCH | sed 's/refs\/heads\///')
echo ::set-env name=NEW_BRANCH_NAME::release/${{ matrix.channel }}
echo "::set-output name=version::$(make current-version)"
echo "::set-output name=tag::sha-$(git rev-parse --short HEAD)"
echo "::set-output name=hash::$(make current-version)-${FILEHASH:0:6}"
echo "::set-env name=OPERATOR_IMAGE::quay.io/rh-marketplace/redhat-marketplace-operator:$(make current-version)-${FILEHASH:0:6}"
env:
FILEHASH: ${{ hashFiles('build/**', 'assets/**', 'cmd/**', 'pkg/**', 'version/**', 'go.sum', 'go.mod') }}
BRANCH: ${{ github.ref }}

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install operator-sdk
run: |
cd /tmp
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
python -m pip install --upgrade pip
pip3 install operator-courier
echo "::add-path::/usr/local/bin"
env:
RELEASE_VERSION: v0.17.1

- name: Create CSV
id: bundle
run: make generate-csv bundle
env:
CSV_CHANNEL: ${{ matrix.channel }}
CSV_DEFAULT_CHANNEL: ${{ matrix.channel == 'stable' }}

- name: Create branch
if: ${{ matrix.channel == 'stable' && github.event_name == 'push' }}
run: |
git config user.name 'Zach Taylor'
git config user.email '[email protected]'
git add ./deploy/olm-catalog
git commit -m "chore: update csv"
git push
- name: Open a PR to the default branch
uses: vsoch/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_FROM_BRANCH: '${{ env.pr_branch }}'
PULL_REQUEST_BRANCH: master
PULL_REQUEST_TITLE: 'Release ${{ steps.vars.outputs.version }}'
PULL_REQUEST_BODY: "Release PR - merge when ready.\n\nSteps:\n1. Release the beta channel bundle from the PR 'Generate Bundle' check.\n1. Test beta. Make changes to release branch as necessary.\n1. Release the stable channel.\n1. Merge this PR."
89 changes: 89 additions & 0 deletions .github/workflows/generate-bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Generate Bundle

on:
pull_request:
branches:
- master
- develop
- 'release/stable'
- 'hotfix/stable'
env:
pushImage: true

jobs:
generate-bundle:
name: Generate Bundle
runs-on: ubuntu-latest
strategy:
matrix:
channel: ['stable', 'beta']
include:
- channel: 'beta'
tags: ['no-merge']
draft: 'true'
message: 'Beta releases should not be merged. Only for deployment.'
- channel: 'stable'
tags: ['release']
draft: 'false'
message: 'Stable release should be merged.'
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
token: ${{ secrets.pullRequestSecret }}

- name: Get Vars
id: vars
run: |
echo ::set-env name=pr_branch::$(echo $BRANCH | sed 's/refs\/heads\///')
echo ::set-env name=NEW_BRANCH_NAME::release/${{ matrix.channel }}
echo "::set-output name=version::$(make current-version)"
echo "::set-output name=last_version::$(make current-version)"
echo "::set-output name=tag::sha-$(git rev-parse --short HEAD)"
echo "::set-output name=hash::$(make current-version)-${FILEHASH:0:6}"
env:
FILEHASH: ${{ hashFiles('build/**', 'assets/**', 'cmd/**', 'pkg/**', 'version/**', 'go.sum', 'go.mod') }}
BRANCH: ${{ github.ref }}

- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install operator-sdk
run: |
cd /tmp
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && sudo mkdir -p /usr/local/bin/ && sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk && rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
python -m pip install --upgrade pip
pip3 install operator-courier
echo "::add-path::/usr/local/bin"
env:
RELEASE_VERSION: v0.17.1

- name: Create Bundle
id: bundle
run: make manifest-package-${{ matrix.channel }} bundle
env:
CSV_CHANNEL: ${{ matrix.channel }}
CSV_DEFAULT_CHANNEL: ${{ matrix.channel == 'stable' }}
OPERATOR_IMAGE: quay.io/rh-marketplace/redhat-marketplace-operator:${{ steps.vars.outputs.hash }}

- name: Upload bundle to actions
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.channel }}-${{ steps.vars.outputs.hash }}${{ steps.bundle.outputs.bundlename }}
path: bundle
147 changes: 147 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
name: Test & Deploy Image

on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
- release/**
- hotfix/**

env:
pushImage: true
#IMAGE_REGISTRY: quay.io/zach-source
#IMAGE_REGISTRY: quay.io/rh-marketplace

jobs:
build:
name: Test
runs-on: ubuntu-latest

outputs:
version: ${{ steps.vars.outputs.version }}
tag: ${{ steps.vars.outputs.tag }}
hash: ${{ steps.vars.outputs.hash }}
tagExists: ${{ steps.checktag.outputs.exists }}

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get Vars
id: vars
run: |
echo "::set-output name=version::$(make current-version)"
echo "::set-output name=tag::sha-$(git rev-parse --short HEAD)"
echo "::set-output name=hash::$(make current-version)-${FILEHASH:0:6}"
env:
FILEHASH: ${{ hashFiles('build/**', 'assets/**', 'cmd/**', 'pkg/**', 'version/**', 'go.sum', 'go.mod') }}

- name: Get dependencies
run: |
go mod download
- name: Test
run: make test

- name: Check if tag exists
id: checktag
shell: bash {0}
run: |
skopeo inspect docker://${TAG} > /dev/null
[[ $? == 0 ]] && echo ::set-output name=exists::true || echo ::set-output name=exists::false
env:
TAG: quay.io/rh-marketplace/redhat-marketplace-operator:${{ steps.vars.outputs.hash }}

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
registry:
- 'quay.io/rh-marketplace'
include:
- registry: quay.io/rh-marketplace
name: quay
key: quayUser
value: quayPassword
env:
OPERATOR_IMAGE: ${{ matrix.registry }}/redhat-marketplace-operator:${{ needs.build.outputs.hash }}
TAG: ${{ matrix.registry }}/redhat-marketplace-operator:${{ needs.build.outputs.hash }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Check if tag exists
id: image
shell: bash {0}
run: |
skopeo inspect docker://${TAG} --creds ${{ secrets[matrix.key] }}:${{ secrets[matrix.value] }} > /dev/null
[[ $? == 0 ]] && echo ::set-env name=exists::true || echo ::set-env name=exists::false
- name: Build
if: env.exists != 'true'
run: make build

- name: Login ${{ matrix.name }}
run: make docker-login
env:
DOCKER_USER: ${{ secrets[matrix.key] }}
DOCKER_PASSWORD: ${{ secrets[matrix.value] }}
REGISTRY: ${{ matrix.registry }}

- name: Deploy ${{ matrix.name }}
if: env.exists != 'true' && env.pushImage == 'true'
run: make push
tag:
name: Tag
runs-on: ubuntu-latest
needs: [build, deploy]
strategy:
matrix:
registry:
- 'scan.connect.redhat.com/ospid-c93f69b6-cb04-437b-89d6-e5220ce643cd'
include:
- registry: scan.connect.redhat.com/ospid-c93f69b6-cb04-437b-89d6-e5220ce643cd
fromRegistry: quay.io/rh-marketplace
name: PC
key: pcUser
value: pcPassword
env:
FROM_OPERATOR_IMAGE: ${{ matrix.fromRegistry }}/redhat-marketplace-operator:${{ needs.build.outputs.hash }}
TO_OPERATOR_IMAGE: ${{ matrix.registry }}/redhat-marketplace-operator:${{ needs.build.outputs.hash }}
TAG: ${{ matrix.registry }}/redhat-marketplace-operator:${{ needs.build.outputs.hash }}
steps:
- name: Check if tag exists
id: image
shell: bash {0}
run: |
skopeo inspect docker://${TAG} --creds ${{ secrets[matrix.key] }}:${{ secrets[matrix.value] }} > /dev/null
[[ $? == 0 ]] && echo ::set-env name=exists::true || echo ::set-env name=exists::false
- name: Copy ${{ matrix.name }}
if: env.exists != 'true' && env.pushImage == 'true'
run: |
skopeo copy "docker://${FROM_OPERATOR_IMAGE}" "docker://${TO_OPERATOR_IMAGE}" --dest-creds ${{ secrets[matrix.key] }}:${{ secrets[matrix.value] }}
25 changes: 25 additions & 0 deletions .github/workflows/license.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check License

on:
pull_request:
branches: [ master, develop, feature/*, hotfix/*, release/*, bugfix/* ]

jobs:

license:
name: Check License
runs-on: ubuntu-latest

steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Check licenses - run 'make add-licenses' if this errors
run: make check-licenses
Loading

0 comments on commit feb2287

Please sign in to comment.