Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These enhancements pave the way for CI deployments via GitHub Actions by installing a self-hosted runner on our target servers. It makes the script for accomplishing that more concise by providing a
deploy
command that goes through the typical steps for deploying our apps.Enhancements to the GitHub Actions Runner installer
We already did the footwork of creating a script that helps automate the installation of a GitHub Actions runner. Now that we have real RedHat 9 servers, we were able to identify some necessary changes. For instance:
root
and run in privileged podman containers, thegithub
user that runs the runner service would need to have proper permissions. We don't want to assign more than it needs, so we gave it sudo permissions only for the deploy, docker, and git commands. We accomplish this by writing a separate file just for this purpose in/etc/sudoers.d/
.github
user.chcon
command is present, we know we're dealing with an SELinux system. We assign proper contexts so the service will work in SELinux.The deploy command
The
deploy
command is made to properly run in a Docker or Podman environment. So, its installation was added as part of the "Docker/Podman" installation step for every environment (currently CentOS, RHEL, and macOS). The command has a nice help screen (deploy --help
), but here is a brief description:It will go through these steps:
Some additional notes:
.env
, you can use--env-file
to specify the environment file.--non-interactive
flag skips the docker repository login step, which prompts the user for credentials. This can be used in CI scripts when we can't respond to user prompts.--upgrade
flag, will pull for fresh images even if it already has them, which benefits configurations that do something likemariadb:10
to always point to the latest of that version.systemctl
is not cognizant of newly-created services, and will gracefully handle the situation regardless of a docker, podman, or systemctl situation.Bringing it all together
The deployment command makes it so that deploying or redeploying a UIC Pharmacy app can be done from one command. This means that deployment CI workflows can be created that are very concise. A good first use case to demonstrate this is prior-auth-drug-search - deploy.yml.