2021-03-02 12:16:19 +00:00
|
|
|
docker:
|
|
|
|
variables:
|
|
|
|
VERSION: latest
|
|
|
|
DOCKER_HOST: tcp://docker:2375
|
|
|
|
|
2023-01-30 11:54:16 +00:00
|
|
|
stage: build
|
|
|
|
|
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
before_script:
|
2023-01-30 11:54:16 +00:00
|
|
|
- docker info && docker version
|
|
|
|
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
|
|
|
|
- if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > auth.json; fi
|
2021-03-02 12:16:19 +00:00
|
|
|
|
|
|
|
script:
|
2023-01-30 11:54:16 +00:00
|
|
|
- if [ -f init ]; then chmod 500 init; fi
|
|
|
|
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION
|
2023-03-25 13:16:42 +00:00
|
|
|
- rm -rf node_modules database/seeds database/schema database/factories/*
|
2023-01-30 11:54:16 +00:00
|
|
|
- docker build -f docker/Dockerfile -t ${CI_REGISTRY_IMAGE}:${VERSION} .
|
|
|
|
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
|
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
- x86_64
|
|
|
|
only:
|
|
|
|
- BRANCH-2.0
|