feat: add GitLab CI pipeline for muyu service Docker build
Build 3 muyu services (gateway, system-rpc, inventory-rpc) as Docker images and push to Harbor registry. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
7acdc6eecf
commit
0bb44305a1
45
.gitlab-ci.yml
Normal file
45
.gitlab-ci.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
|
||||||
|
variables:
|
||||||
|
HARBOR_REGISTRY: harbor-in-k3s.cheverjohn.me
|
||||||
|
HARBOR_PROJECT: iloom
|
||||||
|
DOCKER_TLS_CERTDIR: "/certs"
|
||||||
|
|
||||||
|
.build-template: &build-template
|
||||||
|
stage: build
|
||||||
|
image: docker:27
|
||||||
|
services:
|
||||||
|
- docker:27-dind
|
||||||
|
before_script:
|
||||||
|
- echo "$HARBOR_PASSWORD" | docker login $HARBOR_REGISTRY -u "$HARBOR_USER" --password-stdin
|
||||||
|
script:
|
||||||
|
- |
|
||||||
|
if [ -n "$CI_COMMIT_TAG" ]; then
|
||||||
|
TAG="$CI_COMMIT_TAG"
|
||||||
|
else
|
||||||
|
TAG="main-${CI_COMMIT_SHORT_SHA}"
|
||||||
|
fi
|
||||||
|
- docker build -t $HARBOR_REGISTRY/$HARBOR_PROJECT/$IMAGE_NAME:$TAG -f $DOCKERFILE_PATH .
|
||||||
|
- docker push $HARBOR_REGISTRY/$HARBOR_PROJECT/$IMAGE_NAME:$TAG
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
|
- if: $CI_COMMIT_TAG =~ /^v/
|
||||||
|
|
||||||
|
build-muyu-gateway:
|
||||||
|
<<: *build-template
|
||||||
|
variables:
|
||||||
|
IMAGE_NAME: muyu-gateway
|
||||||
|
DOCKERFILE_PATH: deploy/Dockerfile.gateway
|
||||||
|
|
||||||
|
build-muyu-system-rpc:
|
||||||
|
<<: *build-template
|
||||||
|
variables:
|
||||||
|
IMAGE_NAME: muyu-system-rpc
|
||||||
|
DOCKERFILE_PATH: deploy/Dockerfile.system
|
||||||
|
|
||||||
|
build-muyu-inventory-rpc:
|
||||||
|
<<: *build-template
|
||||||
|
variables:
|
||||||
|
IMAGE_NAME: muyu-inventory-rpc
|
||||||
|
DOCKERFILE_PATH: deploy/Dockerfile.inventory
|
||||||
Loading…
x
Reference in New Issue
Block a user