Skip to content

Commit

Permalink
Merge pull request Wandalen#1180 from Wandalen/templating-and-deploy
Browse files Browse the repository at this point in the history
READY : Forward from templating-and-deploy to alpha
  • Loading branch information
Wandalen authored Mar 8, 2024
2 parents 6a854bc + 2da5823 commit 1343120
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 24 deletions.
46 changes: 23 additions & 23 deletions module/move/willbe/src/action/deploy_renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,29 @@ mod private
// /key
.file().data( include_str!( "../../template/deploy/key/pack.sh" ) ).path( "./key/pack.sh" ).end()
.file().data( include_str!( "../../template/deploy/key/Readme.md" ) ).path( "./key/Readme.md" ).end()
// /terraform/
.file().data( include_str!( "../../template/deploy/terraform/Dockerfile" ) ).path( "./terraform/Dockerfile" ).end()
.file().data( include_str!( "../../template/deploy/terraform/Readme.md" ) ).path( "./terraform/Readme.md" ).end()
// /terraform/gar
.file().data( include_str!( "../../template/deploy/terraform/gar/Readme.md" ) ).path( "./terraform/gar/Readme.md" ).end()
.file().data( include_str!( "../../template/deploy/terraform/gar/main.tf" ) ).path( "./terraform/gar/main.tf" ).end()
.file().data( include_str!( "../../template/deploy/terraform/gar/outputs.tf" ) ).path( "./terraform/gar/outputs.tf" ).end()
.file().data( include_str!( "../../template/deploy/terraform/gar/variables.tf" ) ).path( "./terraform/gar/variables.tf" ).end()
// /terraform/gce
.file().data( include_str!( "../../template/deploy/terraform/gce/Readme.md" ) ).path( "./terraform/gce/Readme.md" ).end()
.file().data( include_str!( "../../template/deploy/terraform/gce/main.tf" ) ).path( "./terraform/gce/main.tf" ).end()
.file().data( include_str!( "../../template/deploy/terraform/gce/outputs.tf" ) ).path( "./terraform/gce/outputs.tf" ).end()
.file().data( include_str!( "../../template/deploy/terraform/gce/variables.tf" ) ).path( "./terraform/gce/variables.tf" ).end()
// /terraform/gce/templates
.file().data( include_str!( "../../template/deploy/terraform/gce/templates/cloud-init.tpl" ) ).path( "./terraform/gce/templates/cloud-init.tpl" ).end()
// /terraform/gcs
.file().data( include_str!( "../../template/deploy/terraform/gcs/main.tf" ) ).path( "./terraform/gcs/main.tf" ).end()
// /terraform/hetzner
.file().data( include_str!( "../../template/deploy/terraform/hetzner/main.tf" ) ).path( "./terraform/hetzner/main.tf" ).end()
.file().data( include_str!( "../../template/deploy/terraform/hetzner/outputs.tf" ) ).path( "./terraform/hetzner/outputs.tf" ).end()
.file().data( include_str!( "../../template/deploy/terraform/hetzner/variables.tf" ) ).path( "./terraform/hetzner/variables.tf" ).end()
// /terraform/hetzner/templates
.file().data( include_str!( "../../template/deploy/terraform/hetzner/templates/cloud-init.tpl" ) ).path( "./terraform/hetzner/templates/cloud-init.tpl" ).end()
// /deploy/
.file().data( include_str!( "../../template/deploy/deploy/Dockerfile" ) ).path( "./deploy/Dockerfile" ).end()
.file().data( include_str!( "../../template/deploy/deploy/Readme.md" ) ).path( "./deploy/Readme.md" ).end()
// /deploy/gar
.file().data( include_str!( "../../template/deploy/deploy/gar/Readme.md" ) ).path( "./deploy/gar/Readme.md" ).end()
.file().data( include_str!( "../../template/deploy/deploy/gar/main.tf" ) ).path( "./deploy/gar/main.tf" ).end()
.file().data( include_str!( "../../template/deploy/deploy/gar/outputs.tf" ) ).path( "./deploy/gar/outputs.tf" ).end()
.file().data( include_str!( "../../template/deploy/deploy/gar/variables.tf" ) ).path( "./deploy/gar/variables.tf" ).end()
// /deploy/gce
.file().data( include_str!( "../../template/deploy/deploy/gce/Readme.md" ) ).path( "./deploy/gce/Readme.md" ).end()
.file().data( include_str!( "../../template/deploy/deploy/gce/main.tf" ) ).path( "./deploy/gce/main.tf" ).end()
.file().data( include_str!( "../../template/deploy/deploy/gce/outputs.tf" ) ).path( "./deploy/gce/outputs.tf" ).end()
.file().data( include_str!( "../../template/deploy/deploy/gce/variables.tf" ) ).path( "./deploy/gce/variables.tf" ).end()
// /deploy/gce/templates
.file().data( include_str!( "../../template/deploy/deploy/gce/templates/cloud-init.tpl" ) ).path( "./deploy/gce/templates/cloud-init.tpl" ).end()
// /deploy/gcs
.file().data( include_str!( "../../template/deploy/deploy/gcs/main.tf" ) ).path( "./deploy/gcs/main.tf" ).end()
// /deploy/hetzner
.file().data( include_str!( "../../template/deploy/deploy/hetzner/main.tf" ) ).path( "./deploy/hetzner/main.tf" ).end()
.file().data( include_str!( "../../template/deploy/deploy/hetzner/outputs.tf" ) ).path( "./deploy/hetzner/outputs.tf" ).end()
.file().data( include_str!( "../../template/deploy/deploy/hetzner/variables.tf" ) ).path( "./deploy/hetzner/variables.tf" ).end()
// /deploy/hetzner/templates
.file().data( include_str!( "../../template/deploy/deploy/hetzner/templates/cloud-init.tpl" ) ).path( "./deploy/hetzner/templates/cloud-init.tpl" ).end()
.form();

Self( formed.files )
Expand Down
2 changes: 1 addition & 1 deletion module/move/willbe/template/deploy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export SECRET_CSP_HETZNER ?= $(shell cat key/SECRET_CSP_HETZNER)

# Base terraform directory
export tf_dir ?= terraform
export tf_dir ?= deploy
# Location for deployed resources
export TF_VAR_REGION ?= {{gcp_region}}
# Project id for deployed resources
Expand Down
2 changes: 2 additions & 0 deletions module/move/willbe/template/deploy/deploy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/*/.*
/*/*.tfstate*
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ This directory contains [Compute Engine](gce/) and [Artifact Registry](gar/) ter
- [templates](./templates/) - Contains templates to be used for resource creation.
- [templates/cloud-init.tpl](./templates/cloud-init.tpl) - Cloud-init script template to start docker container containing the webapp.

To push an image to be deployed you need to have a [../Dockerfile](../Dockerfile) in the the same directory as your [../Makefile](../Makefile).

[Compute Engine](gce/) is dependant on [Artifact Registry](gar/) so it's required to create [Artifact Registry](gar/) resources first.
4 changes: 4 additions & 0 deletions module/move/willbe/template/deploy/key/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!.gitignore
!*.md
!pack.sh

0 comments on commit 1343120

Please sign in to comment.