diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index efa19451031f4bc455d74ce80cbe9b0b37b899b7..00e6a260553a81dcdab69d7a07d182916b454efa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,27 @@ -build-job: - stage: build - script: - - echo "Hello, $GITLAB_USER_LOGIN!" +image: docker:19.03.0 -test-job1: - stage: test - script: - - echo "This job tests something" +services: + - docker:19.03.0-dind -test-job2: - stage: test - script: - - echo "This job tests something, but takes more time than test-job1." - - echo "After the echo commands complete, it runs the sleep command for 20 seconds" - - echo "which simulates a test that runs 20 seconds longer than test-job1" - - sleep 20 +variables: + DOCKER_DRIVER: overlay -deploy-prod: - stage: deploy +stages: + - build + +before_script: + - docker info + +docker_build: + stage: build script: - - echo "This job deploys something from the $CI_COMMIT_BRANCH branch." + - apk add --no-cache curl + - docker login -u _ -p $HEROKU_TOKEN registry.heroku.com + - docker pull registry.heroku.com/secfit-group15/web || true + - docker build + --cache-from registry.heroku.com/secfit-group15/web + --tag registry.heroku.com/secfit-group15/web + --file ./Dockerfile + "." + - docker push registry.heroku.com/secfit-group15/web +