Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from metal-stack/move-to-metal-stack
Browse files Browse the repository at this point in the history
Move to metal-stack
  • Loading branch information
mreiger authored Mar 16, 2021
2 parents e2f00b9 + 388ab4a commit c75a096
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 21 deletions.
30 changes: 30 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'

template: |
## General Changes
$CHANGES
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
23 changes: 18 additions & 5 deletions .github/workflows/latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Lint
uses: actions-contrib/golangci-lint@master
uses: golangci/golangci-lint-action@v2
with:
args: run
version: v1.32.2
args: -p bugs

- name: Build and push Docker image
run: |
docker login -u mreiger -p ${{ secrets.DOCKER_HUB_TOKEN }}
docker build -t mreiger/audit-forwarder .
docker push mreiger/audit-forwarder
docker build -t ghcr.io/metal-stack/audit-forwarder .
docker push ghcr.io/metal-stack/audit-forwarder
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 24 additions & 6 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,31 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Figure out if running fork PR
id: fork
run: '["${{ secrets.DOCKER_REGISTRY_TOKEN }}" == ""] && echo "::set-output name=is_fork_pr::true" || echo "::set-output name=is_fork_pr::false"'

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
if: steps.fork.outputs.is_fork_pr == 'false'

- name: Lint
uses: actions-contrib/golangci-lint@master
uses: golangci/golangci-lint-action@v2
with:
args: run
- name: Build and push Docker image
version: v1.32.2
args: -p bugs

- name: Build Docker image
run: |
docker build -t ghcr.io/metal-stack/audit-forwarder:pr-${GITHUB_HEAD_REF##*/} .
- name: Push Docker image
run: |
docker login -u mreiger -p ${{ secrets.DOCKER_HUB_TOKEN }}
# pull request images are prefixed with 'pr' to prevent them from overriding released images
docker build -t mreiger/audit-forwarder:pr-${GITHUB_HEAD_REF##*/} .
docker push mreiger/audit-forwarder:pr-${GITHUB_HEAD_REF##*/}
docker push ghcr.io/metal-stack/audit-forwarder:pr-${GITHUB_HEAD_REF##*/}
if: steps.fork.outputs.is_fork_pr == 'false'
25 changes: 17 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: Build image from release tag

on:
push:
tags:
- "v*"
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Docker Login
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Lint
uses: actions-contrib/golangci-lint@master
uses: golangci/golangci-lint-action@v2
with:
args: run
version: v1.32.2
args: -p bugs

- name: Build and push Docker image
run: |
docker login -u mreiger -p ${{ secrets.DOCKER_HUB_TOKEN }}
docker build -t mreiger/audit-forwarder:${GITHUB_REF##*/} .
docker push mreiger/audit-forwarder:${GITHUB_REF##*/}
docker build -t ghcr.io/metal-stack/audit-forwarder:${GITHUB_REF##*/} .
docker push ghcr.io/metal-stack/audit-forwarder:${GITHUB_REF##*/}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @metal-stack/metal-api-maintainers
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing

Please check out the [contributing section](https://docs.metal-stack.io/stable/development/contributing/) in our [docs](https://docs.metal-stack.io/).
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,9 @@ func checkSecret(opts *Opts, client *k8s.Clientset) error {
}
f := path.Join(opts.TLSBaseDir, k)
logger.Debugw("Writing certificate to file", k, f)
err := ioutil.WriteFile(f, v, 0640)
err := ioutil.WriteFile(f, v, 0600)
if err != nil {
return fmt.Errorf("could not write secret to certificate base folder:%v", err)
return fmt.Errorf("could not write secret to certificate base folder:%w", err)
}
}

Expand Down

0 comments on commit c75a096

Please sign in to comment.