Skip to content

Commit

Permalink
feat: Added and tested application stacks for linux and windows web app
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMaharshi committed Jul 31, 2024
1 parent d312f54 commit 6df7f67
Show file tree
Hide file tree
Showing 20 changed files with 824 additions and 578 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/auto_assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Auto Assign PRs

on:
pull_request:
types: [opened, reopened]

workflow_dispatch:
jobs:
assignee:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_assignee.yml@1.2.7
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
assignees: 'clouddrove-ci'
12 changes: 12 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Auto merge
on:
pull_request:
jobs:
auto-merge:
uses: clouddrove/github-shared-workflows/.github/workflows/auto_merge.yml@1.2.7
secrets:
GITHUB: ${{ secrets.GITHUB }}
with:
tfcheck: 'basic-example / Check code format'
...
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:
workflow_dispatch:
jobs:
call-workflow-changelog:
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/changelog.yml@1.2.7
with:
branch: 'master'
11 changes: 5 additions & 6 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,28 @@ jobs:
uses: actions/checkout@master

- name: 'Set up Python 3.7'
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: 'create readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
with:
actions_subcommand: 'readme'
github_token: '${{ secrets.GITHUB }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


- name: 'pre-commit check errors'
uses: pre-commit/action@v2.0.0
uses: pre-commit/action@v3.0.1
continue-on-error: true

- name: 'pre-commit fix erros'
uses: pre-commit/action@v2.0.0
uses: pre-commit/action@v3.0.1
continue-on-error: true

- name: 'push readme'
uses: 'clouddrove/github-actions@v9.0.2'
uses: 'clouddrove/github-actions@9.0.3'
continue-on-error: true
with:
actions_subcommand: 'push'
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: tf-checks
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
basic-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.7
with:
working_directory: './_example/basic/'

complete-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.7
with:
working_directory: './_example/complete/'

vnet_with_existing_ddos_id-example:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-checks.yml@1.2.7
with:
working_directory: './_example/vnet_with_existing_ddos_id/'
11 changes: 11 additions & 0 deletions .github/workflows/tflint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: tf-lint
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
tf-lint:
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@1.2.7
secrets:
GITHUB: ${{ secrets.GITHUB }}
2 changes: 1 addition & 1 deletion .github/workflows/tfsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
jobs:
tfsec:
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@master
uses: clouddrove/github-shared-workflows/.github/workflows/tfsec.yml@1.2.7
secrets: inherit
with:
working_directory: '.'
125 changes: 125 additions & 0 deletions _example/complete/linux_web_app/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
provider "azurerm" {
features {}
}

##-----------------------------------------------------------------------------
## Resource group
##-----------------------------------------------------------------------------
module "resource_group" {
source = "clouddrove/resource-group/azure"
version = "1.0.2"

label_order = ["name", "environment"]
name = "rg-example"
environment = "test"
location = "Canada Central"
}

##-----------------------------------------------------------------------------
## Log Analytics
##-----------------------------------------------------------------------------
module "log-analytics" {
source = "clouddrove/log-analytics/azure"
version = "1.0.1"
name = "app"
environment = "test"
label_order = ["name", "environment"]
create_log_analytics_workspace = true
log_analytics_workspace_sku = "PerGB2018"
resource_group_name = module.resource_group.resource_group_name
log_analytics_workspace_location = module.resource_group.resource_group_location
}

##-----------------------------------------------------------------------------
## Linux web app
##-----------------------------------------------------------------------------
module "linux-web-app" {
source = "../../.."
enable = true
name = "app"
environment = "testing"
label_order = ["name", "environment", ]
resource_group_name = module.resource_group.resource_group_name
location = module.resource_group.resource_group_location

os_type = var.os_type
sku_name = var.linux_sku_name



##-----------------------------------------------------------------------------
## To Deploy Container
##-----------------------------------------------------------------------------
use_docker = true
docker_image_name = var.docker_image_name
docker_registry_url = "<registryname>.azurecr.io"
docker_registry_username = "<registryname>"
docker_registry_password = "<docker_registry_password>"
acr_id = "<acr_id>"

##-----------------------------------------------------------------------------
## Node application
##-----------------------------------------------------------------------------
use_node = false
node_version = var.node_version

##-----------------------------------------------------------------------------
## Dot net application
##-----------------------------------------------------------------------------
use_dotnet = false
dotnet_version = var.dotnet_version

##-----------------------------------------------------------------------------
## Java application
##-----------------------------------------------------------------------------
use_java = false
java_version = var.java_version
java_server = var.java_server
java_server_version = var.java_server_version


##-----------------------------------------------------------------------------
## python application
##-----------------------------------------------------------------------------

use_python = false
python_version = var.python_version

##-----------------------------------------------------------------------------
## php application
##-----------------------------------------------------------------------------

use_php = false
php_version = var.php_version

##-----------------------------------------------------------------------------
## Ruby application
##-----------------------------------------------------------------------------

use_ruby = false
ruby_version = var.ruby_version

##-----------------------------------------------------------------------------
## Go application
##-----------------------------------------------------------------------------

use_go = false
go_version = var.go_version

site_config = var.site_config
app_settings = var.app_settings

##-----------------------------------------------------------------------------
## App service logs
##-----------------------------------------------------------------------------

app_service_logs = var.app_service_logs


##-----------------------------------------------------------------------------
## log analytics
##-----------------------------------------------------------------------------
log_analytics_workspace_id = module.log-analytics.workspace_id
app_insights_workspace_id = module.log-analytics.workspace_id # log analytics workspace id in app insights
}

File renamed without changes.
98 changes: 98 additions & 0 deletions _example/complete/linux_web_app/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
##-----------------------------------------------------------------------------
## App Service
##-----------------------------------------------------------------------------

variable "linux_sku_name" {
default = "B1"

}

variable "os_type" {
default = "Linux"
}

variable "enable" {
default = true
}

variable "is_linux_webapp" {
default = true
}

variable "dotnet_version" {
default = "8.0"
}

variable "node_version" {
default = "20-lts"
}

variable "site_config" {
default = {
container_registry_use_managed_identity = true # Set to true
}
}

variable "app_settings" {
type = map(string)
description = "A map of settings for the application"
default = {
foo = "bar"
}
}

variable "php_version" {
type = string
default = "8.2"
}

variable "python_version" {
type = string
default = "3.12"
}

variable "go_version" {
type = string
default = "1.19"
}

variable "ruby_version" {
type = string
default = "2.7"
}

variable "java_version" {
type = string
default = "17"
}

variable "java_server" {
type = string
default = "JAVA"
# Possible values include JAVA, TOMCAT, and JBOSSEAP ( Its in premium sku ).
}

variable "java_server_version" {
type = string
default = "17"
}

variable "docker_image_name" {
default = "nginx:latest"
}

variable "app_service_logs" {
default = {
detailed_error_messages = false
failed_request_tracing = false
application_logs = {
file_system_level = "Information"
}
http_logs = {
file_system = {
retention_in_days = 7
retention_in_mb = 35
}
}
}
}
File renamed without changes.
Loading

0 comments on commit 6df7f67

Please sign in to comment.