Skip to content
Snippets Groups Projects
Commit c28c269b authored by Fanna Lautenbach's avatar Fanna Lautenbach
Browse files

update with known_hosts file

parent cd25eee4
No related branches found
No related tags found
1 merge request!1Fix & update deploy template
...@@ -27,9 +27,10 @@ To make sure variables and the build+deploy job are not dependent, add the follo ...@@ -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. 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` 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`. 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!: 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!:
![](gitlab.vars.png) ![](gitlab-vars.png)
gitlab-vars.png

90.8 KiB

gitlab.vars.png

114 KiB

...@@ -40,6 +40,7 @@ docker-build: ...@@ -40,6 +40,7 @@ docker-build:
User $DEPLOY_USER User $DEPLOY_USER
StrictHostKeyChecking no StrictHostKeyChecking no
EOF EOF
- cp $KNOWN_HOSTS ~/.ssh/known_hosts
script: script:
- rsync -avz docker-compose.yml $DEPLOY_HOST:$SERVICE_DIR - rsync -avz docker-compose.yml $DEPLOY_HOST:$SERVICE_DIR
- rsync -avz $DOT_ENV $DEPLOY_HOST:$SERVICE_DIR/.env - rsync -avz $DOT_ENV $DEPLOY_HOST:$SERVICE_DIR/.env
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment