.gitlab-ci.yml 563 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# Base runtime
image: docker:latest
# Docker as a service
services:
    - docker:dind
# Stages declaration (add names as required)
stages:
    - pack

# Pack stage (docker build)
pack:
12 13
    variables:
        IMAGE_TAG: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
14 15 16 17 18
    stage: pack
    script:
        # Login to the registry. the variable is automatically set, build and push
        - TS=$(date +%Y%m%d%H%M)
        - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
19 20
        - docker build --no-cache -t $IMAGE_TAG .
        - docker push $IMAGE_TAG