diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae7facc..cecafb2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,8 @@ stages: - build - test - release + - docker + - deploy cache: key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG" @@ -74,4 +76,38 @@ release: - 'dotnet publish -c Release --runtime linux-musl-x64 -o build' artifacts: paths: - - build/* \ No newline at end of file + - build/* + + +docker: + image: docker:stable + stage: docker + only: + changes: + - ChaosBot/**/* + refs: + - master + tags: + - docker + - hawkeye + dependencies: + - release + script: + - docker info + + +deploy: + stage: deploy + only: + changes: + - ChaosBot/**/* + refs: + - master + tags: + - docker + - hawkeye + dependencies: + - docker + script: + - 'apk add curl jq' + - 'curl -X POST $API_URI/api/endpoints/$ENDPOINT_URI/docker/containers/$CONTAINER_ID/restart -H "Authorization: Bearer `curl -X POST $API_URI/api/auth -H "Content-Type: application/json" -d "{\"Username\": \"$API_USER\", \"Password\": \"$API_PASS\"}"" | jq -r ".jwt"`"'