Skip to content

Instantly share code, notes, and snippets.

View asizikov's full-sized avatar
💭
💻

Anton Sizikov asizikov

💭
💻
View GitHub Profile
@asizikov
asizikov / terraform.tfvars
Created January 28, 2021 09:45
Variables file for Octopus Deploy terraform provider
# 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"
@asizikov
asizikov / octopus-deploy-provider.tf
Last active January 28, 2021 09:42
Octopus Deploy Terraform provider configuration
terraform {
required_providers {
octopusdeploy = {
source = "OctopusDeployLabs/octopusdeploy"
}
}
}
provider "octopusdeploy" {
address = var.serverURL
@asizikov
asizikov / ip-trace-function.cs
Created November 29, 2020 15:50
Azure function which prints incoming request's headers headers
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);
}
apiVersion: v1
kind: Pod
metadata:
name: name
spec:
containers:
- name: name
image: ghcr.io/username/imagename:label
imagePullPolicy: Always
imagePullSecrets:
kind: Secret
type: kubernetes.io/dockerconfigjson
apiVersion: v1
metadata:
name: dockerconfigjson-github-com
labels:
app: app-name
data:
.dockerconfigjson: eyJhdXRocyI6eyJnaGNyLmlvIjp7ImF1dGgiOiJkWE5sY201aGJXVTZNVEl6TVRJellXUnpabUZ6WkdZeE1qTXhNak09In19fQ==
@asizikov
asizikov / build-pipeline.yaml
Created September 29, 2020 11:59
github actions pipeline which builds he docker image and executes container structure tests against it.
name: build-application
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
@asizikov
asizikov / .dockerignore
Last active September 29, 2020 11:16
Pretty aggressive dockerignorefile
# Ignore everything
*
# Except /src and /tests directories as well as .sln file.
!/src/**
!/tests/**
!*.sln
**/*.user
**/obj/*
**/*.dll
schemaVersion: '2.0.0'
fileExistenceTests:
- name: "no git files present"
path: '/app/.git'
shouldExist: false
@asizikov
asizikov / Dockerfile
Last active September 29, 2020 11:07
This is a bad docker file, don't use it.
# 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
@asizikov
asizikov / pipeline.yaml
Last active September 15, 2020 15:28
save az cli output as var and use it later
jobs:
- job:
displayName: Your job
variables:
var-name: 'unknown'
steps:
- task: AzureCLI@2
inputs:
azureSubscription: 'sp-connection-name'
scriptType: 'pscore'