74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
before_script:
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
|
|
stages:
|
|
- build
|
|
- build-docker
|
|
|
|
build-windows-amd64:
|
|
image: golang:alpine
|
|
stage: build
|
|
script:
|
|
- go get -d
|
|
- GOOS=windows go build -o godns.exe
|
|
artifacts:
|
|
paths:
|
|
- godns.exe
|
|
|
|
build-linux-amd64:
|
|
image: golang:alpine
|
|
stage: build
|
|
script:
|
|
- go get -d
|
|
- GOOS=linux go build -o godns
|
|
artifacts:
|
|
paths:
|
|
- godns
|
|
|
|
build-linux-arm:
|
|
image: golang:alpine
|
|
stage: build
|
|
script:
|
|
- go get -d
|
|
- GOARCH=arm GOOS=linux go build -o godns-arm
|
|
artifacts:
|
|
paths:
|
|
- godns-arm
|
|
|
|
build-linux-arm64:
|
|
image: golang
|
|
stage: build
|
|
script:
|
|
- go get -d
|
|
- GOARCH=arm64 GOOS=linux go build -o godns-arm64
|
|
artifacts:
|
|
paths:
|
|
- godns-arm64
|
|
|
|
build-docker-amd64:
|
|
image: docker:latest
|
|
stage: build-docker
|
|
script:
|
|
- docker image build -t $CI_REGISTRY_IMAGE:amd64-latest -f docker/Dockerfile .
|
|
- docker push $CI_REGISTRY_IMAGE:amd64-latest
|
|
|
|
build-docker-arm:
|
|
image: docker:latest
|
|
stage: build-docker
|
|
script:
|
|
- mkdir tmp
|
|
- wget -O tmp/qemu-arm-static https://github.com/multiarch/qemu-user-static/releases/download/v2.12.0/qemu-arm-static
|
|
- chmod +x tmp/qemu-arm-static
|
|
- docker image build -t $CI_REGISTRY_IMAGE:arm-latest -f docker/Dockerfile.arm .
|
|
- docker push $CI_REGISTRY_IMAGE:arm-latest
|
|
|
|
build-docker-arm64:
|
|
image: docker:latest
|
|
stage: build-docker
|
|
script:
|
|
- mkdir tmp
|
|
- wget -O tmp/qemu-aarch64-static https://github.com/multiarch/qemu-user-static/releases/download/v2.12.0/qemu-aarch64-static
|
|
- chmod +x tmp/qemu-aarch64-static
|
|
- docker image build -t $CI_REGISTRY_IMAGE:arm64-latest -f docker/Dockerfile.arm64 .
|
|
- docker push $CI_REGISTRY_IMAGE:arm64-latest
|