Use GitHub actions to generate the pre-compiled zip file for the hook. Users can then upload the zip file to S3 and use it as the schema handler package input when registering the hook in their account.
Solves https://github.com/StyraInc/opa-aws-cloudformation-hook/issues/40:
For users who do not have Docker Desktop installed locally due to licensing issues, the cfn submit command cannot be run with the default Docker flow. Disabling the Docker option in the hook configuration and building the zip file on a non-Linux system results in Lambda function errors. By running the cfn submit --dry-run command on an Ubuntu GitHub runner with Docker installed, we can ensure the hook package is correctly generated to run in Lambda.
Changes
Remove .zip from gitignore
Add GitHub workflow to run after OPA Tests complete on push to generate the hook zip file
Further Thoughts
Saving the zip file directly to the repo is not ideal, as it is nearly 90MB. We should instead move this process to use GitHub releases, however this solves an immediate pain point for non-Linux users without Docker Desktop.
Description
Use GitHub actions to generate the pre-compiled zip file for the hook. Users can then upload the zip file to S3 and use it as the schema handler package input when registering the hook in their account.
Solves https://github.com/StyraInc/opa-aws-cloudformation-hook/issues/40: For users who do not have Docker Desktop installed locally due to licensing issues, the
cfn submit
command cannot be run with the default Docker flow. Disabling the Docker option in the hook configuration and building the zip file on a non-Linux system results in Lambda function errors. By running thecfn submit --dry-run
command on an Ubuntu GitHub runner with Docker installed, we can ensure the hook package is correctly generated to run in Lambda.Changes
Further Thoughts
Saving the zip file directly to the repo is not ideal, as it is nearly 90MB. We should instead move this process to use GitHub releases, however this solves an immediate pain point for non-Linux users without Docker Desktop.