mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 23:09:35 +01:00
feat: Build Docker image in CI
This commit is contained in:
parent
a19bb9ff04
commit
9a51437ab0
@ -261,3 +261,46 @@ release:
|
|||||||
--assets-link "{\"name\":\"fluffychat-linux-arm64.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-linux-arm64.tar.gz\"}" \
|
--assets-link "{\"name\":\"fluffychat-linux-arm64.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-linux-arm64.tar.gz\"}" \
|
||||||
--assets-link "{\"name\":\"fluffychat-windows.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-windows.zip\"}" \
|
--assets-link "{\"name\":\"fluffychat-windows.zip\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-windows.zip\"}" \
|
||||||
--assets-link "{\"name\":\"fluffychat-web.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-web.tar.gz\"}"
|
--assets-link "{\"name\":\"fluffychat-web.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/fluffychat-web.tar.gz\"}"
|
||||||
|
|
||||||
|
.docker: &docker_template
|
||||||
|
image: docker:latest
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
- famedly
|
||||||
|
stage: deploy
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
|
docker-releases:
|
||||||
|
<<: *docker_template
|
||||||
|
script:
|
||||||
|
- docker build --pull -t "${CI_REGISTRY_IMAGE}:latest" -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}" .
|
||||||
|
- docker push "${CI_REGISTRY_IMAGE}:latest"
|
||||||
|
- docker push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/'
|
||||||
|
before_script:
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
|
||||||
|
docker-tags:
|
||||||
|
<<: *docker_template
|
||||||
|
script:
|
||||||
|
- docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}" .
|
||||||
|
- docker push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /^v\d+\.\d+\.\d+$/'
|
||||||
|
before_script:
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
|
||||||
|
docker-branches:
|
||||||
|
<<: *docker_template
|
||||||
|
script:
|
||||||
|
- docker build --pull -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}" -t "${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}" .
|
||||||
|
- docker push "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_SLUG}"
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG == null
|
||||||
|
before_script:
|
||||||
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user