kind: pipeline
type: docker
name: default

steps:
- name: test
  image: golang:1.17.1
  commands:
    - env
    - export IMAGE_TAG=${CI_BUILD_TAG:-${CI_BUILD_REF_NAME}-${CI_BUILD_REF:0:8}}
    - export DEPLOY_IMAGE=${DEPLOY_REGISTRY}/${DOCKER_NS}/sayam:${IMAGE_TAG}
    - docker build -t ${IMAGE} -f Dockerfile .
    - docker push ${IMAGE}
    - echo ${DEPLOY_IMAGE}
    - docker rmi ${IMAGE}