-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
20 lines (17 loc) · 958 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
image: docker
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
build:
stage: build
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG --tag $CI_REGISTRY_IMAGE:latest .
- test -n "$CI_COMMIT_TAG" && docker tag $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
- docker push $CI_REGISTRY_IMAGE
- docker run --name $CI_COMMIT_SHORT_SHA -d $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
- mkdir -p build
- docker cp $CI_COMMIT_SHORT_SHA:/build/'*' build/
- docker kill $CI_COMMIT_SHORT_SHA
artifacts:
paths:
- build/*.deb