Skip to content

Commit 6e7abaf

Browse files
committed
initial
0 parents  commit 6e7abaf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2969
-0
lines changed

.github/CODE_OF_CONDUCT.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [[email protected]](mailto:[email protected]) with questions or concerns

.github/ISSUE_TEMPLATE.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!--
2+
IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE MIGHT BE CLOSED WITHOUT FURTHER CONSIDERATION OR INVESTIGATION
3+
-->
4+
> Please provide us with the following information:
5+
> ---------------------------------------------------------------
6+
7+
### This issue is for a: (mark with an `x`)
8+
```
9+
- [ ] bug report -> please search issues before submitting
10+
- [ ] feature request
11+
- [ ] documentation issue or request
12+
- [ ] regression (a behavior that used to work and stopped in a new release)
13+
```
14+
15+
### Minimal steps to reproduce
16+
>
17+
18+
### Any log messages given by the failure
19+
>
20+
21+
### Expected/desired behavior
22+
>
23+
24+
### OS and Version?
25+
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
26+
27+
### Versions
28+
>
29+
30+
### Mention any other details that might be useful
31+
32+
> ---------------------------------------------------------------
33+
> Thanks! We'll be in touch soon.

.github/PULL_REQUEST_TEMPLATE.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Purpose
2+
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
3+
* ...
4+
5+
## Does this introduce a breaking change?
6+
<!-- Mark one with an "x". -->
7+
```
8+
[ ] Yes
9+
[ ] No
10+
```
11+
12+
## Pull Request Type
13+
What kind of change does this Pull Request introduce?
14+
15+
<!-- Please check the one that applies to this PR using "x". -->
16+
```
17+
[ ] Bugfix
18+
[ ] Feature
19+
[ ] Code style update (formatting, local variables)
20+
[ ] Refactoring (no functional changes, no api changes)
21+
[ ] Documentation content changes
22+
[ ] Other... Please describe:
23+
```
24+
25+
## How to Test
26+
* Get the code
27+
28+
```
29+
git clone [repo-address]
30+
cd [repo-name]
31+
git checkout [branch-name]
32+
npm install
33+
```
34+
35+
* Test the code
36+
<!-- Add steps to run the tests suite and/or manually test -->
37+
```
38+
```
39+
40+
## What to Check
41+
Verify that the following are valid
42+
* ...
43+
44+
## Other Information
45+
<!-- Add any other helpful information that may be needed here. -->
+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# yaml-language-server: $schema=./with-fqdn-build.yaml
2+
name: With Dapr Build and Deploy
3+
on:
4+
workflow_run:
5+
workflows: ["With FQDN Build and Deploy"]
6+
types:
7+
- completed
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
services: [ {'imageName': 'node-dapr', 'directory': './with-dapr/container-1-node'}, {'imageName': 'dotnet-dapr', 'directory': './with-dapr/container-2-dotnet'}]
19+
permissions:
20+
contents: read
21+
packages: write
22+
outputs:
23+
containerImage-node: ${{ steps.image-tag.outputs.image-node-dapr }}
24+
containerImage-dotnet: ${{ steps.image-tag.outputs.image-dotnet-dapr }}
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
29+
# Login against a Docker registry except on PR
30+
# https://github.com/docker/login-action
31+
- name: Log into registry ${{ env.REGISTRY }}
32+
if: github.event_name != 'pull_request'
33+
uses: docker/login-action@v1
34+
with:
35+
registry: ${{ env.REGISTRY }}
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
# Extract metadata (tags, labels) for Docker
40+
# https://github.com/docker/metadata-action
41+
- name: Extract Docker metadata
42+
id: meta
43+
uses: docker/metadata-action@v3
44+
with:
45+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}
46+
tags: |
47+
type=semver,pattern={{version}}
48+
type=semver,pattern={{major}}.{{minor}}
49+
type=semver,pattern={{major}}
50+
type=ref,event=branch
51+
type=sha
52+
53+
# Build and push Docker image with Buildx (don't push on PR)
54+
# https://github.com/docker/build-push-action
55+
- name: Build and push Docker image
56+
uses: docker/build-push-action@v2
57+
with:
58+
context: ${{ matrix.services.directory }}
59+
push: ${{ github.event_name != 'pull_request' }}
60+
tags: ${{ steps.meta.outputs.tags }}
61+
labels: ${{ steps.meta.outputs.labels }}
62+
63+
- name: Output image tag
64+
id: image-tag
65+
run: echo "::set-output name=image-${{ matrix.services.imageName }}::${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}:sha-$(git rev-parse --short HEAD)" | tr '[:upper:]' '[:lower:]'
66+
67+
deploy:
68+
runs-on: ubuntu-latest
69+
needs: [build]
70+
steps:
71+
- name: Checkout repository
72+
uses: actions/checkout@v2
73+
74+
- name: Azure Login
75+
uses: azure/login@v1
76+
with:
77+
creds: ${{ secrets.AZURE_CREDENTIALS }}
78+
79+
- name: Deploy bicep
80+
uses: azure/CLI@v1
81+
with:
82+
azcliversion: 2.29.2
83+
inlineScript: |
84+
az group create -g ${{ secrets.RESOURCE_GROUP }} -l canadacentral
85+
az deployment group create -g ${{ secrets.RESOURCE_GROUP }} -f ./with-dapr/deploy/main.bicep \
86+
-p \
87+
nodeImage='${{ needs.build.outputs.containerImage-node }}' \
88+
nodePort=3000 \
89+
dotnetImage='${{ needs.build.outputs.containerImage-dotnet }}' \
90+
dotnetPort=80 \
91+
registry=${{ env.REGISTRY }} \
92+
registryUsername=${{ github.actor }} \
93+
registryPassword=${{ secrets.PACKAGES_TOKEN }}
+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# yaml-language-server: $schema=./with-fqdn-build.yaml
2+
name: With FQDN Build and Deploy
3+
on:
4+
push:
5+
branches: [ main ]
6+
# Publish semver tags as releases.
7+
tags: [ 'v*.*.*' ]
8+
workflow_dispatch:
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
services: [ {'imageName': 'node', 'directory': './with-fqdn/container-1-node'}, {'imageName': 'dotnet', 'directory': './with-fqdn/container-2-dotnet'}]
20+
permissions:
21+
contents: read
22+
packages: write
23+
outputs:
24+
containerImage-node: ${{ steps.image-tag.outputs.image-node }}
25+
containerImage-dotnet: ${{ steps.image-tag.outputs.image-dotnet }}
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v2
29+
30+
# Login against a Docker registry except on PR
31+
# https://github.com/docker/login-action
32+
- name: Log into registry ${{ env.REGISTRY }}
33+
if: github.event_name != 'pull_request'
34+
uses: docker/login-action@v1
35+
with:
36+
registry: ${{ env.REGISTRY }}
37+
username: ${{ github.actor }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
# Extract metadata (tags, labels) for Docker
41+
# https://github.com/docker/metadata-action
42+
- name: Extract Docker metadata
43+
id: meta
44+
uses: docker/metadata-action@v3
45+
with:
46+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}
47+
tags: |
48+
type=semver,pattern={{version}}
49+
type=semver,pattern={{major}}.{{minor}}
50+
type=semver,pattern={{major}}
51+
type=ref,event=branch
52+
type=sha
53+
54+
# Build and push Docker image with Buildx (don't push on PR)
55+
# https://github.com/docker/build-push-action
56+
- name: Build and push Docker image
57+
uses: docker/build-push-action@v2
58+
with:
59+
context: ${{ matrix.services.directory }}
60+
push: ${{ github.event_name != 'pull_request' }}
61+
tags: ${{ steps.meta.outputs.tags }}
62+
labels: ${{ steps.meta.outputs.labels }}
63+
64+
- name: Output image tag
65+
id: image-tag
66+
run: echo "::set-output name=image-${{ matrix.services.imageName }}::${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ matrix.services.imageName }}:sha-$(git rev-parse --short HEAD)" | tr '[:upper:]' '[:lower:]'
67+
68+
deploy:
69+
runs-on: ubuntu-latest
70+
needs: [build]
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@v2
74+
75+
- name: Azure Login
76+
uses: azure/login@v1
77+
with:
78+
creds: ${{ secrets.AZURE_CREDENTIALS }}
79+
80+
- name: Deploy bicep
81+
uses: azure/CLI@v1
82+
with:
83+
azcliversion: 2.29.2
84+
inlineScript: |
85+
az group create -g ${{ secrets.RESOURCE_GROUP }} -l canadacentral
86+
az deployment group create -g ${{ secrets.RESOURCE_GROUP }} -f ./with-fqdn/deploy/main.bicep \
87+
-p \
88+
nodeImage='${{ needs.build.outputs.containerImage-node }}' \
89+
nodePort=3000 \
90+
dotnetImage='${{ needs.build.outputs.containerImage-dotnet }}' \
91+
dotnetPort=80 \
92+
registry=${{ env.REGISTRY }} \
93+
registryUsername=${{ github.actor }} \
94+
registryPassword=${{ secrets.PACKAGES_TOKEN }}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
**/container-2-dotnet/bin
3+
**/container-2-dotnet/obj

CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## [project-title] Changelog
2+
3+
<a name="x.y.z"></a>
4+
# x.y.z (yyyy-mm-dd)
5+
6+
*Features*
7+
* ...
8+
9+
*Bug Fixes*
10+
* ...
11+
12+
*Breaking Changes*
13+
* ...

CONTRIBUTING.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributing to [project-title]
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
4+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
6+
7+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
8+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
9+
provided by the bot. You will only need to do this once across all repos using our CLA.
10+
11+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13+
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
14+
15+
- [Code of Conduct](#coc)
16+
- [Issues and Bugs](#issue)
17+
- [Feature Requests](#feature)
18+
- [Submission Guidelines](#submit)
19+
20+
## <a name="coc"></a> Code of Conduct
21+
Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
22+
23+
## <a name="issue"></a> Found an Issue?
24+
If you find a bug in the source code or a mistake in the documentation, you can help us by
25+
[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
26+
[submit a Pull Request](#submit-pr) with a fix.
27+
28+
## <a name="feature"></a> Want a Feature?
29+
You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub
30+
Repository. If you would like to *implement* a new feature, please submit an issue with
31+
a proposal for your work first, to be sure that we can use it.
32+
33+
* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
34+
35+
## <a name="submit"></a> Submission Guidelines
36+
37+
### <a name="submit-issue"></a> Submitting an Issue
38+
Before you submit an issue, search the archive, maybe your question was already answered.
39+
40+
If your issue appears to be a bug, and hasn't been reported, open a new issue.
41+
Help us to maximize the effort we can spend fixing issues and adding new
42+
features, by not reporting duplicate issues. Providing the following information will increase the
43+
chances of your issue being dealt with quickly:
44+
45+
* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
46+
* **Version** - what version is affected (e.g. 0.1.2)
47+
* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
48+
* **Browsers and Operating System** - is this a problem with all browsers?
49+
* **Reproduce the Error** - provide a live example or a unambiguous set of steps
50+
* **Related Issues** - has a similar issue been reported before?
51+
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
52+
causing the problem (line of code or commit)
53+
54+
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].
55+
56+
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
57+
Before you submit your Pull Request (PR) consider the following guidelines:
58+
59+
* Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR
60+
that relates to your submission. You don't want to duplicate effort.
61+
62+
* Make your changes in a new git fork:
63+
64+
* Commit your changes using a descriptive commit message
65+
* Push your fork to GitHub:
66+
* In GitHub, create a pull request
67+
* If we suggest changes then:
68+
* Make the required updates.
69+
* Rebase your fork and force push to your GitHub repository (this will update your Pull Request):
70+
71+
```shell
72+
git rebase master -i
73+
git push -f
74+
```
75+
76+
That's it! Thank you for your contribution!

0 commit comments

Comments
 (0)