Skip to content
Snippets Groups Projects
Commit 394de471 authored by schnarkus's avatar schnarkus
Browse files

test publish to package registry

parent 5ea295f4
No related branches found
No related tags found
No related merge requests found
Pipeline #58824 failed
stages:
- "build"
- "test"
- "publish"
variables:
version: "0.0.$CI_PIPELINE_IID"
build_job:
stage: build
image: public.ecr.aws/docker/library/golang:1.21
parallel:
matrix:
- GOOS:
- linux
- darwin
- windows
- GOARCH:
- amd64
- arm64
script: |
go build \
-o webservice_$GOOS_$GOARCH.bin \
./*.go
stages:
- test
- build
- publish
test_job:
stage: test
......@@ -27,7 +13,32 @@ test_job:
- go get -t ./...
- go test -race -v ./...
build_job:
stage: build
image: public.ecr.aws/docker/library/golang:1.21
parallel:
matrix:
- GOOS: [linux, darwin, windows]
- GOARCH: [amd64, arm64]
script: |
go build -o webservice_$GOOS_$GOARCH.bin ./*.go
artifacts:
paths:
- "webservice_$GOOS_$GOARCH.bin"
expire_in: 30 sec
publish_job:
stage: publish
image: public.ecr.aws/ubuntu/ubuntu:22.04_stable
script: echo publishing now
tags: docker-privileged
dependencies: build_job
before_script:
- apt update
- apt install -y ca-certificates curl
- update-ca-certificates
script: |
for file in $(ls webservice_*); do
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
--upload-file "./$file" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/artifacts/${version}/$file"
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment