Skip to content

Instantly share code, notes, and snippets.

Avatar

Michal Pěnka michalpenka

View GitHub Profile
View 06-05-deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-azure-pipelines-agent
namespace: azure-pipelines-agent
spec:
replicas: 1
selector:
matchLabels:
app: app-azure-pipelines-agent
View 06-04-secrets
apiVersion: v1
kind: Secret
metadata:
name: sec-azure-pipelines-agent
namespace: azure-pipelines-agent
type: Opaque
data:
AZP_TOKEN: BASE64REDACTED==
AZP_URL: BASE64REDACTED==
View 06-03-namespace
apiVersion: v1
kind: Namespace
metadata:
name: azure-pipelines-agent
View 06-02-start
print_header "2. Downloading and installing Azure Pipelines agent..."
curl -LsS "https://vstsagentpackage.azureedge.net/agent/2.166.2/vsts-agent-linux-arm64-2.166.2.tar.gz" | tar -xz & wait
$!
View 06-01-dockerfile
FROM ubuntu:18.04
# To make it easier for build and release pipelines to run apt-get,
# configure apt to not require confirmation (assume the -y argument by default)
ENV DEBIAN_FRONTEND=noninteractive
RUN echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
View 05-05-bash-interpolate
source="_build_pipeline/KubernetesDeploymentManifest/kubernetes-deployment.yml"
dest="kubernetes-deployment-interpolated.yml"
envsubst < $source > $dest
View 05-04-powershell-interpolate
$url = "https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst.exe.exec"
wget $url -UseBasicParsing -OutFile envsubst.exe
$source = "_build_pipeline\KubernetesDeploymentManifest\kubernetes-deployment.yml"
$dest = "kubernetes-deployment-interpolated.yml"
Get-Content $source | .\envsubst.exe > $dest
View 05-03-build-pipeline
trigger:
- master
resources:
- repo: self
variables:
tagBuild: '$(Build.BuildId)'
stages:
View 05-02-kubernetes-deployment-pipeline
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-helloworld
namespace: helloworld
spec:
replicas: ${APP_REPLICAS}
selector:
matchLabels:
app: app-helloworld
View 05-01-serviceaccount-role-binding
apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-azdo-helloworld-sc
namespace: helloworld
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: rle-azdo-helloworld-sc