Skip to content

Commit

Permalink
Add Azure communication services demo (microsoft#249)
Browse files Browse the repository at this point in the history
* merge acs

* workflow path to tt website folder

* fetch config from relative uri

* acs in arm

* migrate PowerShell scripts from AzureRM to the Az PowerShell module

* parametrize logicapp location

* settings ACS from api

* provision composer

* telephony bot

* deployment settings

* aks settings

* rename bot settings to match github style

* aks values

* readme

* add path filter

* update reamde
  • Loading branch information
Borja García authored May 10, 2021
1 parent b689d41 commit 72bd1f1
Show file tree
Hide file tree
Showing 337 changed files with 23,558 additions and 4,055 deletions.
104 changes: 53 additions & 51 deletions .github/workflows/aks.yaml
Original file line number Diff line number Diff line change
@@ -1,51 +1,53 @@
name: Web in AKS

# Deploy the Tailwind Traders Web as a deployment in a EXISTING AKS THAT ALREADY HAS THE BACKEND INSTALLED
#
# Note: The AKS MUST HAVE TLS INSTALLED
# Please refer to https://github.com/Microsoft/TailwindTraders-Backend#enabling-ssltls-on-the-cluster-optional-but-highly-recommended and following.
# Installing the WEB on AKS without TLS enabled is NOT supported.

on:
push:
branches:
- main

jobs:
buildpush:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1

- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker build and push
working-directory: Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
docker push tailwindtraders/web:gh-${{ github.sha }}
- uses: azure/login@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'

- name: Set AKS kubectl context
uses: azure/aks-set-context@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCEGROUP_NAME }}

- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
export PATH=/usr/local/bin/helm
- name: Install Helm Chart
run: |
helm upgrade --install tailwindtraders-web ./Deploy/helm/web -f ./Deploy/helm/gvalues.yaml -f ./Deploy/helm/values.b2c.yaml --set ingress.hosts={${{ secrets.AKS_HOST_NAME }}} --set ingress.protocol=https --set ingress.tls[0].hosts={${{ secrets.AKS_HOST_NAME }}} --set ingress.tls[0].secretName=${{ secrets.AKS_TLS_SECRET_NAME }} --set image.repository=tailwindtraders/web --set image.tag=gh-${{ github.sha }}
name: Web in AKS

# Deploy the Tailwind Traders Web as a deployment in a EXISTING AKS THAT ALREADY HAS THE BACKEND INSTALLED
#
# Note: The AKS MUST HAVE TLS INSTALLED
# Please refer to https://github.com/Microsoft/TailwindTraders-Backend#enabling-ssltls-on-the-cluster-optional-but-highly-recommended and following.
# Installing the WEB on AKS without TLS enabled is NOT supported.

on:
push:
branches:
- main
paths:
- 'TailwindTraders.Website/**'

jobs:
buildpush:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v1

- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker build and push
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
docker push tailwindtraders/web:gh-${{ github.sha }}
- uses: azure/login@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'

- name: Set AKS kubectl context
uses: azure/aks-set-context@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCEGROUP_NAME }}

- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
export PATH=/usr/local/bin/helm
- name: Install Helm Chart
run: |
helm upgrade --install tailwindtraders-web ./TailwindTraders.Website/Deploy/helm/web -f ./TailwindTraders.Website/Deploy/helm/gvalues.yaml -f ./TailwindTraders.Website/Deploy/helm/values.b2c.yaml --set ingress.hosts={${{ secrets.AKS_HOST_NAME }}} --set ingress.protocol=https --set ingress.tls[0].hosts={${{ secrets.AKS_HOST_NAME }}} --set ingress.tls[0].secretName=${{ secrets.AKS_TLS_SECRET_NAME }} --set image.repository=tailwindtraders/web --set image.tag=gh-${{ github.sha }} --set acsResource=${{ secrets.ACS_RESOURCE }} --set acsConnectionString=${{ secrets.ACS_CONNECTION_STRING }} --email=${{ secrets.ACS_EMAIL }} --set logicAppUrl=${{ secrets.LOGIC_APP_URL }}
5 changes: 3 additions & 2 deletions .github/workflows/container_appservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
push:
branches:
- main

paths:
- 'TailwindTraders.Website/**'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand All @@ -23,7 +24,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker build and push
working-directory: Source/Tailwind.Traders.Web
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
docker push tailwindtraders/web:gh-${{ github.sha }}
Expand Down
36 changes: 19 additions & 17 deletions .github/workflows/pr_build_check.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
name: Build check on PR

