Skip to content

Commit 6dfafe8

Browse files
chore: migrating repository and organization, commit with initial project structure
0 parents  commit 6dfafe8

283 files changed

Lines changed: 12902 additions & 0 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
**/.vs
2+
**/.git
3+
4+
**/bin
5+
**/obj
6+
**/.vscode
7+
**/TestResults
8+
9+
*.user
10+
*.suo
11+
*.userosscache
12+
*.sln.docstates
13+
14+
Dockerfile
15+
README.md
16+
LICENSE

.editorconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
end_of_line = crlf
9+
10+
[*.cs]
11+
dotnet_diagnostic.IDE0055.severity = error
12+
dotnet_diagnostic.IDE0029.severity = error
13+
dotnet_diagnostic.IDE0051.severity = error
14+
dotnet_diagnostic.IDE0059.severity = error
15+
dotnet_diagnostic.IDE0060.severity = error
16+
dotnet_diagnostic.IDE0074.severity = error
17+
dotnet_diagnostic.IDE2000.severity = error
18+
dotnet_diagnostic.IDE2001.severity = error
19+
dotnet_diagnostic.IDE2002.severity = error
20+
21+
dotnet_diagnostic.IDE0005.severity = error
22+
dotnet_diagnostic.CS0168.severity = error
23+
dotnet_diagnostic.CS0219.severity = error
24+
25+
dotnet_diagnostic.CS8600.severity = error
26+
dotnet_diagnostic.CS8601.severity = error
27+
dotnet_diagnostic.CS8602.severity = error
28+
dotnet_diagnostic.CS8603.severity = error
29+
dotnet_diagnostic.CS8604.severity = error
30+
31+
[*.json]
32+
indent_style = space
33+
indent_size = 4
34+
trim_trailing_whitespace = true
35+
36+
[*.{cs,json}]
37+
trim_trailing_whitespace = true

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# mongo database environment variables
2+
3+
MONGO_INITDB_ROOT_USERNAME=admin
4+
MONGO_INITDB_ROOT_PASSWORD=admin

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
* text=auto
2+
*.cs text eol=lf
3+
*.sh text eol=lf
4+
*.ps1 text eol=crlf
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: production deploy
2+
3+
on:
4+
push:
5+
branches: [master]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: build docker image
16+
run: |
17+
docker build -t httpsrichardy/federation:latest .
18+
19+
- name: login to docker hub
20+
uses: docker/login-action@v3
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: push docker image
26+
run: docker push httpsrichardy/federation:latest
27+
28+
- name: deploy via easypanel webhook
29+
run: |
30+
curl -X POST ${{ secrets.PRODUCTION_DEPLOY_URL }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: build and publish docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
docker-build-and-push:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v3
14+
15+
- name: login docker hub
16+
uses: docker/login-action@v2
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_PASSWORD }}
20+
21+
- name: build docker image
22+
run: docker build -t httpsrichardy/federation:latest .
23+
24+
- name: push docker image
25+
run: docker push httpsrichardy/federation:latest
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# we stop the application by uploading an app_offline.htm file
2+
# then we wait for a few seconds to let IIS unload the application and release file locks
3+
4+
# https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/app-offline?view=aspnetcore-10.0
5+
6+
name: staging deploy
7+
8+
on:
9+
push:
10+
branches: [master]
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: 9.0.x
24+
25+
- name: publish application
26+
run: |
27+
dotnet publish Source/HttpsRichardy.Federation.WebApi \
28+
-c Release \
29+
-r win-x64 \
30+
-o ./publish
31+
32+
- name: remove unwanted config files
33+
run: |
34+
rm -f ./publish/appsettings.json
35+
rm -f ./publish/appsettings.Development.json
36+
rm -f ./publish/web.config
37+
38+
- name: put application offline
39+
run: echo "offline" > app_offline.htm
40+
41+
- name: upload app_offline.htm
42+
run: |
43+
sudo apt-get install -y lftp
44+
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-federation.somee.com <<EOF
45+
cd /www.vinder-federation.somee.com/
46+
put app_offline.htm
47+
quit
48+
EOF
49+
50+
- name: wait for IIS
51+
run: sleep 10
52+
53+
- name: deploy publish via FTP (no delete)
54+
run: |
55+
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-federation.somee.com <<EOF
56+
set ftp:ssl-allow no
57+
set ftp:chmod false
58+
set mirror:set-permissions false
59+
set mirror:use-pget-n false
60+
61+
mirror -R ./publish /www.vinder-federation.somee.com \
62+
--only-newer \
63+
--verbose
64+
65+
quit
66+
EOF
67+
68+
- name: remove app_offline.htm
69+
run: |
70+
lftp -u ${{ secrets.FTP_USER }},${{ secrets.FTP_PASSWORD }} vinder-federation.somee.com <<EOF
71+
cd /www.vinder-federation.somee.com/
72+
rm app_offline.htm
73+
quit
74+
EOF
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: pull request validation
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: setup .NET
16+
uses: actions/setup-dotnet@v4
17+
with:
18+
dotnet-version: '9.0.x'
19+
20+
- name: restore dependencies
21+
run: dotnet restore
22+
23+
- name: build
24+
run: dotnet build --no-restore --configuration Release
25+
26+
- name: run tests
27+
run: dotnet test --no-build --configuration Release --verbosity normal

0 commit comments

Comments
 (0)