Merge branch 'dev' of https://github.com/dotnet-architecture/eShopOnContainers into feature/coupon
# Conflicts: # .github/workflows/basket-api.yml # .github/workflows/catalog-api.yml # .github/workflows/ordering-api.yml
This commit is contained in:
commit
b456c1e2a5
50
.github/workflows/basket-api-deploy.yml
vendored
Normal file
50
.github/workflows/basket-api-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy basket-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["basket-api"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: basket-api
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
44
.github/workflows/basket-api.yml
vendored
44
.github/workflows/basket-api.yml
vendored
@ -2,15 +2,6 @@ name: basket-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# Inputs the workflow accepts.
|
||||
inputs:
|
||||
name:
|
||||
# Friendly description to be shown in the UI instead of 'name'
|
||||
description: 'exec name'
|
||||
# Default value if no value is explicitly provided
|
||||
default: 'default execution'
|
||||
# Input has to be provided for the workflow to run
|
||||
required: false
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
@ -31,6 +22,7 @@ on:
|
||||
env:
|
||||
SERVICE: basket-api
|
||||
IMAGE: basket.api
|
||||
DOTNET_VERSION: 5.0.x
|
||||
|
||||
jobs:
|
||||
|
||||
@ -40,7 +32,23 @@ jobs:
|
||||
steps:
|
||||
- name: 'Checkout Github Action'
|
||||
uses: actions/checkout@master
|
||||
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- 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
|
||||
@ -56,6 +64,22 @@ jobs:
|
||||
- name: 'Checkout Github Action'
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- 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: Enable experimental features for the Docker daemon and CLI
|
||||
run: |
|
||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||
|
50
.github/workflows/catalog-api-deploy.yml
vendored
Normal file
50
.github/workflows/catalog-api-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy catalog-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["catalog-api"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: catalog-api
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
42
.github/workflows/catalog-api.yml
vendored
42
.github/workflows/catalog-api.yml
vendored
@ -2,15 +2,6 @@ name: catalog-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# Inputs the workflow accepts.
|
||||
inputs:
|
||||
name:
|
||||
# Friendly description to be shown in the UI instead of 'name'
|
||||
description: 'exec name'
|
||||
# Default value if no value is explicitly provided
|
||||
default: 'default execution'
|
||||
# Input has to be provided for the workflow to run
|
||||
required: false
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
@ -31,6 +22,7 @@ on:
|
||||
env:
|
||||
SERVICE: catalog-api
|
||||
IMAGE: catalog.api
|
||||
DOTNET_VERSION: 5.0.x
|
||||
|
||||
jobs:
|
||||
|
||||
@ -40,6 +32,22 @@ jobs:
|
||||
steps:
|
||||
- name: 'Checkout Github Action'
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Build and run unit tests
|
||||
run: |
|
||||
cd src
|
||||
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 }}
|
||||
@ -56,6 +64,22 @@ jobs:
|
||||
- name: 'Checkout Github Action'
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Build and run unit tests
|
||||
run: |
|
||||
cd src
|
||||
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: Enable experimental features for the Docker daemon and CLI
|
||||
run: |
|
||||
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
|
||||
|
50
.github/workflows/identity-api-deploy.yml
vendored
Normal file
50
.github/workflows/identity-api-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy identity-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["identity-api"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: identity-api
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/mobileshoppingagg-deploy.yml
vendored
Normal file
50
.github/workflows/mobileshoppingagg-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy mobileshoppingagg
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["mobileshoppingagg"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: mobileshoppingagg
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/ordering-api-deploy.yml
vendored
Normal file
50
.github/workflows/ordering-api-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy ordering-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["ordering-api"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: ordering-api
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
42
.github/workflows/ordering-api.yml
vendored
42
.github/workflows/ordering-api.yml
vendored
@ -2,15 +2,6 @@ name: ordering-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# Inputs the workflow accepts.
|
||||
inputs:
|
||||
name:
|
||||
# Friendly description to be shown in the UI instead of 'name'
|
||||
description: 'exec name'
|
||||
# Default value if no value is explicitly provided
|
||||
default: 'default execution'
|
||||
# Input has to be provided for the workflow to run
|
||||
required: false
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
@ -31,6 +22,7 @@ on:
|
||||
env:
|
||||
SERVICE: ordering-api
|
||||
IMAGE: ordering.api
|
||||
DOTNET_VERSION: 5.0.x
|
||||
|
||||
jobs:
|
||||
|
||||
@ -40,6 +32,22 @@ jobs:
|
||||
steps:
|
||||
- name: 'Checkout Github Action'
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Build and run unit tests
|
||||
run: |
|
||||
cd src
|
||||
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 }}
|
||||
@ -55,6 +63,22 @@ jobs:
|
||||
steps:
|
||||
- name: 'Checkout Github Action'
|
||||
uses: actions/checkout@master
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
with:
|
||||
dotnet-version: ${{ env.DOTNET_VERSION }}
|
||||
|
||||
- name: Build and run unit tests
|
||||
run: |
|
||||
cd src
|
||||
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: Enable experimental features for the Docker daemon and CLI
|
||||
run: |
|
||||
|
50
.github/workflows/ordering-backgroundtasks-deploy.yml
vendored
Normal file
50
.github/workflows/ordering-backgroundtasks-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy ordering-backgroundtasks
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["ordering-backgroundtasks"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: ordering-backgroundtasks
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/ordering-signalrhub-deploy.yml
vendored
Normal file
50
.github/workflows/ordering-signalrhub-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy ordering-signalrhub
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["ordering-signalrhub"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: ordering-signalrhub
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/payment-api-deploy.yml
vendored
Normal file
50
.github/workflows/payment-api-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy payment-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["payment-api"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: payment-api
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/webhooks-api-deploy.yml
vendored
Normal file
50
.github/workflows/webhooks-api-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy webhooks-api
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["webhooks-api"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: webhooks-api
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/webmvc-deploy.yml
vendored
Normal file
50
.github/workflows/webmvc-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy webmvc
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["webmvc"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: webmvc
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/webshoppingagg-deploy.yml
vendored
Normal file
50
.github/workflows/webshoppingagg-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy webshoppingagg
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["webshoppingagg"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: webshoppingagg
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/webspa-deploy.yml
vendored
Normal file
50
.github/workflows/webspa-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy webspa
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["webspa"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: webspa
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
50
.github/workflows/webstatus-deploy.yml
vendored
Normal file
50
.github/workflows/webstatus-deploy.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Deploy webstatus
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types:
|
||||
- deploy
|
||||
workflow_run:
|
||||
workflows: ["webstatus"]
|
||||
branches: [dev]
|
||||
types: [completed]
|
||||
|
||||
env:
|
||||
CHART: webstatus
|
||||
NAMESPACE: eshop
|
||||
CHART_ROOT: deploy/k8s/helm
|
||||
|
||||
jobs:
|
||||
deploy-to-k8s:
|
||||
#if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'repository_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: azure/login@v1
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- uses: azure/aks-set-context@v1
|
||||
name: Set AKS context
|
||||
with:
|
||||
creds: '${{ secrets.AZURE_CREDENTIALS }}'
|
||||
cluster-name: ${{ secrets.CLUSTER_NAME }}
|
||||
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 }}
|
199
deploy/k8s/helm/deploy-chart.sh
Executable file
199
deploy/k8s/helm/deploy-chart.sh
Executable file
@ -0,0 +1,199 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# http://redsymbol.net/articles/unofficial-bash-strict-mode
|
||||
set -euo pipefail
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<END
|
||||
deploy.sh: deploys the $app_name application to a Kubernetes cluster using Helm.
|
||||
Parameters:
|
||||
--aks-name <AKS cluster name>
|
||||
The name of the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
|
||||
--aks-rg <AKS resource group>
|
||||
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
|
||||
-c | --chart <name of chart>
|
||||
The name of the chart to upgrade (or install)
|
||||
-d | --dns <dns or ip address> | --dns aks
|
||||
Specifies the external DNS/ IP address of the Kubernetes cluster.
|
||||
If 'aks' is set as value, the DNS value is retrieved from the AKS. --aks-name and --aks-rg are needed.
|
||||
When --use-local-k8s is specified the external DNS is automatically set to localhost.
|
||||
-h | --help
|
||||
Displays this help text and exits the script.
|
||||
-n | --app-name <the name of the app>
|
||||
Specifies the name of the application (default: eshop).
|
||||
--namespace <namespace name>
|
||||
Specifies the namespace name to deploy the app. If it doesn't exists it will be created (default: eshop).
|
||||
-p | --docker-password <docker password>
|
||||
The Docker password used to logon to the custom registry, supplied using the -r parameter.
|
||||
-r | --registry <container registry>
|
||||
Specifies the container registry to use (required), e.g. myregistry.azurecr.io.
|
||||
--skip-clean
|
||||
Do not clean the Kubernetes helm chart. Default is to clean the chart.
|
||||
-t | --tag <docker image tag>
|
||||
The tag used for the newly created docker images. Default: latest.
|
||||
-u | --docker-username <docker username>
|
||||
The Docker username used to logon to the custom registry, supplied using the -r parameter.
|
||||
--use-local-k8s
|
||||
Deploy to a locally installed Kubernetes (default: false).
|
||||
|
||||
It is assumed that the Kubernetes cluster has been granted access to the container registry.
|
||||
If using AKS and ACR see link for more info:
|
||||
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks
|
||||
|
||||
WARNING! THE SCRIPT WILL COMPLETELY DESTROY ALL DEPLOYMENTS AND SERVICES VISIBLE
|
||||
FROM THE CURRENT CONFIGURATION CONTEXT AND NAMESPACE.
|
||||
It is recommended that you check your selected namespace, 'eshop' by default, is already in use.
|
||||
Every deployment and service done in the namespace will be deleted.
|
||||
For more information see https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
|
||||
|
||||
END
|
||||
}
|
||||
|
||||
acr_connected=''
|
||||
app_name='eshop'
|
||||
aks_name=''
|
||||
aks_rg=''
|
||||
chart=''
|
||||
clean='yes'
|
||||
container_registry=''
|
||||
docker_password=''
|
||||
docker_username=''
|
||||
dns=''
|
||||
image_tag='latest'
|
||||
skip_infrastructure=''
|
||||
use_local_k8s=''
|
||||
namespace='eshop'
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--acr-connected )
|
||||
acr_connected='yes'; shift ;;
|
||||
--aks-name )
|
||||
aks_name="$2"; shift 2;;
|
||||
--aks-rg )
|
||||
aks_rg="$2"; shift 2;;
|
||||
-c | --chart )
|
||||
chart="$2"; shift 2;;
|
||||
-d | --dns )
|
||||
dns="$2"; shift 2;;
|
||||
-h | --help )
|
||||
usage; exit 1 ;;
|
||||
-n | --app-name )
|
||||
app_name="$2"; shift 2;;
|
||||
-p | --docker-password )
|
||||
docker_password="$2"; shift 2;;
|
||||
-r | --registry )
|
||||
container_registry="$2"; shift 2;;
|
||||
--skip-clean )
|
||||
clean=''; shift ;;
|
||||
--image-build )
|
||||
build_images='yes'; shift ;;
|
||||
--image-push )
|
||||
push_images='yes'; shift ;;
|
||||
--skip-infrastructure )
|
||||
skip_infrastructure='yes'; shift ;;
|
||||
-t | --tag )
|
||||
image_tag="$2"; shift 2;;
|
||||
-u | --docker-username )
|
||||
docker_username="$2"; shift 2;;
|
||||
--use-local-k8s )
|
||||
use_local_k8s='yes'; shift ;;
|
||||
--namespace )
|
||||
namespace="$2"; shift 2;;
|
||||
*)
|
||||
echo "Unknown option $1"
|
||||
usage; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
export TAG=$image_tag
|
||||
|
||||
use_custom_registry=''
|
||||
|
||||
if [[ -n $container_registry ]] && [[ -z $acr_connected ]]; then
|
||||
echo "################ Log into custom registry $container_registry ##################"
|
||||
use_custom_registry='yes'
|
||||
if [[ -z $docker_username ]] || [[ -z $docker_password ]]; then
|
||||
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
|
||||
exit 1
|
||||
fi
|
||||
docker login -u $docker_username -p $docker_password $container_registry
|
||||
fi
|
||||
|
||||
ingress_values_file="ingress_values.yaml"
|
||||
|
||||
if [[ $use_local_k8s ]]; then
|
||||
ingress_values_file="ingress_values_dockerk8s.yaml"
|
||||
dns="localhost"
|
||||
fi
|
||||
|
||||
if [[ $dns == "aks" ]]; then
|
||||
echo "#################### Begin AKS discovery based on the --dns aks setting. ####################"
|
||||
if [[ -z $aks_name ]] || [[ -z $aks_rg ]]; then
|
||||
echo "Error: When using -dns aks, MUST set -aksName and -aksRg too."
|
||||
echo ''
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Getting AKS cluster $aks_name AKS (in resource group $aks_rg)"
|
||||
# JMESPath queries are case sensitive and httpapplicationrouting can be lowercase sometimes
|
||||
jmespath_dnsqueries=(\
|
||||
addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName \
|
||||
addonProfiles.httpapplicationrouting.config.HTTPApplicationRoutingZoneName \
|
||||
)
|
||||
for q in "${jmespath_dnsqueries[@]}"
|
||||
do
|
||||
dns="$(az aks show -n $aks_name -g $aks_rg --query $q -o tsv)"
|
||||
if [[ -n $dns ]]; then break; fi
|
||||
done
|
||||
if [[ -z $dns ]]; then
|
||||
echo "Error: when getting DNS of AKS $aks_name (in resource group $aks_rg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged in and is of version 2.0.37 or higher."
|
||||
exit 1
|
||||
fi
|
||||
echo "DNS base found is $dns. Will use $aks_name.$dns for the app!"
|
||||
dns="$aks_name.$dns"
|
||||
fi
|
||||
|
||||
# Initialization & check commands
|
||||
if [[ -z $dns ]]; then
|
||||
echo "No DNS specified. Ingress resources will be bound to public IP."
|
||||
fi
|
||||
|
||||
previous_install=''
|
||||
if [[ -z $(helm ls -q --namespace $namespace | grep "$app_name-$chart") ]]; then
|
||||
echo "No previous release found"
|
||||
else
|
||||
previous_install='yes'
|
||||
fi
|
||||
|
||||
if [[ $clean ]] && [[ $previous_install ]]; then
|
||||
echo "Cleaning previous helm releases..."
|
||||
helm uninstall "$app_name-$chart" --namespace $namespace
|
||||
echo "Previous release deleted"
|
||||
waitsecs=5; while [ $waitsecs -gt 0 ]; do echo -ne "$waitsecs\033[0K\r"; sleep 1; : $((waitsecs--)); done
|
||||
previous_install=''
|
||||
fi
|
||||
|
||||
echo "#################### Begin $app_name $chart installation using Helm ####################"
|
||||
if [[ $use_custom_registry ]] || [[ $acr_connected ]]; then
|
||||
if [[ -z $acr_connected ]]; then
|
||||
if [[ -z $previous_install ]]; then
|
||||
helm upgrade --install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
|
||||
else
|
||||
helm upgrade --install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
|
||||
fi
|
||||
elif [[ $chart != "eshop-common" ]]; then
|
||||
# ACR is already connected, so we don't need username/password
|
||||
if [[ -z $previous_install ]]; then
|
||||
helm install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
|
||||
else
|
||||
# don't set the image repo since it's already set
|
||||
helm upgrade "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
|
||||
fi
|
||||
fi
|
||||
elif [[ $chart != "eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed
|
||||
helm upgrade --install "$app_name-$chart" --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always $chart
|
||||
fi
|
||||
echo "FINISHED: Helm chart installed."
|
@ -103,7 +103,7 @@ static_resources:
|
||||
lb_policy: round_robin
|
||||
hosts:
|
||||
- socket_address:
|
||||
address: webshoppingagg
|
||||
address: mobileshoppingagg
|
||||
port_value: 80
|
||||
- name: catalog
|
||||
connect_timeout: 0.25s
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -3,7 +3,7 @@ WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -9,9 +9,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B
|
||||
public class CardType
|
||||
: Enumeration
|
||||
{
|
||||
public static CardType Amex = new CardType(1, "Amex");
|
||||
public static CardType Visa = new CardType(2, "Visa");
|
||||
public static CardType MasterCard = new CardType(3, "MasterCard");
|
||||
public static CardType Amex = new CardType(1, nameof(Amex));
|
||||
public static CardType Visa = new CardType(2, nameof(Visa));
|
||||
public static CardType MasterCard = new CardType(3, nameof(MasterCard));
|
||||
|
||||
public CardType(int id, string name)
|
||||
: base(id, name)
|
||||
|
@ -11,27 +11,23 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork
|
||||
|
||||
public int Id { get; private set; }
|
||||
|
||||
protected Enumeration(int id, string name)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
protected Enumeration(int id, string name) => (Id, Name) = (id, name);
|
||||
|
||||
public override string ToString() => Name;
|
||||
|
||||
public static IEnumerable<T> GetAll<T>() where T : Enumeration
|
||||
{
|
||||
var fields = typeof(T).GetFields(BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly);
|
||||
|
||||
return fields.Select(f => f.GetValue(null)).Cast<T>();
|
||||
}
|
||||
|
||||
|
||||
public static IEnumerable<T> GetAll<T>() where T : Enumeration =>
|
||||
typeof(T).GetFields(BindingFlags.Public |
|
||||
BindingFlags.Static |
|
||||
BindingFlags.DeclaredOnly)
|
||||
.Select(f => f.GetValue(null))
|
||||
.Cast<T>();
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var otherValue = obj as Enumeration;
|
||||
|
||||
if (otherValue == null)
|
||||
if (obj is not Enumeration otherValue)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var typeMatches = GetType().Equals(obj.GetType());
|
||||
var valueMatches = Id.Equals(otherValue.Id);
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0
|
||||
ARG BUILD_CONFIGURATION=Debug
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
|
||||
|
@ -59,6 +59,7 @@ export class CatalogComponent implements OnInit {
|
||||
|
||||
this.brandSelected = this.brandSelected && this.brandSelected.toString() != "null" ? this.brandSelected : null;
|
||||
this.typeSelected = this.typeSelected && this.typeSelected.toString() != "null" ? this.typeSelected : null;
|
||||
this.paginationInfo.actualPage = 0;
|
||||
this.getCatalog(this.paginationInfo.itemsPage, this.paginationInfo.actualPage, this.brandSelected, this.typeSelected);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ COPY Web/WebSPA/package-lock.json .
|
||||
COPY Web/WebSPA .
|
||||
RUN npm i npm@6.14.11 -g && npm update && npm install && npm run build:prod
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
45
src/Web/WebSPA/package-lock.json
generated
45
src/Web/WebSPA/package-lock.json
generated
@ -8474,12 +8474,12 @@
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||
},
|
||||
"is-svg": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-svg/-/is-svg-3.0.0.tgz",
|
||||
"integrity": "sha512-gi4iHK53LR2ujhLVVj+37Ykh9GLqYHX6JOVXbLAucaG/Cqw9xwdFOjDM2qeifLs1sF1npXXFvDu0r5HNgCMrzQ==",
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/is-svg/-/is-svg-4.2.2.tgz",
|
||||
"integrity": "sha512-JlA7Mc7mfWjdxxTkJ094oUK9amGD7gQaj5xA/NCY0vlVvZ1stmj4VX+bRuwOMN93IHRZ2ctpPH/0FO6DqvQ5Rw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"html-comment-regex": "^1.1.0"
|
||||
"html-comment-regex": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"is-symbol": {
|
||||
@ -14408,18 +14408,21 @@
|
||||
}
|
||||
},
|
||||
"sockjs": {
|
||||
"version": "0.3.19",
|
||||
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz",
|
||||
"integrity": "sha512-V48klKZl8T6MzatbLlzzRNhMepEys9Y4oGFpypBFFn1gLI/QQ9HtLLyWJNbPlwGLelOVOEijUbTTJeLLI59jLw==",
|
||||
"version": "0.3.20",
|
||||
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.20.tgz",
|
||||
"integrity": "sha512-SpmVOVpdq0DJc0qArhF3E5xsxvaiqGNb73XfgBpK1y3UD5gs8DSo8aCTsuT5pX8rssdc2NDIzANwP9eCAiSdTA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"faye-websocket": "^0.10.0",
|
||||
"uuid": "^3.0.1"
|
||||
"uuid": "^3.4.0",
|
||||
"websocket-driver": "0.6.5"
|
||||
}
|
||||
},
|
||||
"sockjs-client": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.3.0.tgz",
|
||||
"integrity": "sha512-R9jxEzhnnrdxLCNln0xg5uGHqMnkhPSTzUZH2eXcR03S/On9Yvoq2wyUZILRUhZCNVu2PmwWVoyuiPz8th8zbg==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.4.0.tgz",
|
||||
"integrity": "sha512-5zaLyO8/nri5cua0VtOrFXBPK1jbL4+1cebT/mmKA1E1ZXOvJrII75bPu0l0k843G/+iAbhEqzyKr0w/eCCj7g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^3.2.5",
|
||||
"eventsource": "^1.0.7",
|
||||
@ -14429,10 +14432,20 @@
|
||||
"url-parse": "^1.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": {
|
||||
"version": "3.2.7",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
|
||||
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ms": "^2.1.1"
|
||||
}
|
||||
},
|
||||
"faye-websocket": {
|
||||
"version": "0.11.3",
|
||||
"resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.3.tgz",
|
||||
"integrity": "sha512-D2y4bovYpzziGgbHYtGCMjlJM36vAl/y+xUyn1C+FVx8szd1E+86KwVw6XvYSzOP8iMpm1X0I4xJD+QtUb36OA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"websocket-driver": ">=0.5.1"
|
||||
}
|
||||
@ -14771,9 +14784,9 @@
|
||||
}
|
||||
},
|
||||
"ssri": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.0.tgz",
|
||||
"integrity": "sha512-aq/pz989nxVYwn16Tsbj1TqFpD5LLrQxHf5zaHuieFV+R0Bbr4y8qUsOA45hXT/N4/9UNXTarBjnjVmjSOVaAA==",
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
|
||||
"integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minipass": "^3.1.1"
|
||||
@ -16765,8 +16778,8 @@
|
||||
"selfsigned": "^1.9.1",
|
||||
"semver": "^5.6.0",
|
||||
"serve-index": "^1.7.2",
|
||||
"sockjs": "0.3.19",
|
||||
"sockjs-client": "1.3.0",
|
||||
"sockjs": "0.3.20",
|
||||
"sockjs-client": "1.4.0",
|
||||
"spdy": "^4.0.0",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"supports-color": "^5.1.0",
|
||||
|
@ -56,7 +56,9 @@
|
||||
"tslib": "^2.0.0",
|
||||
"typedoc": "^0.19.2",
|
||||
"webpack-dev-server": "3.1.14",
|
||||
"zone.js": "~0.10.2"
|
||||
"zone.js": "~0.10.2",
|
||||
"ssri": ">=8.0.1",
|
||||
"is-svg": ">=4.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "~0.1002.0",
|
||||
|
@ -2,7 +2,7 @@ FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
@ -3,7 +3,7 @@ WORKDIR /app
|
||||
EXPOSE 80
|
||||
EXPOSE 443
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim AS build
|
||||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||
|
Loading…
x
Reference in New Issue
Block a user