Deployment system for the radio angrezi server.
We have a few custom services running on our services, custom in the sense that they are programmed from scratch and continually developed. This deployment-system allows us to test, ship new code, and restart the service automatically.
Our deployment-system is a set of custom bash-scripts which run on our server and are triggered from github, where we store our code.
The deployment is triggered at the end of a successfully run testing chain which is built with github actions.
In order to explain the deployment chain we will bring forth all the steps needed to deploy a new service with this system.
- 1.your sourcecode has its own repository within our github organization.
- 2.the repository is public
- 3.the repository has access to our self-hosted action runner. (please ask an organization-owner to grant this access)
In your repository go to tab Actions and setup the Deploy to Angrezi Servers workflow.
Click "Set up this workflow" and commit the new file
You dont need to change anything here but can add further steps to this workflow for example to build and test your application.
Have a look at other angrezi-services to better understand how we use github actions.
Our deployment expects a
.environmentfolder to be present in the root folder of your repository. This folder contains all files which are bound to angrezis server environment. Usually systemd-service files, other configuration and a deploy script are situated here.
Create a file
This file well be automatically called at the end of a successful github-action workflow. You have access to a few environment variables in your script:
# accessible var DEPLOY_DEST
# accessible var DEPLOY_FROM
Log in to server.radioangrezi.de and run
sudo setup-service [service-name]. this will copy all the environment-files into
/opt/services/[service-name]and symlink a few known configuration files automatically.
.service will be linked and enabled as a systemd service. .monit-conf will be linked as a monit config file.
You have to link all other configuration files manually.
Each time you make changes to files in
.environment/you have to call
setup-serviceagain for your changes to take effect. This is a security measure.