Skip to content

Instantly share code, notes, and snippets.

View kasunsjc's full-sized avatar
:octocat:
Focusing

Kasun Rajapakse kasunsjc

:octocat:
Focusing
View GitHub Profile
@kasunsjc
kasunsjc / azure-devops-agent-deploy.yaml
Created September 29, 2021 17:39
Azure DevOps agent deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: azdevops-deployment
namespace: azure-devops-agents
labels:
app: azdevops-agent
spec:
replicas: 3 #here is the configuration for the actual agent always running
selector:
@kasunsjc
kasunsjc / start.sh
Created September 29, 2021 16:14
Azure DevOps Build agent startup script
#!/bin/bash
set -e
if [ -z "$AZP_URL" ]; then
echo 1>&2 "error: missing AZP_URL environment variable"
exit 1
fi
if [ -z "$AZP_TOKEN_FILE" ]; then
if [ -z "$AZP_TOKEN" ]; then
@kasunsjc
kasunsjc / Dockerfile
Last active September 29, 2021 16:10
Azure DevOps docker agent 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 \
curl \
name: build
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-18.04
apiVersion: apps/v1
kind: Deployment
metadata:
name: app1-nginx-deployment
labels:
app: app1-nginx
spec:
replicas: 1
selector:
matchLabels:
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:13.12.0 as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
RUN npm run build
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.15
COPY --from=build-stage /app/build/ /usr/share/nginx/html
@kasunsjc
kasunsjc / comparisons.csv
Last active November 9, 2020 14:06
Container Registry Comparisions
Criteria Azure Container Registry DockerHub GitHub Container Registry
Public Images No Yes Yes
Private Images Yes Yes Yes
Pricing (Private Images) Basic/Standard/Premium 5$ per month Free for the beta period
Authentication Password or SPN Password and Access Token Personal Access Token
SLA Availability 99.9% N/A N/A during the beta
General Availability Yes Yes beta
Image Scanning Yes(Premium) Yes No
name: Publish Docker image
on:
push:
branches: main
jobs:
push_to_registry:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
name: Deploy .NET App to Azure Web App
on:
push:
branches:
- master
pull_request:
branches:
- '*'
env:
resource "azurerm_linux_virtual_machine" "tfer--MasterNode-002D-01" {
admin_username = "localadmin"
allow_extension_operations = "true"
boot_diagnostics {
storage_account_uri = "https://<SAName>.blob.core.windows.net/"
}
computer_name = "MasterNode-01"
disable_password_authentication = "false"