-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch from hub.docker.com to ghcr.io
This bundles a couple of changes. Before this CL we tested the windows client within a docker container. As we stopped supporting docker on windows quiet a while back it's better to deprecate this method on moving contrainer registries. This required an overhaul of the underlying test setup. As a benefit tests are speed up quiet a lot. Signed-off-by: Tobias Kohlbau <t.kohlbau@myopenfactory.com>
- Loading branch information
1 parent
a2b2d6b
commit caf3059
Showing
12 changed files
with
141 additions
and
288 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,70 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-2019] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: 'go.mod' | ||
- name: Unit Tests | ||
run: go test -v ./... | ||
|
||
- name: Build release | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
args: build --snapshot --single-target | ||
|
||
- name: E2E Tests Linux | ||
if: runner.os == 'Linux' | ||
working-directory: ./test | ||
run: | | ||
export CONFIG_DIR="/tmp/myof/config" | ||
mkdir -p $CONFIG_DIR | ||
echo -n ${CERTIFICATE} | base64 --decode > $CONFIG_DIR/certificate.pem | ||
echo -n ${CONFIG} | base64 --decode > $CONFIG_DIR/config.properties | ||
mkdir -p /tmp/myof/logs | ||
mkdir -p /tmp/myof/inbound | ||
mkdir -p /tmp/myof/outbound | ||
mkdir -p /tmp/myof/success | ||
mkdir -p /tmp/myof/error | ||
mkdir -p /tmp/myof/attachment | ||
../dist/myof-client_linux_amd64_v1/myof-client --config $CONFIG_DIR/config.properties & | ||
go run main.go | ||
env: | ||
CONFIG: ${{ secrets.LINUX_CONFIG }} | ||
CERTIFICATE: ${{ secrets.CLIENT_CERTIFICATE }} | ||
|
||
- name: E2E Tests Windows | ||
shell: bash | ||
if: runner.os == 'Windows' | ||
working-directory: ./test | ||
run: | | ||
export CONFIG_DIR="C:/myof/config" | ||
mkdir -p $CONFIG_DIR | ||
echo -n ${CERTIFICATE} | base64 --decode > $CONFIG_DIR/certificate.pem | ||
echo -n ${CONFIG} | base64 --decode > $CONFIG_DIR/config.properties | ||
mkdir -p "C:/myof/logs" | ||
mkdir -p "C:/myof/inbound/" | ||
mkdir -p "C:/myof/outbound/" | ||
mkdir -p "C:/myof/success/" | ||
mkdir -p "C:/myof/error/" | ||
mkdir -p "C:/myof/attachment/" | ||
../dist/myof-client_windows_amd64_v1/myof-client.exe --config $CONFIG_DIR/config.properties & | ||
go run main.go | ||
env: | ||
CONFIG: ${{ secrets.WINDOWS_CONFIG }} | ||
CERTIFICATE: ${{ secrets.CLIENT_CERTIFICATE }} |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
name: publish | ||
|
||
permissions: | ||
packages: write | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: "go.mod" | ||
- name: Prepare THIRD_PARTY folder | ||
run: | | ||
go install github.com/google/go-licenses@latest | ||
go-licenses save . --save_path="THIRD_PARTY/" | ||
- name: Prepare sign certificate | ||
run: echo -n ${SIGN_CERTIFICATE} | base64 --decode > $HOME/key.asc | ||
env: | ||
SIGN_CERTIFICATE: ${{ secrets.SIGN_CERTIFICATE }} | ||
- name: Release | ||
uses: goreleaser/goreleaser-action@v1 | ||
with: | ||
version: latest | ||
args: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,23 +1,5 @@ | ||
BUILD_COMMIT := $(shell git rev-parse --short HEAD) | ||
BUILD_DATE := $(shell date -Iseconds) | ||
ifeq ($(OS),Windows_NT) | ||
BUILD_OUTPUT_EXTENSION=.exe | ||
COMPOSE_FILE=docker-compose.windows.yml | ||
else | ||
COMPOSE_FILE=docker-compose.yml | ||
endif | ||
|
||
build: | ||
CGO_ENABLED=0 go build -o myof-client${BUILD_OUTPUT_EXTENSION} -ldflags "-X github.com/myopenfactory/client/pkg/version.Date=${BUILD_DATE} -X github.com/myopenfactory/client/pkg/version.Commit=${BUILD_COMMIT}" | ||
CGO_ENABLED=0 go build -o ./test/e2e-test${BUILD_OUTPUT_EXTENSION} ./test | ||
|
||
generate: | ||
go generate ./... | ||
|
||
protogen: | ||
@./protogen.sh | ||
|
||
.PHONY: test | ||
test: build | ||
cd test && docker-compose -f ${COMPOSE_FILE} down -v | ||
cd test && docker-compose -f ${COMPOSE_FILE} up --build --force-recreate --abort-on-container-exit --renew-anon-volumes --exit-code-from test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
services: | ||
client: | ||
image: ghcr.io/myopenfactory/client:snapshot | ||
volumes: | ||
- "${CONFIG_DIR}:/myof/config" | ||
- "./logs:/myof/logs" | ||
- "./inbound:/myof/inbound" | ||
- "./outbound:/myof/outbound" | ||
- "./success:/myof/success" | ||
- "./error:/myof/error" | ||
- "./attachment:/myof/attachment" | ||
command: | ||
- --config | ||
- /myof/config/config.properties |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.