The contained Github configuration file (.github/workflows/generate-project.yml) is a simple, yet powerful way to leverage Harbormaster and GitHub to automate the generation of an SME quality project committed to a GitHub Repository and built, tested and optionally contained using GitHub Action.
This repository also contains sample Harbormaster project generation YAML files. These instructions will reference the Django project file (django-project-as-code.yaml) but there are others.
Harbormaster is a model-driven platform, and therefore you will need a model representation of you domain. You can learn more about this here.
If you do not have a model yet and want to take a quick test drive, follow the instructions in the Quick Start section. If you want to use your own model, skip to the Step-By-Step section to generate an application using more customized inputs.
Use this section to make the least amount of changes to see Harbormaster project generation in action.
1.) Git Clone this project in one of two ways:
SSH - git@github.com:Harbormaster-AI/github-action.git
HTTPS - https://github.com/Harbormaster-AI/github-action.git
2.) Edit the git section of /samples/yamls/project.as.code/django-project-as-code.yml to set your GitHub username. Leave the password blank because you already assigned a Personal Token and applied it to your account at platform.harbormaster.ai
3.) Create a GitHub repository by the name of django_repo (any name will work).
4.) Commit your changes to this project to the django_repo and observe the GitHub Action status.
6.) Once the action is complete, check its status. A project will have been generated using a default model and a Django tech stack.
The project will eventually be built and tested with results as below:
Clone this project in one of two ways:
SSH - git@github.com:Harbormaster-AI/github-action.git
HTTPS - https://github.com/Harbormaster-AI/github-action.git
It is important you register @ platform.harbormaster.ai (or a different instance of HM) in order to obtain an API token.
For security purposes, you should store is as a development environment secret within GitHub and refer to it here.
Visit here
HARBORMASTER__API__TOKEN
Learn more about assigning environment variables here
This YAML file contains the directives required to generate a project including:
- model identifier (by name, id or file_path)
- tech stack (by name or id),
- application options (name, description, author, etc..)
- GitHub repo settings,
- Docker settings
- and more....
See an example here
PROJECT_YAML_FILE: "samples/yamls/project.as.code/django-project-as-code.yml"
Modify the git: section of the a Project-As-Code YAML file (e.g. django-project-as-code.yml) to assign your GitHub credentials
Note: If using one of the AWS Lambda stacks, you will have to assign the access key and secret key as codebase level environment secrets. Visit here for more details. Be sure to name the accesskey USER_AWS_ACCESSKEY and name the secretkey USER_AWS_SECRETKEY. Equally important, make sure you have the correct policies assigned for the related user (AWSCodeDeployRoleForLambda, AWSLambdaExecute, AWSLambdaRole, etc..)
Create a GitHub project repository (Repo Demo) for the generated project files. This repository name must be the name you assigned in the GIT section of the PROJECT_YAML_FILE (e.g. django-project-as-code.yml).
Create another GitHub project repository (Repo Generate) and commit this project to it. Any name will do. You are committing the modified generate-project.yml file along with the PROJECT_YAML_FILE discussed above. Only the generate-project.yml must be in the .github/workflows directory.
Upon committing this project to Repo Generate, the generate-project.yml should begin running within GitHub Action for this repository. Your project is now being generated by Harbormaster.
Upon completion of Step 5, Harbormaster will commit all generated project files to Repo Demo. This should cause a GitHub Action to execute the generated .github/workflows/github-actions.yml file. The generated project is now being built and tested.
Using the power of GitHub and Harbormaster you just generated, built, tested, and (optionally) contained an entire application complete with core capabilities, build file, CI/CD config, and much more....
Best of luck in completing the application!

