image: docker services: - docker:dind stages: - build - deploy build: stage: build only: - master script: - echo "building branch $CI_COMMIT_REF_NAME, Version $version" - git config --global user.name "build" - git config --global user.email "noreply@jonasled.de" - sudo docker images prune -f - sudo docker pull python:3 - sudo docker build -t gitlab.jonasled.de/jonasled/discordbot - sudo docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - sudo docker push gitlab.jonasled.de/jonasled/discordbot deploy: stage: deploy only: - master script: - sudo apt-get install -y python-pip #install pip, this is needed to install docker-compose in the next step - sudo pip install docker-compose #Install docker-compose with pip - sudo docker-compose up -d #Start the new container environment: master