2024-03-18 12:26:08 +00:00
|
|
|
steps:
|
2024-03-16 14:33:04 +00:00
|
|
|
- name: build docker
|
|
|
|
image: docker:25-cli
|
2024-03-18 13:24:49 +00:00
|
|
|
secrets: [user, pass]
|
2024-03-16 14:33:04 +00:00
|
|
|
commands:
|
2024-03-16 14:48:38 +00:00
|
|
|
- apk add git
|
2024-03-16 14:52:25 +00:00
|
|
|
- REPO=$(echo "$CI_REPO" | tr '[:upper:]' '[:lower:]')
|
2024-03-18 12:37:51 +00:00
|
|
|
- REGISTRY="dev.cat-enby.club"
|
2024-03-18 12:34:44 +00:00
|
|
|
- MAJOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 1 | tr -d 'v')
|
2024-03-18 12:39:40 +00:00
|
|
|
- MINOR=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 2)
|
|
|
|
- PATCH=$(echo ${CI_COMMIT_TAG} | cut -d '.' -f 3)
|
2024-03-18 12:41:39 +00:00
|
|
|
- docker buildx build -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-0} -t $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR} -t $${REGISTRY}/$$REPO:v$${MAJOR:-0} -t $${REGISTRY}/$$REPO:latest .
|
2024-03-18 13:16:41 +00:00
|
|
|
- docker login --username $USER --password $PASS $${REGISTRY}
|
2024-03-18 12:53:05 +00:00
|
|
|
- docker push $${REGISTRY}/$${REPO}:v$${MAJOR:-0}.$${MINOR:-0}.$${PATCH-0}
|
2024-03-16 14:33:04 +00:00
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
when:
|
|
|
|
- repo: nikurasu:elk-test-ci
|
|
|
|
- event: tag
|