Skip to content

Instantly share code, notes, and snippets.

View michalpenka's full-sized avatar

Michal Pěnka michalpenka

View GitHub Profile
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
apiVersion: v1
kind: Secret
metadata:
name: sec-azure-pipelines-agent
namespace: azure-pipelines-agent
type: Opaque
data:
AZP_TOKEN: BASE64REDACTED==
AZP_URL: BASE64REDACTED==
apiVersion: v1
kind: Namespace
metadata:
name: azure-pipelines-agent
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
$!
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 \
source="_build_pipeline/KubernetesDeploymentManifest/kubernetes-deployment.yml"
dest="kubernetes-deployment-interpolated.yml"
envsubst < $source > $dest
$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
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-helloworld
namespace: helloworld
spec:
replicas: ${APP_REPLICAS}
selector:
matchLabels:
app: app-helloworld
trigger:
- master
resources:
- repo: self
variables:
tagBuild: '$(Build.BuildId)'
stages:
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