Skip to content

Commit

Permalink
updating dependencies and build processes to latest versions
Browse files Browse the repository at this point in the history
Signed-off-by: Adam D. Cornett <adc@redhat.com>
  • Loading branch information
acornett21 authored and komish committed Jun 16, 2023
1 parent 5c17fa9 commit 3499c07
Show file tree
Hide file tree
Showing 18 changed files with 397 additions and 1,408 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/Build.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@ on:
jobs:
build:
name: Build artifacts
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
path: "chart-verifier"

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '>=1.17.0'
go-version-file: go.mod

- name: Ensure Modules
working-directory: ./chart-verifier
Expand All @@ -42,10 +39,6 @@ jobs:
working-directory: ./chart-verifier
run: make bin

- name: Download dependencies
working-directory: ./chart-verifier
run: go mod download

- name: Run tests
working-directory: ./chart-verifier
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Send message to helm_dev slack channel
id: notify_dev
if: ${{ always() && github.event_name == 'schedule' && steps.codeql_analysis.conclusion != 'success' }}
uses: archive/github-actions-slack@v2.0.0
uses: archive/github-actions-slack@v2.7.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: C02979BDUPL
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Send message to helm_notify slack channel
id: notify
if: ${{ always() && github.event_name == 'schedule' && steps.codeql_analysis.conclusion == 'success' }}
uses: archive/github-actions-slack@v2.0.0
uses: archive/github-actions-slack@v2.7.0
with:
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: C04K1ARMH8A
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/dev_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ on:
jobs:
build:
name: Create Dev Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
DEV_RELEASE: 0.1.0

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.17.2'
go-version-file: go.mod

- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.9'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vulnerability.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Run Gosec Security Scanner
run: |
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ run:
linters:
enable:
- asciicheck
- deadcode
- unused
- depguard
- gofumpt
- goimports
Expand Down
17 changes: 1 addition & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
#
# The golang:1.15 image is a copy of docker.io/library/golang:1.17 hosted in Quay to work around rate limits to
# Dockerhub:
#
# > docker pull golang:1.17.2
# > docker tag golang:1.17.2 quay.io/redhat-certification/golang:1.17.2
# > docker push quay.io/redhat-certification/golang:1.17.2
#
# To upgrade Go, then a new image should be pushed to Quay and updated below.
#
FROM quay.io/redhat-certification/golang:1.17.2 as build
FROM docker.io/golang:1.20 as build

WORKDIR /tmp/src

COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN go build -o ./out/chart-verifier main.go
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.DEFAULT_GOAL:=help

IMAGE_BUILDER?=podman
IMAGE_REPO?=quay.io/redhat-certification
COMMIT_ID=$(shell git rev-parse --short HEAD)

default: bin

Expand Down Expand Up @@ -44,7 +49,7 @@ test:

.PHONY: build-image
build-image:
hack/build-image.sh
$(IMAGE_BUILDER) build -t $(IMAGE_REPO)/chart-verifier:$(COMMIT_ID) .

.PHONY: gosec
gosec: install.gosec
Expand Down
28 changes: 1 addition & 27 deletions docs/helm-chart-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,7 @@ Alternatively, download `chart-verifier` binary from the [release page](https://

To build `chart-verifier` locally, execute `make bin` for macOS and Linux, or `make bin_win` for Windows.

To build `chart-verifier` container image, execute `hack/build-image.sh` or its PowerShell alternative:

```text
PS C:\Users\igors\GolandProjects\chart-verifier> .\hack\build-image.ps1
[+] Building 15.1s (15/15) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/fedora:31 1.4s
=> [internal] load metadata for docker.io/library/golang:1.15 1.3s
=> [build 1/7] FROM docker.io/library/golang:1.15@sha256:d141a8bca046ade2c96f89e864cd31f5d0ba88d5a71d62d59e0e1f2ecc2451f1 0.0s
=> CACHED [stage-1 1/2] FROM docker.io/library/fedora:31@sha256:ba4fe6a3da48addb248a16e8a63599cc5ff5250827e7232d2e3038279a0e467e 0.0s
=> [internal] load build context 0.5s
=> => transferring context: 43.06MB 0.5s
=> CACHED [build 2/7] WORKDIR /tmp/src 0.0s
=> CACHED [build 3/7] COPY go.mod . 0.0s
=> CACHED [build 4/7] COPY go.sum . 0.0s
=> CACHED [build 5/7] RUN go mod download 0.0s
=> [build 6/7] COPY . . 0.2s
=> [build 7/7] RUN ./hack/build.sh 12.5s
=> [stage-1 2/2] COPY --from=build /tmp/src/out/chart-verifier /app/chart-verifier 0.1s
=> exporting to image 0.2s
=> => exporting layers 0.2s
=> => writing image sha256:7302e88a2805cb4be1b9e130d057bd167381e27f314cbe3c28fbc6cb7ee6f2a1 0.0s
=> => naming to quay.io/redhat-certification/chart-verifier:07e369d
```
To build `chart-verifier` container image, execute `make build-image`:

The container image created by the build program is tagged with the commit ID of the working directory at the time of
the build: `quay.io/redhat-certification/chart-verifier:0d3706f`.
Expand Down
Loading

0 comments on commit 3499c07

Please sign in to comment.