This repository is a CloudOps Works Rust application template. It gives you:
- a minimal Actix Web HTTP service scaffold
- CloudOps Works CI/CD wiring under
.cloudopsworks/ - GitHub Actions workflows for build, scan, preview, release, and deployment
- deployment templates for Kubernetes, Lambda, Elastic Beanstalk, App Engine, and Cloud Run
- sample API definition placeholders under
apifiles/
Use this template when you want a new Rust service that already follows the CloudOps Works delivery model.
Cargo.toml— crate metadata, dependencies, and binary namesrc/main.rs— Actix Web process entrypoint and server bootstrapsrc/lib.rs— library exports for routes and handlerssrc/routes.rs— route registrationsrc/handlers/— samplehelloandhealthhandlerstests/integration_tests.rs— smoke coverage for the sample endpointsapifiles/— API definition placeholders and examples
.cloudopsworks/cloudopsworks-ci.yaml— repository governance and environment mapping.cloudopsworks/vars/inputs-global.yaml— global build/deploy defaults.cloudopsworks/vars/inputs-*.yaml— target-specific environment templates.cloudopsworks/gitversion_gitflow.yaml— reference GitVersion config aligned with the template's default GitFlow release model.cloudopsworks/gitversion_githubflow.yaml— optional GitVersion reference for teams that explicitly rewire workflows away from GitFlow.github/workflows/— reusable CI/CD orchestrationMakefile— bootstrap/version targets used by template consumers
Create your new repository from cloudopsworks/rust-app-template, then clone it locally.
Run the bootstrap target from the root of the new repository:
make code/initThis target:
- updates
Cargo.tomlpackage name to the current directory name - updates the first binary name in
Cargo.toml - rewrites Rust crate references from
hello_api::to your repository name converted to snake case
Rename the repository directory before running
make code/initif you want the crate and binary names to match the final service name.
At minimum, review and update:
Cargo.tomlsrc/main.rssrc/routes.rssrc/handlers/tests/integration_tests.rsapifiles/
The template starts with two working endpoints so the pipeline has a healthy baseline:
GET /->Hello, world!GET /health->{ "status": "OK" }
cargo test
make versionmake version writes a VERSION file using GitVersion semantics and then synchronizes the crate version in Cargo.toml with that computed version.
cargo runBy default the service binds to 127.0.0.1:8080.
Environment variables:
HOST— optional bind host, defaults to127.0.0.1PORT— optional bind port, defaults to8080
This file controls repository behavior and deployment routing.
Update these sections first:
branchProtection— enable branch protection automationgitFlow.enabled— keeptrueif you use GitFlow branch conventionsgitFlow.supportBranches— enable only if you maintain long-lived support branchesrequiredReviewers,reviewers,owners,contributors— repository governance
This maps branch/tag flows to deployment environments.
Default mapping in this template:
develop->devrelease/**->prod- internal
teststage ->uat - prerelease tags ->
demo hotfix->hotfix- optional
supportmappings by version match
Adjust these names to match your environments and promotion flow.
This is the main global configuration file used by the workflows.
Set these values before your first pipeline run:
organization_nameorganization_unitenvironment_namerepository_ownercloudcloud_type
Use cloud: none and cloud_type: none only for repositories that should build and scan without deployment.
Common optional sections:
rust— Rust toolchain version, optional components, target dist/arch, and build image variantpreview— PR preview environment behaviorapis— API Gateway publishingobservability— tracing and monitoring agent configurationsnyk,semgrep,trivy,sonarqube,dependencyTrack— security and quality toolingdocker_inline,docker_args,custom_run_command,custom_usergroup— container customizationis_ooss— mark the generated repository as open source when needed
Each active environment should have exactly one matching deployment-target file under .cloudopsworks/vars/. Files that contain ENV in the name are placeholders: copy or rename them for each real environment as part of repository setup.
Use inputs-KUBERNETES-ENV.yaml.
Key fields:
container_registrycluster_namenamespace- target-cloud credentials/settings
- optional Helm, secret, and external-secret overrides
Use inputs-LAMBDA-ENV.yaml.
Key fields:
versions_bucketaws.region- Lambda runtime/handler settings
- IAM, VPC, and trigger configuration
Use inputs-BEANSTALK-ENV.yaml.
Key fields:
versions_bucketcontainer_registryaws.region- Beanstalk platform, instance, port, and extra settings
Use this file as a starting point only: review the Beanstalk platform defaults carefully and replace them with the runtime strategy your Rust service actually uses.
runner_set is optional and only needed when you use self-hosted runners.
Use inputs-APPENGINE.yaml.
Key fields:
versions_bucketcontainer_registrygcp.regiongcp.project_idappengine.runtime— usecustomfor Rust App Engine deploymentsappengine.type— useflexiblefor Rust custom runtimesappengine.entrypoint_shell— startup command App Engine should execute, for example./your-service-binary
For Rust services on App Engine, prefer the flexible environment with a custom runtime.
Use inputs-CLOUDRUN.yaml.
Key fields:
versions_bucketcontainer_registrygcp.regiongcp.project_idcloudrun.type
Preview environments are configured from:
.cloudopsworks/vars/preview/inputs.yaml.cloudopsworks/vars/preview/values.yaml
Enable them in inputs-global.yaml:
preview:
enabled: trueUse preview environments when pull requests from feature/** or hotfix/** should deploy an isolated review environment.
Important workflows in this template:
main-build.yml— build, test, containerize, scan, and release/deploy on branch/tag eventspr-build.yml— PR validation and optional preview deploymentdeploy-container.yml— push application container artifactsdeploy.yml— standard deployment flowdeploy-blue-green.yml— blue/green deployment flowscan.yml— SAST/SCA/DAST orchestrationenvironment-unlock.yml/environment-destroy.yml— environment operationsautomerge.yml, slash-command workflows, Jira integration workflows — repo automation
This template also includes dedicated GitVersion reference files for both GitFlow and GitHub Flow release models. The default repository behavior remains GitFlow. Treat the GitHub Flow file as reference-only unless you also update workflow triggers, deployment mapping, and branch policy to match it. If your generated repository wants to use one of these files directly, wire it explicitly in your generator or build logic rather than assuming automatic selection.
The workflows expect GitHub repository or organization configuration for build, preview, and deploy credentials.
Typical examples:
BOT_TOKENBUILD_AWS_ACCESS_KEY_ID/BUILD_AWS_SECRET_ACCESS_KEYDEPLOYMENT_AWS_ACCESS_KEY_ID/DEPLOYMENT_AWS_SECRET_ACCESS_KEYBUILD_GCP_CREDENTIALS/DEPLOYMENT_GCP_CREDENTIALSBUILD_AZURE_SERVICE_ID/BUILD_AZURE_SERVICE_SECRETDEPLOYMENT_AZURE_SERVICE_ID/DEPLOYMENT_AZURE_SERVICE_SECRET- runner, registry, region, and state configuration variables
Review the with: and secrets: blocks in the workflow files and align your repository settings before enabling deployments.
This template repository follows semantic versioning.
- documentation/template-only fixes -> patch release
- backward-compatible template capability additions -> minor release
- breaking workflow or template contract changes -> major release
Version calculation is GitVersion-based, and release automation relies on commit/PR annotations such as:
+semver: patch+semver: fix+semver: minor+semver: feature+semver: major+semver: hotfix
If you use the CloudOps Works release workflow, keep changes grouped by release intent so the generated version bump stays predictable.
- Create repo from template
- Run
make code/init - Rename/update the sample Actix handlers and routes
- Review crate metadata and dependencies in
Cargo.toml - Update
.cloudopsworks/cloudopsworks-ci.yaml - Update
.cloudopsworks/vars/inputs-global.yaml - Configure exactly one target file per active environment
- Configure preview settings if needed
- Add required GitHub secrets and variables
- Run
cargo test - Open a PR and verify
pr-build.yml - Merge and verify the first environment deployment
.omx/,.claude/,.opencode/, and similar agent/tooling directories are intentionally ignored and are not part of the application template contract.- The template is designed for CloudOps Works blueprint-backed automation; if you remove that integration, also prune the related workflows and
.cloudopsworks/configuration.