-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding github files and allow injecting image
- Loading branch information
1 parent
c761502
commit 59b3915
Showing
11 changed files
with
294 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## Description | ||
|
||
<!-- Fill-in description here --> | ||
|
||
## Dependencies | ||
|
||
<!-- List here any related PRs with links, that need to be pulled also for testing --> | ||
n/a | ||
|
||
## Checklist | ||
|
||
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that. | ||
|
||
* [ ] Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix _(in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes)._ | ||
* [ ] Does this PR require product documentation? | ||
* [ ] If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs. | ||
* [ ] Does this PR require a product release notes entry? | ||
* [ ] If so, fill in "Release Note Text" in the JIRA. | ||
* [ ] Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc. | ||
* [ ] If so, make sure it is described in the JIRA ticket. | ||
* QE requirements (check 1 from the list): | ||
* [ ] Standard QE validation, with pre-merge tests unless stated otherwise. | ||
* [ ] Regression tests only (e.g. refactoring with no user-facing change). | ||
* [ ] No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
changelog: | ||
categories: | ||
- title: Breaking changes 🛠 | ||
labels: | ||
- breaking-change | ||
- title: Non-breaking changes | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: greetings | ||
|
||
on: [issues] | ||
|
||
jobs: | ||
greeting: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/first-interaction@v1 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-message: 'Congratulations for contributing your first netobserv-cli issue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: pull request checks | ||
|
||
on: | ||
pull_request: | ||
branches: ['*'] | ||
|
||
jobs: | ||
build-test: | ||
name: Build, lint, test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.21'] | ||
|
||
steps: | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: run build | ||
run: make build && git diff --exit-code | ||
- name: run unit tests | ||
run: make test | ||
- name: Report coverage | ||
uses: codecov/[email protected] | ||
with: | ||
files: ./cover.out | ||
flags: unittests | ||
fail_ci_if_error: false | ||
args: --timeout 3m0s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build and push to quay.io | ||
on: | ||
push: | ||
branches: [ main, release-*, workflow-test ] | ||
|
||
env: | ||
WF_REGISTRY_USER: netobserv+github_ci | ||
WF_ORG: netobserv | ||
WF_MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x | ||
WF_VERSION: ${{ github.ref_name }} | ||
|
||
jobs: | ||
push-image: | ||
name: push image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.21'] | ||
steps: | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: docker login to quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ env.WF_REGISTRY_USER }} | ||
password: ${{ secrets.QUAY_SECRET }} | ||
registry: quay.io | ||
- name: get short sha | ||
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- name: build and push manifest with images | ||
run: | | ||
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.WF_VERSION }} make images | ||
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.short_sha }} OCI_BUILD_OPTS="--label quay.expires-after=2w" make images | ||
if [[ "main" == "$WF_VERSION" ]]; then | ||
MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=latest make images | ||
fi | ||
codecov: | ||
name: Codecov upload | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.21'] | ||
steps: | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: Test | ||
run: make test | ||
- name: Report coverage | ||
uses: codecov/[email protected] | ||
with: | ||
files: ./cover.out | ||
flags: unittests | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build and push PR image to quay.io | ||
on: | ||
pull_request_target: | ||
types: [labeled] | ||
|
||
env: | ||
WF_REGISTRY_USER: netobserv+github_ci | ||
WF_REGISTRY: quay.io/netobserv | ||
WF_IMAGE: network-observability-cli | ||
WF_ORG: netobserv | ||
|
||
jobs: | ||
push-pr-image: | ||
if: ${{ github.event.label.name == 'ok-to-test' }} | ||
name: push PR image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.21'] | ||
steps: | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: "refs/pull/${{ github.event.number }}/merge" | ||
- name: docker login to quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ env.WF_REGISTRY_USER }} | ||
password: ${{ secrets.QUAY_SECRET }} | ||
registry: quay.io | ||
- name: get short sha | ||
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
- name: build and push manifest with images | ||
run: OCI_BUILD_OPTS="--label quay.expires-after=2w" IMAGE_ORG=${{ env.WF_ORG }} IMAGE=${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} make images | ||
- uses: actions/github-script@v6 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: `New image: | ||
${{ env.WF_REGISTRY }}/${{ env.WF_IMAGE }}:${{ env.short_sha }} | ||
It will expire after two weeks. | ||
To deploy this build, update the CLI images in the corresponding YAML files under res folder. | ||
Then run: | ||
\`\`\`bash | ||
USER=netobserv VERSION=${{ env.short_sha }} make oc-commands | ||
\`\`\` | ||
` | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: release to quay.io | ||
on: | ||
push: | ||
tags: [v*] | ||
|
||
env: | ||
WF_REGISTRY_USER: netobserv+github_ci | ||
WF_ORG: netobserv | ||
WF_MULTIARCH_TARGETS: amd64 arm64 ppc64le s390x | ||
|
||
jobs: | ||
push-image: | ||
name: push image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.21'] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: validate tag | ||
run: | | ||
tag=`git describe --exact-match --tags 2> /dev/null` | ||
if [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc[0-9]+)?$ ]]; then | ||
echo "$tag is a valid release tag" | ||
set -e | ||
echo "tag=$tag" >> $GITHUB_ENV | ||
else | ||
echo "$tag is NOT a valid release tag" | ||
exit 1 | ||
fi | ||
- name: install make | ||
run: sudo apt-get install make | ||
- name: set up go 1.x | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: docker login to quay.io | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ env.WF_REGISTRY_USER }} | ||
password: ${{ secrets.QUAY_SECRET }} | ||
registry: quay.io | ||
- name: build and push manifest with images | ||
run: MULTIARCH_TARGETS="${{ env.WF_MULTIARCH_TARGETS }}" IMAGE_ORG=${{ env.WF_ORG }} VERSION=${{ env.tag }} make images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Remove ok-to-test | ||
on: | ||
pull_request_target: | ||
types: [synchronize,reopened] | ||
|
||
jobs: | ||
rm-ok-to-test: | ||
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test') | ||
runs-on: ubuntu-latest | ||
name: Remove ok-to-test | ||
steps: | ||
- uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: ok-to-test | ||
fail_on_error: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters