diff --git a/README.md b/README.md index 5bea1ec5364f80c8c7719d9413773858b0602f9e..0f3a2518b45854b5a6fc592543f089c65be055a0 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,10 @@ To make sure variables and the build+deploy job are not dependent, add the follo 1. Where the static files are stored like the docker-compose.yaml. 3. DEPLOY_USER: The user that has read, write, and execute permissions for your `SERVICE_DIR` 1. The private key `SSH_PRIVATE_KEY` for an ssh connection to your `DEPLOY_HOST`. + 2. The known hosts file `KNOWN_HOSTS` which ensures it deploys to the correct machines. - _Note: it's best to inherit the private key from the group settings or change this setup with [deploy tokens](https://git.astron.nl/help/user/project/deploy_tokens/index.md)_ + _Note: it's best to inherit the private key and known hosts file from the group settings or change this setup with [deploy tokens](https://git.astron.nl/help/user/project/deploy_tokens/index.md)_ 4. Add the environment variables that are used by your docker service **as a file** called `DOT_ENV` and don't forget to set your environment!: - + diff --git a/gitlab-vars.png b/gitlab-vars.png new file mode 100644 index 0000000000000000000000000000000000000000..5202e9ab43b3ff53ffc6817faea887971299ee6c Binary files /dev/null and b/gitlab-vars.png differ diff --git a/gitlab.vars.png b/gitlab.vars.png deleted file mode 100644 index 06baf911f1ac6716723816f16e147aee6d64daf6..0000000000000000000000000000000000000000 Binary files a/gitlab.vars.png and /dev/null differ diff --git a/template.gitlab-ci.yml b/template.gitlab-ci.yml index dd045ab091679b3bc929844ffb39933a49c94877..a9b09268ff7993326bec5920b74700f978ad11b7 100644 --- a/template.gitlab-ci.yml +++ b/template.gitlab-ci.yml @@ -40,6 +40,7 @@ docker-build: User $DEPLOY_USER StrictHostKeyChecking no EOF + - cp $KNOWN_HOSTS ~/.ssh/known_hosts script: - rsync -avz docker-compose.yml $DEPLOY_HOST:$SERVICE_DIR - rsync -avz $DOT_ENV $DEPLOY_HOST:$SERVICE_DIR/.env