Update workflows to use composite (#1753)
* Update workflows to use composite * Add name to composite actions * Revert name change
This commit is contained in:
parent
464b8fc0fd
commit
e57a97d515
31
.github/workflows/basket-api-deploy.yml
vendored
31
.github/workflows/basket-api-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
102
.github/workflows/basket-api.yml
vendored
102
.github/workflows/basket-api.yml
vendored
@ -22,7 +22,6 @@ on:
|
|||||||
env:
|
env:
|
||||||
SERVICE: basket-api
|
SERVICE: basket-api
|
||||||
IMAGE: basket.api
|
IMAGE: basket.api
|
||||||
DOTNET_VERSION: 5.0.x
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -30,97 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Setup dotnet
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
service: ${{ env.SERVICE }}
|
||||||
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
- name: Build and run unit tests
|
|
||||||
run: |
|
|
||||||
cd src
|
|
||||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
|
||||||
cd Services/Basket/Basket.API
|
|
||||||
dotnet build --no-restore
|
|
||||||
cd -
|
|
||||||
cd Services/Basket/Basket.UnitTests
|
|
||||||
dotnet build --no-restore
|
|
||||||
dotnet test --no-build -v=normal
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Setup dotnet
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
service: ${{ env.SERVICE }}
|
||||||
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
- name: Build and run unit tests
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
run: |
|
image_name: ${{ env.IMAGE }}
|
||||||
cd src
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
cd Services/Basket/Basket.API
|
|
||||||
dotnet build --no-restore
|
|
||||||
cd -
|
|
||||||
cd Services/Basket/Basket.UnitTests
|
|
||||||
dotnet build --no-restore
|
|
||||||
dotnet test --no-build -v=normal
|
|
||||||
|
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
|
||||||
username: ${{ secrets.USERNAME }}
|
|
||||||
password: ${{ secrets.PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/catalog-api-deploy.yml
vendored
31
.github/workflows/catalog-api-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
106
.github/workflows/catalog-api.yml
vendored
106
.github/workflows/catalog-api.yml
vendored
@ -23,6 +23,8 @@ env:
|
|||||||
SERVICE: catalog-api
|
SERVICE: catalog-api
|
||||||
IMAGE: catalog.api
|
IMAGE: catalog.api
|
||||||
DOTNET_VERSION: 5.0.x
|
DOTNET_VERSION: 5.0.x
|
||||||
|
PROJECT_PATH: Services/Catalog/Catalog.API
|
||||||
|
TESTS_PATH: Services/Catalog/Catalog.UnitTests
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -30,97 +32,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-test
|
||||||
- name: Setup dotnet
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
service: ${{ env.SERVICE }}
|
||||||
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
- name: Build and run unit tests
|
dotnet_version: ${{ env.DOTNET_VERSION }}
|
||||||
run: |
|
project_path: ${{ env.PROJECT_PATH }}
|
||||||
cd src
|
tests_path: ${{ env.TESTS_PATH }}
|
||||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
|
||||||
cd Services/Catalog/Catalog.API
|
|
||||||
dotnet build --no-restore
|
|
||||||
cd -
|
|
||||||
cd Services/Catalog/Catalog.UnitTests
|
|
||||||
dotnet build --no-restore
|
|
||||||
dotnet test --no-build -v=normal
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Setup dotnet
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
service: ${{ env.SERVICE }}
|
||||||
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
- name: Build and run unit tests
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
run: |
|
image_name: ${{ env.IMAGE }}
|
||||||
cd src
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
cd Services/Catalog/Catalog.API
|
|
||||||
dotnet build --no-restore
|
|
||||||
cd -
|
|
||||||
cd Services/Catalog/Catalog.UnitTests
|
|
||||||
dotnet build --no-restore
|
|
||||||
dotnet test --no-build -v=normal
|
|
||||||
|
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
|
||||||
username: ${{ secrets.USERNAME }}
|
|
||||||
password: ${{ secrets.PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
71
.github/workflows/composite/build-push/action.yml
vendored
Normal file
71
.github/workflows/composite/build-push/action.yml
vendored
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
name: "Build and push image"
|
||||||
|
description: "Builds and pushes an image to a registry"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
service:
|
||||||
|
description: "Service to build"
|
||||||
|
required: true
|
||||||
|
registry_host:
|
||||||
|
description: "Image registry host e.g. myacr.azureacr.io"
|
||||||
|
required: true
|
||||||
|
registry_endpoint:
|
||||||
|
description: "Image registry repo e.g. myacr.azureacr.io/eshop"
|
||||||
|
required: true
|
||||||
|
image_name:
|
||||||
|
description: "Name of image"
|
||||||
|
required: true
|
||||||
|
registry_username:
|
||||||
|
description: "Registry username"
|
||||||
|
required: true
|
||||||
|
registry_password:
|
||||||
|
description: "Registry password"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Enable experimental features for the Docker daemon and CLI
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||||
|
mkdir -p ~/.docker
|
||||||
|
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
||||||
|
sudo service docker restart
|
||||||
|
docker version -f '{{.Client.Experimental}}'
|
||||||
|
docker version -f '{{.Server.Experimental}}'
|
||||||
|
|
||||||
|
- name: Login to Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ${{ inputs.registry_host }}
|
||||||
|
username: ${{ inputs.registry_username }}
|
||||||
|
password: ${{ inputs.registry_password }}
|
||||||
|
|
||||||
|
- name: Set branch name as env variable
|
||||||
|
run: |
|
||||||
|
currentbranch=$(echo ${GITHUB_REF##*/})
|
||||||
|
echo "running on $currentbranch"
|
||||||
|
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Compose build ${{ inputs.service }}
|
||||||
|
shell: bash
|
||||||
|
run: sudo -E docker-compose build ${{ inputs.service }}
|
||||||
|
working-directory: ./src
|
||||||
|
env:
|
||||||
|
TAG: ${{ env.BRANCH }}
|
||||||
|
REGISTRY: ${{ inputs.registry_endpoint }}
|
||||||
|
|
||||||
|
- name: Compose push ${{ inputs.service }}
|
||||||
|
shell: bash
|
||||||
|
run: sudo -E docker-compose push ${{ inputs.service }}
|
||||||
|
working-directory: ./src
|
||||||
|
env:
|
||||||
|
TAG: ${{ env.BRANCH }}
|
||||||
|
REGISTRY: ${{ inputs.registry_endpoint }}
|
||||||
|
|
||||||
|
- name: Create multiarch manifest
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
docker --config ~/.docker manifest create ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:${{ env.BRANCH }} ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:linux-${{ env.BRANCH }}
|
||||||
|
docker --config ~/.docker manifest push ${{ inputs.registry_endpoint }}/${{ inputs.image_name }}:${{ env.BRANCH }}
|
47
.github/workflows/composite/build-test/action.yml
vendored
Normal file
47
.github/workflows/composite/build-test/action.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
name: "Build for PRe"
|
||||||
|
description: "Builds a docker image without pushing"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
service:
|
||||||
|
description: "Service to build"
|
||||||
|
required: true
|
||||||
|
registry_endpoint:
|
||||||
|
description: "Image registry repo e.g. myacr.azureacr.io/eshop"
|
||||||
|
required: true
|
||||||
|
dotnet_version:
|
||||||
|
description: "Version of dotnet to use for testing"
|
||||||
|
required: true
|
||||||
|
project_path:
|
||||||
|
description: "Path to project to test e.g. Services/Catalog/Catalog.API"
|
||||||
|
required: true
|
||||||
|
tests_path:
|
||||||
|
description: "Path to test project e.g. Services/Catalog/Catalog.UnitTests"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Setup dotnet
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: ${{ inputs.dotnet_version }}
|
||||||
|
|
||||||
|
- name: Build and run unit tests
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
||||||
|
cd ${{ inputs.project_path }}
|
||||||
|
dotnet build --no-restore
|
||||||
|
cd -
|
||||||
|
cd ${{ inputs.tests_path }}
|
||||||
|
dotnet build --no-restore
|
||||||
|
dotnet test --no-build -v=normal
|
||||||
|
|
||||||
|
- name: Compose build ${{ inputs.service }}
|
||||||
|
shell: bash
|
||||||
|
run: sudo -E docker-compose build ${{ inputs.service }}
|
||||||
|
working-directory: ./src
|
||||||
|
env:
|
||||||
|
TAG: ${{ env.BRANCH }}
|
||||||
|
REGISTRY: ${{ inputs.registry_endpoint }}
|
21
.github/workflows/composite/build/action.yml
vendored
Normal file
21
.github/workflows/composite/build/action.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: "Build for PRe"
|
||||||
|
description: "Builds a docker image without pushing"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
service:
|
||||||
|
description: "Service to build"
|
||||||
|
required: true
|
||||||
|
registry_endpoint:
|
||||||
|
description: "Image registry repo e.g. myacr.azureacr.io/eshop"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Compose build ${{ inputs.service }}
|
||||||
|
shell: bash
|
||||||
|
run: sudo -E docker-compose build ${{ inputs.service }}
|
||||||
|
working-directory: ./src
|
||||||
|
env:
|
||||||
|
TAG: ${{ env.BRANCH }}
|
||||||
|
REGISTRY: ${{ inputs.registry_endpoint }}
|
54
.github/workflows/composite/deploy-helm/action.yml
vendored
Normal file
54
.github/workflows/composite/deploy-helm/action.yml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
name: "Deploy Helm to AKS"
|
||||||
|
description: "Deploys a helm chart to AKS"
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
azure_credentials:
|
||||||
|
description: "Credentials to connect to AKS"
|
||||||
|
required: true
|
||||||
|
cluster_name:
|
||||||
|
description: "Name of AKS cluster"
|
||||||
|
required: true
|
||||||
|
resource_group:
|
||||||
|
description: "Resource group of AKS cluster"
|
||||||
|
required: true
|
||||||
|
registry_host:
|
||||||
|
description: "Image registry host e.g. myacr.azureacr.io"
|
||||||
|
required: true
|
||||||
|
chart:
|
||||||
|
description: "Chart name"
|
||||||
|
required: true
|
||||||
|
chart_root:
|
||||||
|
description: "Root folder of chart"
|
||||||
|
required: true
|
||||||
|
namespace:
|
||||||
|
description: "Namespace to deploy to"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- uses: azure/login@v1
|
||||||
|
with:
|
||||||
|
creds: ${{ inputs.azure_credentials }}
|
||||||
|
|
||||||
|
- uses: azure/aks-set-context@v1
|
||||||
|
name: Set AKS context
|
||||||
|
with:
|
||||||
|
creds: '${{ inputs.azure_credentials }}'
|
||||||
|
cluster-name: ${{ inputs.cluster_name }}
|
||||||
|
resource-group: ${{ inputs.resource_group }}
|
||||||
|
|
||||||
|
- name: Set branch name as env variable
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
currentbranch=$(echo ${GITHUB_REF##*/})
|
||||||
|
echo "running on $currentbranch"
|
||||||
|
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Deploy Chart
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
./deploy-chart.sh -c ${{ inputs.chart }} --dns aks --aks-name ${{ inputs.clusteR_name }} --aks-rg ${{ inputs.resource_group }} -r ${{ inputs.registry_host }} -t $TAG --namespace ${{ inputs.namespace }} --acr-connected
|
||||||
|
env:
|
||||||
|
TAG: ${{ env.BRANCH }}
|
||||||
|
working-directory: ${{ inputs.chart_root }}
|
31
.github/workflows/identity-api-deploy.yml
vendored
31
.github/workflows/identity-api-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/identity-api.yml
vendored
72
.github/workflows/identity-api.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: identity-api
|
name: identity-api
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/mobileshoppingagg-deploy.yml
vendored
31
.github/workflows/mobileshoppingagg-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/mobileshoppingagg.yml
vendored
72
.github/workflows/mobileshoppingagg.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: mobileshoppingagg
|
name: mobileshoppingagg
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -26,65 +27,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/ordering-api-deploy.yml
vendored
31
.github/workflows/ordering-api-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
106
.github/workflows/ordering-api.yml
vendored
106
.github/workflows/ordering-api.yml
vendored
@ -23,6 +23,8 @@ env:
|
|||||||
SERVICE: ordering-api
|
SERVICE: ordering-api
|
||||||
IMAGE: ordering.api
|
IMAGE: ordering.api
|
||||||
DOTNET_VERSION: 5.0.x
|
DOTNET_VERSION: 5.0.x
|
||||||
|
PROJECT_PATH: Services/Ordering/Ordering.API
|
||||||
|
TESTS_PATH: Services/Ordering/Ordering.UnitTests
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@ -30,97 +32,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-test
|
||||||
- name: Setup dotnet
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
service: ${{ env.SERVICE }}
|
||||||
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
- name: Build and run unit tests
|
dotnet_version: ${{ env.DOTNET_VERSION }}
|
||||||
run: |
|
project_path: ${{ env.PROJECT_PATH }}
|
||||||
cd src
|
tests_path: ${{ env.TESTS_PATH }}
|
||||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
|
||||||
cd Services/Ordering/Ordering.API
|
|
||||||
dotnet build --no-restore
|
|
||||||
cd -
|
|
||||||
cd Services/Ordering/Ordering.UnitTests
|
|
||||||
dotnet build --no-restore
|
|
||||||
dotnet test --no-build -v=normal
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Setup dotnet
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
with:
|
||||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
service: ${{ env.SERVICE }}
|
||||||
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
- name: Build and run unit tests
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
run: |
|
image_name: ${{ env.IMAGE }}
|
||||||
cd src
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
dotnet restore "eShopOnContainers-ServicesAndWebApps.sln"
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
cd Services/Ordering/Ordering.API
|
|
||||||
dotnet build --no-restore
|
|
||||||
cd -
|
|
||||||
cd Services/Ordering/Ordering.UnitTests
|
|
||||||
dotnet build --no-restore
|
|
||||||
dotnet test --no-build -v=normal
|
|
||||||
|
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
|
||||||
username: ${{ secrets.USERNAME }}
|
|
||||||
password: ${{ secrets.PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/ordering-backgroundtasks.yml
vendored
72
.github/workflows/ordering-backgroundtasks.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: ordering-backgroundtasks
|
name: ordering-backgroundtasks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/ordering-signalrhub-deploy.yml
vendored
31
.github/workflows/ordering-signalrhub-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/ordering-signalrhub.yml
vendored
72
.github/workflows/ordering-signalrhub.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: ordering-signalrhub
|
name: ordering-signalrhub
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/payment-api-deploy.yml
vendored
31
.github/workflows/payment-api-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/payment-api.yml
vendored
72
.github/workflows/payment-api.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: payment-api
|
name: payment-api
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/webhooks-api-deploy.yml
vendored
31
.github/workflows/webhooks-api-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/webhooks-api.yml
vendored
72
.github/workflows/webhooks-api.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: webhooks-api
|
name: webhooks-api
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
72
.github/workflows/webhooks-client.yml
vendored
72
.github/workflows/webhooks-client.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: webhooks-client
|
name: webhooks-client
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
27
.github/workflows/webmvc-deploy.yml
vendored
27
.github/workflows/webmvc-deploy.yml
vendored
@ -28,23 +28,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
|
||||||
- uses: azure/aks-set-context@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
name: Set AKS context
|
|
||||||
with:
|
with:
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
- name: Set branch name as env variable
|
chart: ${{ env.CHART }}
|
||||||
run: |
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
namespace: ${{ env.NAMESPACE }}
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/webmvc.yml
vendored
72
.github/workflows/webmvc.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: webmvc
|
name: webmvc
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -29,65 +30,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/webshoppingagg-deploy.yml
vendored
31
.github/workflows/webshoppingagg-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/webshoppingagg.yml
vendored
72
.github/workflows/webshoppingagg.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: webshoppingagg
|
name: webshoppingagg
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -26,65 +27,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/webspa-deploy.yml
vendored
31
.github/workflows/webspa-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/webspa.yml
vendored
72
.github/workflows/webspa.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: webspa
|
name: webspa
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -28,65 +29,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
31
.github/workflows/webstatus-deploy.yml
vendored
31
.github/workflows/webstatus-deploy.yml
vendored
@ -24,27 +24,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: azure/login@v1
|
- uses: ./.github/workflows/composite/deploy-helm
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
azure_credentials: ${{ secrets.AZURE_CREDENTIALS }}
|
||||||
|
cluster_name: ${{ secrets.CLUSTER_NAME }}
|
||||||
- uses: azure/aks-set-context@v1
|
resource_group: ${{ secrets.RESOURCE_GROUP }}
|
||||||
name: Set AKS context
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
with:
|
chart: ${{ env.CHART }}
|
||||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
chart_root: ${{ env.CHART_ROOT }}
|
||||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
namespace: ${{ env.NAMESPACE }}
|
||||||
resource-group: ${{ secrets.RESOURCE_GROUP }}
|
|
||||||
|
|
||||||
- name: Set branch name as env variable
|
|
||||||
run: |
|
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Deploy Chart
|
|
||||||
run: |
|
|
||||||
./deploy-chart.sh -c ${{ env.CHART }} --dns aks --aks-name ${{ secrets.CLUSTER_NAME }} --aks-rg ${{ secrets.RESOURCE_GROUP }} -r ${{ secrets.REGISTRY_HOST }} -t $TAG --namespace ${{ env.NAMESPACE }} --acr-connected
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
working-directory: ${{ env.CHART_ROOT }}
|
|
||||||
|
72
.github/workflows/webstatus.yml
vendored
72
.github/workflows/webstatus.yml
vendored
@ -1,6 +1,7 @@
|
|||||||
name: webstatus
|
name: webstatus
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
@ -29,65 +30,24 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
with:
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
service: ${{ env.SERVICE }}
|
||||||
working-directory: ./src
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
BuildLinux:
|
BuildLinux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.event_name != 'pull_request' }}
|
if: ${{ github.event_name != 'pull_request' }}
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Github Action'
|
- name: Checkout code
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@v2
|
||||||
|
- uses: ./.github/workflows/composite/build-push
|
||||||
- name: Enable experimental features for the Docker daemon and CLI
|
|
||||||
run: |
|
|
||||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
|
||||||
mkdir -p ~/.docker
|
|
||||||
echo $'{\n "experimental": "enabled"\n}' | sudo tee ~/.docker/config.json
|
|
||||||
sudo service docker restart
|
|
||||||
docker version -f '{{.Client.Experimental}}'
|
|
||||||
docker version -f '{{.Server.Experimental}}'
|
|
||||||
|
|
||||||
- name: Login to Container Registry
|
|
||||||
uses: docker/login-action@v1
|
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.REGISTRY_HOST }}
|
service: ${{ env.SERVICE }}
|
||||||
username: ${{ secrets.USERNAME }}
|
registry_host: ${{ secrets.REGISTRY_HOST }}
|
||||||
password: ${{ secrets.PASSWORD }}
|
registry_endpoint: ${{ secrets.REGISTRY_ENDPOINT }}
|
||||||
|
image_name: ${{ env.IMAGE }}
|
||||||
- name: Set branch name as env variable
|
registry_username: ${{ secrets.USERNAME }}
|
||||||
run: |
|
registry_password: ${{ secrets.PASSWORD }}
|
||||||
currentbranch=$(echo ${GITHUB_REF##*/})
|
|
||||||
echo "running on $currentbranch"
|
|
||||||
echo "BRANCH=$currentbranch" >> $GITHUB_ENV
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Compose build ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose build ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Compose push ${{ env.SERVICE }}
|
|
||||||
run: sudo -E docker-compose push ${{ env.SERVICE }}
|
|
||||||
working-directory: ./src
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
TAG: ${{ env.BRANCH }}
|
|
||||||
REGISTRY: ${{ secrets.REGISTRY_ENDPOINT }}
|
|
||||||
|
|
||||||
- name: Create multiarch manifest
|
|
||||||
run: |
|
|
||||||
docker --config ~/.docker manifest create ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }} ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:linux-${{ env.BRANCH }}
|
|
||||||
docker --config ~/.docker manifest push ${{ secrets.REGISTRY_ENDPOINT }}/${{ env.IMAGE }}:${{ env.BRANCH }}
|
|
||||||
shell: bash
|
|
Loading…
x
Reference in New Issue
Block a user