on:
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master

- name: Docker build
working-directory: Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
name: Build check on PR

on:
pull_request:
branches: [ main ]
paths:
- 'TailwindTraders.Website/**'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master

- name: Docker build
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
8 changes: 5 additions & 3 deletions .github/workflows/regular_appservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
paths:
- 'TailwindTraders.Website/**'

jobs:
build-and-deploy:
Expand All @@ -13,11 +15,11 @@ jobs:
- uses: actions/checkout@master

- name: Install dependencies in client app
working-directory: Source/Tailwind.Traders.Web/ClientApp
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web/ClientApp
run: npm install

- name: Build and publish with dotnet
working-directory: Source/Tailwind.Traders.Web
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
dotnet build --configuration Release
dotnet publish -c Release -o publish
Expand All @@ -37,7 +39,7 @@ jobs:
with:
app-name: ${{ secrets.WEBAPP_APPSERVICE_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: Source/Tailwind.Traders.Web/publish
package: TailwindTraders.Website/Source/Tailwind.Traders.Web/publish

- name: Azure logout
run: |
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/telephony_bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy telephony bot

on:
push:
branches:
- main
paths:
- 'TailwindTradersLogicApp/**'

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master

- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}


- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14.15.0

- name: 'npm install, build, and test'
run: |
npm install
node provisionComposer.js --subscriptionId=${{ fromJson(secrets.AZURE_CREDENTIALS).subscriptionId }} --name=Bot --appPassword=${{ secrets.BOT_APP_PASSWORD }} --environment=prod --appId=${{ secrets.BOT_APP_ID }} --tenantId=${{ secrets.BOT_TENANT_ID }}
working-directory: TailwindTradersBotComposer/scripts

- name: Azure logout
run: |
az logout
8 changes: 5 additions & 3 deletions .github/workflows/tt-website.cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: TailwindTraders Website Pipelines
on:
push:
branches: [main, ]
paths:
- 'TailwindTraders.Website/**'
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
Expand All @@ -17,7 +19,7 @@ jobs:
uses: actions/checkout@master

- name: Docker build
working-directory: Source/Tailwind.Traders.Web
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
Expand All @@ -29,7 +31,7 @@ jobs:
uses: actions/checkout@master

- name: Docker build
working-directory: Source/Tailwind.Traders.Web
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
Expand All @@ -51,7 +53,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Docker build and push
working-directory: Source/Tailwind.Traders.Web
working-directory: TailwindTraders.Website/Source/Tailwind.Traders.Web
run: |
docker build . --build-arg sdkTag=5.0 --build-arg runtimeTag=5.0 -t tailwindtraders/web:gh-${{ github.sha }} -t latest
docker push tailwindtraders/web:gh-${{ github.sha }}
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## [project-title] Changelog

<a name="x.y.z"></a>
# x.y.z (yyyy-mm-dd)

*Features*
* ...

*Bug Fixes*
* ...

*Breaking Changes*
* ...
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributing to [project-title]

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

- [Code of Conduct](#coc)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)

## <a name="coc"></a> Code of Conduct
Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

## <a name="issue"></a> Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
[submit a Pull Request](#submit-pr) with a fix.

## <a name="feature"></a> Want a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub
Repository. If you would like to *implement* a new feature, please submit an issue with
a proposal for your work first, to be sure that we can use it.

* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).

## <a name="submit"></a> Submission Guidelines

### <a name="submit-issue"></a> Submitting an Issue
Before you submit an issue, search the archive, maybe your question was already answered.

If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues. Providing the following information will increase the
chances of your issue being dealt with quickly:

* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
* **Version** - what version is affected (e.g. 0.1.2)
* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
* **Browsers and Operating System** - is this a problem with all browsers?
* **Reproduce the Error** - provide a live example or a unambiguous set of steps
* **Related Issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
causing the problem (line of code or commit)

You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new].

### <a name="submit-pr"></a> Submitting a Pull Request (PR)
Before you submit your Pull Request (PR) consider the following guidelines:

* Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR
that relates to your submission. You don't want to duplicate effort.

* Make your changes in a new git fork:

* Commit your changes using a descriptive commit message
* Push your fork to GitHub:
* In GitHub, create a pull request
* If we suggest changes then:
* Make the required updates.
* Rebase your fork and force push to your GitHub repository (this will update your Pull Request):

```shell
git rebase master -i
git push -f
```

That's it! Thank you for your contribution!
Loading

0 comments on commit 72bd1f1

Please sign in to comment.