last day (14 days later) » 

2:23 PM
1
A: How to auto deploy Docker Image on own server with GitLab?

vvelikodny What do I have to do to force docker compose on my VPS to pull the new image from Gitlab and restart the server? @m-uu, you don't need restart the server at all, just do docker-compose up to pull new image and restart service I know (correct me if I am wrong) that on my VPS I should run...

 
M U
1. Where you configure SSH_PRIVATE_KEY, IP etc for your VPS?
 
@MU on gitlab <Project> - Settings - CI/CD Pipelines and Secret Variables part
 
M U
Thanks. Could you elaborate more what is going on in the deploy script? I can try to understand parts, but would prefer to know what happens in each line.
 
@MU well, I've added more info to post and also commented most interesting lines in my configuration file. It should be enough to run your own setup. Don't hesitate read Gitlab docs for more info)))
 
M U
So nice, thank you! Last thing (sorry!) - how to specify my container from GitLab in Docker Compose yml ? I have to use my container from GitLab + MySQL
FAIL: $ echo "$SSH_PRIVATE_KEY" > ~/key && chmod 600 ~/key $ ssh-add ~/key Enter passphrase for /root/key: ERROR: Job failed: exit code 1
 
2:23 PM
@MU generate ssh keys without password thegeekstuff.com/2008/11/…
@MU in docker compose you should set image like -> image: registry.gitlab.com/<group>/<project>/image, you can see image path on gitlab.com -> "Registry" page of the project
 
M U
Hi
Can we discuss here?
I have created the key without password..
but it still fails with this error
should I include
-----BEGIN RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
and paste only the string between into the variable
OR paste only
at the moment, I have only the RSA string in variable, no begin/end
are you sure that SSH_PRIVATE_KEY should be in quotes?
echo $SSH_PRIVATE_KEY works fine and shows the key
 
M U
2:41 PM
I have generated key again, for sure without password
copied the "ssh-rsa ...."
and still the same issue
 
 
3 hours later…
5:27 PM
Have you added public key on server?
 

last day (14 days later) »