forked from bfansports/CloudTranscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
31 lines (26 loc) · 872 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
image: docker:latest
variables:
BUILD_DATE: "`date +%Y-%m-%dT%H:%M:%SZ`"
PIPELINE_ID: "$CI_PIPELINE_ID"
VCS_REF: "$CI_COMMIT_SHA"
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- git submodule init
- git submodule update
build:
stage: build
script:
- docker build --pull --build-arg BUILD_DATE="${BUILD_DATE}" --build-arg PIPELINE_ID="${PIPELINE_ID}" --build-arg VCS_REF="${VCS_REF}" -t $CI_REGISTRY_IMAGE .
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE:develop
- docker push $CI_REGISTRY_IMAGE:develop
only:
- develop
build-latest:
stage: build
script:
- docker build --pull --build-arg BUILD_DATE="${BUILD_DATE}" --build-arg PIPELINE_ID="${PIPELINE_ID}" --build-arg VCS_REF="${VCS_REF}" -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
only:
- master