Skip to content

Commit

Permalink
Merge pull request #34 from powellquiring/master
Browse files Browse the repository at this point in the history
Terraform, schematics, DA
  • Loading branch information
powellquiring authored Aug 15, 2023
2 parents 601450c + bc29ed8 commit 0fc4b78
Show file tree
Hide file tree
Showing 8 changed files with 397 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,24 @@ mongodb.conf
*.sln

# Courtesy of https://github.com/meanjs/mean/blob/master/.gitignore
__temp__ca.pem
__temp__ca.pem

### Vim ###
# swap
[._]*.sw[a-p]

## Terraform ###
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# place to keep environment variables
local.env

### drawio ***
# DrawIO temporary files
*.dtmp
*.bkp
54 changes: 54 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog
## 1.0.6
Changed compliance controls to version 1.2.0 changed rule to 1.46
## 1.0.1
Added support terraform, schematics and IBM Catalog
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This application uses [Databases for MongoDB](https://cloud.ibm.com/catalog/serv

The code and detailed steps are discussed in the [IBM Cloud solution tutorial](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-tutorials) titled [Modern web application using MEAN stack](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-mean-stack).

<img src="ReadME-Images/Architecture.png">
<img src="ReadME-Images/Architecture.svg">

#### Features
- MVC project structure
Expand Down Expand Up @@ -67,6 +67,33 @@ An alternative way of running locally is using the provided `Dockerfile`.
docker run -p 8080:8080 --env-file .env -ti mean-stack:v1.0.0
```

## Provision with Terraform
The steps of creating the resouces (database, code engine project, secret, application, ...) described in [Modern web application using MEAN stack](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-mean-stack) are captured in the terraform file [main.tf](main.tf).

[Getting started with solution tutorials](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-tutorials) has a description of how to get started with terraform on a workstation.


```
terraform init
terraform apply
```

## Provision with Schematics
Schematics is a cloud based Infrastructure as Code runner with cloud based state. It leverages the Terraform configuration described in the previous section.

[Create a Schematics Workspace from this github repository](https://cloud.ibm.com/schematics/workspaces/create?repository=https://github.com/IBM-Cloud/nodejs-MEAN-stack&terraform_version=terraform_v1.4)

The link above should have opened a schematics workspace in the create dialog with the github repository pre-configured and terraform 1.4 selected. Change the **Workspace name**, **Resource group**, and **Location** as desired. This will be the resource group of the workspace. The resource group of the resources created will be configured in schematics. Click **Create**.

## Provision as a Deployable Architecture
In the IBM Cloud create a private catalog and then add a product to the catalog:
- Product type: Deployable architecture
- Deliver method: Terraform
- Public repository: Open the [releases](https://github.com/IBM-Cloud/nodejs-MEAN-stack/releases) and right click on the source.code.tar.gz file and paste in the string. Example: https://github.com/IBM-Cloud/nodejs-MEAN-stack/archive/refs/tags/1.0.3.tar.gz
- Variation: Standard
- Rest of the values are pretty clear


## Contribute
Please create a pull request with your desired changes.

Expand Down
3 changes: 3 additions & 0 deletions ReadME-Images/Architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0fc4b78

Please sign in to comment.