Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.53 KiB
services:
  - docker:19.03.12-dind

stages:
    - build
    - deploy

build_image:
  stage: build
  image: docker:19.03.12
  variables:
    # When using dind service, you must instruct docker to talk with the
    # daemon started inside of the service. The daemon is available with
    # a network connection instead of the default /var/run/docker.sock socket.
    #
    # The 'docker' hostname is the alias of the service container as described at
    # https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services
    #
    # If you're using GitLab Runner 12.7 or earlier with the Kubernetes executor and Kubernetes 1.6 or earlier,
    # the variable must be set to tcp://localhost:2375 because of how the
    # Kubernetes executor connects services to the job container
    # DOCKER_HOST: tcp://localhost:2375
    #
    # DOCKER_HOST: tcp://docker:2375
    #
    # This instructs Docker not to start over TLS.
    DOCKER_TLS_CERTDIR: ""

  
  script:
    - docker login baltig.infn.it:4567 -u amichelo -p ${DOCKER_REGISTRY}
    - docker build --no-cache -f Dockerfile -t baltig.infn.it:4567/lnf-da-control/memcached2influx .
    - docker push baltig.infn.it:4567/lnf-da-control/memcached2influx

deploy_dafne:
   stage: deploy
   tags:
    - lnf
   image:
     name: bitnami/kubectl:latest
     entrypoint: [""]
   script:
    - echo "${KUBE}" > config.txt
    - kubectl --kubeconfig config.txt get pods
    - kubectl delete -f memcached2influx-pod.yaml
    - kubectl add -f memcached2influx-pod.yaml
    - sleep 60
    - kubectl get pods