build yaml
This commit is contained in:
parent
928b28845b
commit
bef7f44a1d
2 changed files with 12 additions and 5 deletions
|
@ -21,14 +21,14 @@ build_image:
|
|||
services:
|
||||
- docker
|
||||
variables:
|
||||
CONTAINER_NAME: ${CI_REGISTRY_IMAGE}/facturio
|
||||
COMPOSE_FILE: docker-compose.build.yml
|
||||
before_script:
|
||||
- docker login ${CI_REGISTRY} -u gitlab-ci-token -p ${CI_JOB_TOKEN}
|
||||
script:
|
||||
- docker build -t ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} .
|
||||
- docker push ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME}
|
||||
- docker compose build
|
||||
- docker compose push
|
||||
- |
|
||||
if [[ -n "${CI_COMMIT_TAG}" ]]; then
|
||||
docker tag ${CONTAINER_NAME}:${CI_COMMIT_REF_NAME} ${CONTAINER_NAME}:${CI_COMMIT_TAG}
|
||||
docker push ${CONTAINER_NAME}:${CI_COMMIT_TAG}
|
||||
docker tag ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME} ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG}
|
||||
docker push ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_TAG}
|
||||
fi
|
||||
|
|
7
docker-compose.build.yml
Normal file
7
docker-compose.build.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
services:
|
||||
api:
|
||||
image: ${CI_REGISTRY_IMAGE}/facturio:${CI_COMMIT_REF_NAME}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
target: production
|
Reference in a new issue