Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MicrosoftDocs/mslearn-microservices-devops-aspnet-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: afsalkc/mslearn-microservices-devops-aspnet-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 5 files changed
  • 1 contributor

Commits on Jun 19, 2023

  1. Create main.yml

    afsalkc authored Jun 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2155796 View commit details
  2. Update CouponController.cs

    afsalkc authored Jun 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    be84581 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3de65f6 View commit details
  4. Create deploy.yml

    afsalkc authored Jun 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fb3543d View commit details
  5. Update Chart.yaml

    afsalkc authored Jun 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a3cce22 View commit details
  6. Update Chart.yaml

    afsalkc authored Jun 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a3594e6 View commit details
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: eShop deploy

on:
push:
paths:
- 'deploy/k8s/helm-simple/coupon/*'
branches: [ main ]

jobs:
deploy-to-aks:
runs-on: ubuntu-latest
steps:
- name: Azure Login
uses: azure/login@v1.4.5
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Azure Kubernetes set context
uses: Azure/aks-set-context@v2
with:
resource-group: 'eshop-learn-rg'
cluster-name: 'eshop-learn-aks'

- name: Get code from the repository
uses: actions/checkout@v3
with:
ref: main

- name: Helm tool installer
uses: Azure/setup-helm@v1

- name: Deploy
run: >
helm upgrade
--install eshoplearn-coupon
--namespace=default
--set registry=${{ secrets.REGISTRY_LOGIN_SERVER }}
--set imagePullPolicy=Always
--set host=${{ secrets.IP_ADDRESS }}
--set protocol=http './deploy/k8s/helm-simple/coupon'
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: eShop build

on:
push:
paths:
- 'src/Services/Coupon/**'
- 'tests/Services/Coupon/**'
branches: [ main ]

jobs:
build-and-push-docker-image:
runs-on: ubuntu-latest
steps:
- name: Get code from the repository
uses: actions/checkout@v1
with:
ref: main

- name: Run unit tests
run: dotnet test tests/Services/Coupon/*.Tests/*.csproj
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true

- name: Build and push Docker image
uses: docker/build-push-action@v1.1.0
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ${{ secrets.REGISTRY_LOGIN_SERVER }}
path: .
dockerfile: './src/Services/Coupon/Coupon.API/Dockerfile.acr'
repository: 'coupon.api'
tags: 'linux-net6-coupon'
push: true
2 changes: 1 addition & 1 deletion deploy/k8s/helm-simple/coupon/Chart.yaml
Original file line number Diff line number Diff line change
@@ -18,4 +18,4 @@ version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.0.0
appVersion: 1.2.0
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ public async Task<ActionResult<CouponDto>> GetCouponByCodeAsync(string code)

var couponDto = _mapper.Translate(coupon);

// Add LogInformation call
_logger.LogInformation("Applying coupon {CouponCode}", code);

return couponDto;
}
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ public class CouponControllerTests
[Fact]
public void Test1()
{
Assert.True(false);
Assert.True(true);
}
}
}