Skip to content

Create SQL Server and Oracle network policies for database connectivity. #168

Create SQL Server and Oracle network policies for database connectivity.

Create SQL Server and Oracle network policies for database connectivity. #168

Workflow file for this run

# This workflow will build a docker container, publish it to Azure Container Registry, and deploy it to Azure Kubernetes Service using a helm chart.
#
# https://github.com/Azure/actions-workflow-samples/tree/master/Kubernetes
#
# To configure this workflow:
#
# 1. Set up the following secrets in your workspace:
# a. REGISTRY_USERNAME with ACR username
# b. REGISTRY_PASSWORD with ACR Password
#
# 2. Change the values for the REGISTRY_NAME environment variables (below).
name: publish
on:
push:
branches:
- profiles-controller-aaw2.0
pull_request:
# Environment variables available to all jobs and steps in this workflow
env:
REGISTRY_NAME: k8scc01covidacr
TRIVY_VERSION: "v0.43.1"
HADOLINT_VERSION: "2.12.0"
jobs:
build:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/checkout@master
# Connect to Azure Container registry (ACR)
- uses: azure/docker-login@v1
with:
login-server: ${{ env.REGISTRY_NAME }}.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Run Hadolint
run: |
sudo curl -L https://github.com/hadolint/hadolint/releases/download/v${{ env.HADOLINT_VERSION }}/hadolint-Linux-x86_64 --output hadolint
sudo chmod +x hadolint
./hadolint ./Dockerfile --no-fail
# Container build and push to a Azure Container registry (ACR)
- name: Build image
run: |
docker build -f Dockerfile -t localhost:5000/profiles-controller-aaw2:${{ github.sha }} .
docker push localhost:5000/profiles-controller-aaw2:${{ github.sha }}
docker image prune
# Scan image for vulnerabilities
- name: Aqua Security Trivy image scan
run: |
# Allowlist
printf ${{ secrets.CVE_ALLOWLIST }} > .trivyignore
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin ${{ env.TRIVY_VERSION }}
trivy image localhost:5000/profiles-controller-aaw2:${{ github.sha }} --exit-code 0 --timeout=20m --security-checks vuln --severity CRITICAL
# Push if passed scanning
- name: Push image to registry
run: |
docker pull localhost:5000/profiles-controller-aaw2:${{ github.sha }}
docker tag localhost:5000/profiles-controller-aaw2:${{ github.sha }} ${{ env.REGISTRY_NAME }}.azurecr.io/profiles-controller-aaw2:${{ github.sha }}
docker push ${{ env.REGISTRY_NAME }}.azurecr.io/profiles-controller-aaw2:${{ github.sha }}