This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://blog.cloud-eng.nl/2021/01/27/terraform-octopus-deploy/ | |
| serverURL = "https://cloud-eng.octopus.app" | |
| apiKey = "API-XXXXXXXXXXXXXXXXXXXXXX" | |
| space_id = "Spaces-1" | |
| environmentName = "prod" | |
| azure_subscription_id = "00000000-0000-0000-0000-000000000000" | |
| azure_tenant_id = "00000000-0000-0000-0000-000000000000" | |
| azure_application_id = "00000000-0000-0000-0000-000000000000" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| terraform { | |
| required_providers { | |
| octopusdeploy = { | |
| source = "OctopusDeployLabs/octopusdeploy" | |
| } | |
| } | |
| } | |
| provider "octopusdeploy" { | |
| address = var.serverURL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.Extensions.Primitives; | |
| public static async Task<IActionResult> Run(HttpRequestMessage req, ILogger log){ | |
| var ip = GetIpFromRequestHeaders(req, log); | |
| log.LogInformation($"IP:[{ip}]"); | |
| return new OkObjectResult(ip); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: name | |
| spec: | |
| containers: | |
| - name: name | |
| image: ghcr.io/username/imagename:label | |
| imagePullPolicy: Always | |
| imagePullSecrets: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Secret | |
| type: kubernetes.io/dockerconfigjson | |
| apiVersion: v1 | |
| metadata: | |
| name: dockerconfigjson-github-com | |
| labels: | |
| app: app-name | |
| data: | |
| .dockerconfigjson: eyJhdXRocyI6eyJnaGNyLmlvIjp7ImF1dGgiOiJkWE5sY201aGJXVTZNVEl6TVRJellXUnpabUZ6WkdZeE1qTXhNak09In19fQ== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-application | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ignore everything | |
| * | |
| # Except /src and /tests directories as well as .sln file. | |
| !/src/** | |
| !/tests/** | |
| !*.sln | |
| **/*.user | |
| **/obj/* | |
| **/*.dll |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| schemaVersion: '2.0.0' | |
| fileExistenceTests: | |
| - name: "no git files present" | |
| path: '/app/.git' | |
| shouldExist: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a bad docker file, don't use it. | |
| FROM mcr.microsoft.com/dotnet/core/sdk:3.1 | |
| ARG VERSION="0.0.0.0-local" | |
| ARG CREATED=unknown | |
| WORKDIR /app | |
| COPY . ./ | |
| RUN ls -a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jobs: | |
| - job: | |
| displayName: Your job | |
| variables: | |
| var-name: 'unknown' | |
| steps: | |
| - task: AzureCLI@2 | |
| inputs: | |
| azureSubscription: 'sp-connection-name' | |
| scriptType: 'pscore' |