All our deployment tools in a single container.
1.9K
GitLab-CI now uses Docker containers for running jobs. Our deploy scripts have been migrated to a Docker container to simplify management of the scripts.
Every script in the bin directory of this repo is accessible within the container without needing any configuration on your end. Just call them like normal binaries.
To configure deployment, you'll need to set up deployment keys in both GitLab and in the user's authorized_keys on the remote server.
First, enable CI service for the repo in GitLab-CI if you haven't yet. Go to https://git.c4tech.com/ci, find your repo, and enable it.
Next, add the private SSH key to the secret variables. In GitLab-CI, go to your project and click on the variables menu item on the left. The example .gitlab-ci.yml file expects the variable to be named SSH_KEY and have a value of the private SSH key. You can use the id_rsa provided in this repo or your own custom key:
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAw2dV9LziWOofT+6vkQFya1M8ubCBbdptEQYjzSiUhZYLhq8G
eck0t5BeUMLi4GhAQjPG2ey2vhoBfKYp8yZYL8g15adPO+ckEd4kLTK79jkoGIc9
Fct2IcGfevz86W3z+q0rQ0BXSEVOskcbnY689vj3pLu5SV8PlUl58PvdXO/idovG
YA5O1jkDOhp99ttQf8CRpVVnf/eX12VCwnkosVj++c3STdzKuASu7XjqvMJUCRyp
FmugCcMkHvkwQZHD5XSEjhtx9nqf1E0Hou8EVSQiiJPo4kkGUSUwNeUVOV4K/cbC
Akw1UWhtzqz3CWtibxHL6b+NZahfyleiIZoBLQIDAQABAoIBAHggtSVKYdTLygg3
8tMwkokMmQ6HRmqkl9yZa7Uat4QQpHFedJq2aaRYKsN3rEbNkIOilSMwdYAVOMjK
1otXDWwCp6/R1dI73V7mtFLdF9TdeprpuVIGzU8fW84ebdWL9Sws/aXQjlgt052i
PYX1VJJ4qLYrelNzD391tnPCQ2p4NBEq4e9CQpWMf5LkCe3H9xQztSbofFAMi6kb
lPoHYNrGGvJ5C74uZqVxRLQlQxiQDpYYm+COLBTqzFp0rjn6L9cn2nei/8+1QdXX
7c42FnMJa+EZlSaYxlM05vQTaWNUV37kAz5hAS0Tw0DdYvwcdNIM2s5LM+7HvVbB
+DaWjXkCgYEA5+EwK24KpHmTidIoO6X7m2/76hNlV3ygCArB/emae4g4bcVE/gng
EmuygNDGho6GiC9To3XmPuzSfwCrwY8os9V/CP1h0XjG4Wsst6XP+rfaE+ErQYI6
lcX1UkzOAjztzDfK9v1jhRgFo4GjOlcdkAH7y9Iwsa/spI4s229NGOcCgYEA17rQ
iTrNwnuOyJe3uK2alW4/BdIGnHuAjyQI2ud0yfFo6jUbPDIHsbqp+lTNYz3H2uiY
U1qJ2TVLoBC8kjLSHq45gqJXcw5PlVGxxNlzcGN047+1rLLcgSpr5dWBRvgh2FpT
XLMemRUmWXn7UIsDyvAea5Sg+mzHj8iebJ6cbssCgYBRkm+Op6yIxdg4QL00lqSX
vuJhKyeYilgF3Dr4ZwiYcohfXWly8OhpsodeN5PPXC5JlFSZCW3RLyCx2vuRIRqR
gQaqk/CobxOP01Ms2+D5c1n9alX8OqL/c19k7239bY++KtZ04xjyhkvdhEp2yJS2
x2vb/PpyV9Ao53cyTspRewKBgFzFSp5o+kkTR2C91dUGWv69zT5chllOxwdHUMOK
W2/ob9yf/9lQDn0Ar84mH7j4vXRHKBJYUgVlZOMtr1oTnsZw1+x0kbS5x8GHwzHK
7Vi8fGzgaWkd9bNaIdJRkWmKlUtr9INdx9++96Hs0gVd8sCXqA1NejiXBO6xMGe3
gcAnAoGAcYbUqAguiDsQ0PNOJZNabP4mvkoMJiqMmE+6BJLtM67mHG5Dm2rKnFe2
qwiOgSxHXWSlCujBcpFz7i9jduxNPg4/QBshfosWeabo5We0D/PLl1tDeD288UrA
qWUznlVZsbYCAQ+g4BTQq1oyTjg5atuMJvJaobrQl2dEiE4+s3E=
-----END RSA PRIVATE KEY-----
Third, you'll need to add the public key to the destination user/server's ~/.sssh/authorized_keys file. Again, you can use the id_rsa.pub provided in this repo:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDZ1X0vOJY6h9P7q+RAXJrUzy5sIFt2m0RBiPNKJSFlguGrwZ5yTS3kF5QwuLgaEBCM8bZ7La+GgF8pinzJlgvyDXlp0875yQR3iQtMrv2OSgYhz0Vy3YhwZ96/PzpbfP6rStDQFdIRU6yRxudjrz2+Peku7lJXw+VSXnw+91c7+J2i8ZgDk7WOQM6Gn3221B/wJGlVWd/95fXZULCeSixWP75zdJN3Mq4BK7teOq8wlQJHKkWa6AJwyQe+TBBkcPldISOG3H2ep/UTQei7wRVJCKIk+jiSQZRJTA15RU5Xgr9xsICTDVRaG3OrPcJa2JvEcvpv41lqF/KV6IhmgEt [email protected]
Lastly, you need to add a .gitlab-ci.yml file to your repo and push it up. An example .gitlab-ci.yml is provided here in this repo. You will certainly need to adjust the scripts for each of the three deploy jobs. You should also remove the deploy.sh file from your repo, as it is no longer used.
Most of the deploy scripts use a standard template of deploy-{hostname} (e.g. deploy-redemma). Please read the source of those scripts for how to use them.
In general, the deploy script you use will take a shortened docroot as the first parameter and which post-deploy scripts (if any) to execute.
Content type
Image
Digest
sha256:e209aec5f…
Size
93.4 MB
Last updated
over 8 years ago
docker pull c4tech/deploy