Read about it:
- Gitlab Runner - how to set up
- a pair of SSH keys
- Debian based target server
- Create following Gitlab repo variables:
- DEPLOY_SSH_KEY → private SSH key
- DEPLOY_SSH_ID → known_hosts entry for your server;
<ip> <pubkey>
- DEPLOY_HOST → target server IP
- Copy and run
prep.sh
on your target CI/CD server. Paste in your public SSH key when prompted, or leave empty and copy it manually. - Put contents of project directory into the root folder of your repo.
- Configure variables and package installation paths in the Variables section of
makedeb.sh
: Should your package have several install paths, write commands to create these paths and copy files to them. If the pre/post install/upgrade scripts will refer to these paths, make sure to modify them accordingly: - Modify the fpm command, mainly the dependencies (
-d
) and which folders to install to (opt
): - Modify or add package state change scripts (
before-install, after-install, before-remove...
) - Commit and push changes, which should automatically start a CI/CD pipeline.