2022-02-02 15:43:37 +00:00
|
|
|
build-test-linux-amd64:
|
|
|
|
image: golang:latest
|
|
|
|
stage: build-binary
|
|
|
|
variables:
|
|
|
|
GOOS: "linux"
|
|
|
|
GOARCH: "amd64"
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
before_script:
|
|
|
|
- go get -d -v ./...
|
|
|
|
- apt install curl -y
|
|
|
|
script:
|
|
|
|
- go build -a -installsuffix cgo -ldflags="-X $I_PACKAGE.CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA -X $I_PACKAGE.CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH -X $I_PACKAGE.CI_COMMIT_TAG=$CI_COMMIT_TAG" -o linux-amd64 .
|
|
|
|
only:
|
|
|
|
- main
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- linux-amd64
|
|
|
|
expire_in: 1 week
|
|
|
|
|
2022-01-25 20:16:56 +00:00
|
|
|
docker-build-prod-latest:
|
2022-02-04 22:02:25 +00:00
|
|
|
image: jdrouet/docker-with-buildx:stable
|
2022-01-25 20:16:56 +00:00
|
|
|
stage: build-docker
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
before_script:
|
2022-02-04 22:02:25 +00:00
|
|
|
- docker context create build
|
|
|
|
- docker buildx create build --use
|
2022-01-25 20:16:56 +00:00
|
|
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
|
|
script:
|
|
|
|
- |
|
|
|
|
docker buildx build \
|
|
|
|
--platform linux/amd64,linux/arm64 \
|
|
|
|
--build-arg CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH \
|
|
|
|
--build-arg CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA \
|
|
|
|
--build-arg CI_COMMIT_TAG=$CI_COMMIT_TAG \
|
|
|
|
--push \
|
|
|
|
--tag $CI_REGISTRY_IMAGE:latest \
|
|
|
|
.
|
|
|
|
only:
|
2022-01-27 15:50:14 +00:00
|
|
|
- main
|
|
|
|
|
2022-01-27 16:42:35 +00:00
|
|
|
pages:
|
2022-01-27 16:34:37 +00:00
|
|
|
stage: deploy
|
2022-01-27 16:25:26 +00:00
|
|
|
image: python:alpine
|
2022-01-27 15:50:14 +00:00
|
|
|
script:
|
2022-01-27 16:25:26 +00:00
|
|
|
- pip install --no-cache-dir -r mkdocs-req.txt
|
|
|
|
- python -m mkdocs build --strict --verbose
|
2022-01-27 15:50:14 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-01-27 16:34:37 +00:00
|
|
|
- public
|
2022-01-27 16:42:35 +00:00
|
|
|
rules:
|
2022-01-27 16:44:47 +00:00
|
|
|
- if: $CI_COMMIT_REF_NAME == "main"
|