Skip to content

Instantly share code, notes, and snippets.

View asizikov's full-sized avatar
💭
💻

Anton Sizikov asizikov

💭
💻
View GitHub Profile
@asizikov
asizikov / deployment.yml
Created November 27, 2022 12:14
Run a deployment to productions when release tag is pushed
# https://blog.cloud-eng.nl/2022/11/26/environment-protection-tags/
name: ⚙️ deployment
# Controls when the workflow will run
on:
push:
tags:
- 'release_*'
jobs:
@asizikov
asizikov / .wslconfig
Created February 3, 2021 09:58
Configure global WSL options.
#C:\Users\<yourUserName>\.wslconfig
# https://blog.cloud-eng.nl/2021/02/03/wsl2-limits-vmmem/
[wsl2]
memory=6GB # How much memory to assign to the WSL 2 VM.
processors=4 # How many processors to assign to the WSL 2 VM.
swap=1GB # How much swap space to add to the WSL 2 VM, 0 for no swap file.
localhostForwarding=true # ports bound to wildcard or localhost in the WSL 2 VM should be connectable from the host via localhost:port.
@asizikov
asizikov / deploy_stage.yaml
Created January 31, 2021 19:49
Azure DevOps Pipeline. Deploy Octopus release
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
- stage: octopus_deploy_deployment
displayName: 'Deploy release'
dependsOn:
- octopus_deploy_release
jobs:
- job:
steps:
- task: OctopusDeployRelease@4
@asizikov
asizikov / create_release.yaml
Last active February 16, 2022 08:55
Azure DevOps Pipeline. Create Octopus Deploy release and submit build metadata.
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
- stage: octopus_deploy_release
displayName: 'Prepare release'
dependsOn:
- build_application
jobs:
- job: octopus
steps:
- download: current
artifact: 'drop'
@asizikov
asizikov / import.sh
Created January 28, 2021 10:54
Import existing Octopus Deploy environment
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
terraform import octopusdeploy_environment.production Environments-7
@asizikov
asizikov / octopus-deploy-beployment-process.tf
Created January 28, 2021 10:35
Deployment process for Azure WebApp (Azure Function)
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
data "octopusdeploy_feeds" "builtin" {
feed_type = "BuiltIn"
}
data "octopusdeploy_machine_policies" "default" {
}
resource "octopusdeploy_deployment_process" "deployment" {
@asizikov
asizikov / octopus-deploy-project.tf
Created January 28, 2021 10:27
Octopus Deploy Project configuration
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
resource "octopusdeploy_lifecycle" "default" {
name = "Default Lifecycle"
}
resource "octopusdeploy_project_group" "default" {
name = "Default Project Group"
description = "Azure Echo Function"
}
@asizikov
asizikov / octopus-deploy-deployment-target.tf
Last active January 28, 2021 10:15
Octopus Deploy Deployment Target (Azure WebApp)
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
resource "octopusdeploy_azure_service_principal" "azure" {
subscription_id = var.azure_subscription_id
name = "Azure Subscpription"
tenant_id = var.azure_tenant_id
application_id = var.azure_application_id
password = var.azure_password
}
resource "octopusdeploy_azure_web_app_deployment_target" "echo_function" {
@asizikov
asizikov / octopus-deploy-environment.tf
Created January 28, 2021 10:09
Octopus Deploy Environment Configuration
# https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/
resource "octopusdeploy_environment" "test" {
description = "azure function"
name = var.environmentName
depends_on = [octopusdeploy_azure_service_principal.azure]
}