Docker Image not deployed to Server

54 views Asked by At

I'm new to gitlab and docker deployment.

I want to deploy to server.

I've got 2 stages, build and deploy.

Both of them seem to be working fine (according to the logs).

My problem is, that my code changes are not deployed to the server, eventhough it says deploy successful.

I would appreciate any advice. Thanks in advance!

build1:
  stage: build
  services:
    - name: docker:dind
      alias: docker
      command:
        - "--tls=false"
  variables:
    # setup for client and deamon, they can communicate with each other
    # DOCKER_HOST: tcp://docker:2375
    DOCKER_TLS_CERTDIR: ""
  script:
    #- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN <dev.server>:<port>
    # - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN git.cg-dev.de:5050
    - docker-compose build
    - docker login -u $REGISTRY_USER -p $REGISTRY_PASS <gitlab-url>:<port>
    - docker-compose push
  tags:
    - builder1
  only:
    - master

# master-section deploy
deploy1:
  stage: deploy
  image: ubuntu:latest
  before_script:
    - apt-get update
    - apt-get install -y curl
    # - apt-get update
    # - curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
    # - chmod +x /usr/local/bin/docker-compose
  script:
    - curl <deployfile_from_server>
    # - service docker start
    # - docker-compose pull
    # - docker-compose up -d
    - rm -r ./*
    - rm -r .e*
    - rm -r .g*
    - rm -r .d*
  tags:
    - builder1
  only:
    - master

0

There are 0 answers