Skip to content

Commit 0ead3e2

Browse files
Move code into source folder, add AppDocker+build
1 parent 40922da commit 0ead3e2

31 files changed

Lines changed: 74 additions & 134 deletions

.github/workflows/docker-image.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
push_to_registry:
13+
name: Push Docker image to Docker Hub
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out the repo
17+
uses: actions/checkout@v3
18+
19+
- name: Log in to Docker Hub
20+
uses: docker/login-action@v2.1.0
21+
with:
22+
username: ${{ secrets.DOCKER_USERNAME }}
23+
password: ${{ secrets.DOCKER_PASSWORD }}
24+
- name: Extract metadata (tags, labels) for Docker
25+
id: meta
26+
uses: docker/metadata-action@v4.3.0
27+
with:
28+
images: trfc/github-teams-user-sync
29+
- name: Build and push Docker image
30+
uses: docker/build-push-action@v3.3.0
31+
with:
32+
context: .
33+
push: true
34+
tags: ${{ steps.meta.outputs.tags }}
35+
labels: ${{ steps.meta.outputs.labels }}
36+
file: AppDockerfile

AppDockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
4+
WORKDIR /app
5+
6+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
7+
WORKDIR /src
8+
COPY . .
9+
RUN dotnet restore
10+
RUN dotnet build
11+
12+
FROM build AS publish
13+
WORKDIR "/src/source/GitHubApp"
14+
RUN dotnet publish "GitHubApp.csproj" -c Release -o /app/publish --no-self-contained
15+
16+
FROM base AS final
17+
LABEL maintainer="Joshua Miller <joshdan65@gmail.com>"
18+
LABEL repository="https://github.com/cloudpups/github-teams-user-sync"
19+
LABEL homepage="https://github.com/cloudpups/github-teams-user-sync"
20+
21+
COPY --from=publish /app/publish /
22+
ENTRYPOINT ["dotnet", "/GitHubApp.dll"]

GroupsToTeamSyncBot.sln

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ VisualStudioVersion = 17.1.32407.343
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Frontend", "source\Frontend\Frontend.csproj", "{91149BDA-7E38-4717-B8F5-204D9D4D8FB6}"
77
EndProject
8-
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "Probot", "source\Probot\Probot.njsproj", "{84D03C50-19C6-4342-AFF6-30CB7FBF7997}"
9-
EndProject
108
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubAction", "source\GitHubAction\GitHubAction.csproj", "{22367330-2173-4B10-BD3D-848892983E9D}"
119
EndProject
1210
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C70F1C56-A3B9-4E6B-92F0-044FAB1A11D1}"
@@ -16,9 +14,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1614
EndProject
1715
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gttsb.Core", "source\Gttsb.Core\Gttsb.Core.csproj", "{2994C3AF-479A-4E9C-A8C6-15FEE34FD012}"
1816
EndProject
19-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gttsb.Gh", "Gttsb.Gh\Gttsb.Gh.csproj", "{95B6B127-2BAB-47CF-A0D0-374650A3352C}"
17+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gttsb.Gh", "source\Gttsb.Gh\Gttsb.Gh.csproj", "{95B6B127-2BAB-47CF-A0D0-374650A3352C}"
2018
EndProject
21-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHubApp", "GitHubApp\GitHubApp.csproj", "{FB6BF72C-7BD3-46D4-8B8F-CBA57228FC1B}"
19+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubApp", "source\GitHubApp\GitHubApp.csproj", "{FB6BF72C-7BD3-46D4-8B8F-CBA57228FC1B}"
2220
EndProject
2321
Global
2422
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -30,10 +28,6 @@ Global
3028
{91149BDA-7E38-4717-B8F5-204D9D4D8FB6}.Debug|Any CPU.Build.0 = Debug|Any CPU
3129
{91149BDA-7E38-4717-B8F5-204D9D4D8FB6}.Release|Any CPU.ActiveCfg = Release|Any CPU
3230
{91149BDA-7E38-4717-B8F5-204D9D4D8FB6}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{84D03C50-19C6-4342-AFF6-30CB7FBF7997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{84D03C50-19C6-4342-AFF6-30CB7FBF7997}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{84D03C50-19C6-4342-AFF6-30CB7FBF7997}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{84D03C50-19C6-4342-AFF6-30CB7FBF7997}.Release|Any CPU.Build.0 = Release|Any CPU
3731
{22367330-2173-4B10-BD3D-848892983E9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3832
{22367330-2173-4B10-BD3D-848892983E9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
3933
{22367330-2173-4B10-BD3D-848892983E9D}.Release|Any CPU.ActiveCfg = Release|Any CPU

source/GitHubAction/GitHubAction.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<ProjectReference Include="..\..\Gttsb.Gh\Gttsb.Gh.csproj" />
24+
<ProjectReference Include="..\Gttsb.Gh\Gttsb.Gh.csproj" />
2525
<ProjectReference Include="..\Gttsb.Core\Gttsb.Core.csproj" />
2626
</ItemGroup>
2727

GitHubApp/ActiveDirectoryFacadeFactory.cs renamed to source/GitHubApp/ActiveDirectoryFacadeFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public ActiveDirectoryFacadeFactory(IOptions<AzureOptions> azureOptions)
1515

1616
public IActiveDirectoryFacade GetActiveDirectoryClient()
1717
{
18-
var tenantId = azureOptions.Value.TenantId;
19-
var clientId = azureOptions.Value.ClientId;
20-
var clientSecret = azureOptions.Value.ClientSecret;
18+
var tenantId = azureOptions.Value.TenantId ?? Environment.GetEnvironmentVariable("AZURE_TENANTID");
19+
var clientId = azureOptions.Value.ClientId ?? Environment.GetEnvironmentVariable("AZURE_CLIENTID"); ;
20+
var clientSecret = azureOptions.Value.ClientSecret ?? Environment.GetEnvironmentVariable("AZURE_CLIENTSECRET"); ;
2121

2222
// The client credentials flow requires that you request the
2323
// /.default scope, and preconfigure your permissions on the
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<ItemGroup>
1616
<ProjectReference Include="..\Gttsb.Gh\Gttsb.Gh.csproj" />
17-
<ProjectReference Include="..\source\Gttsb.Core\Gttsb.Core.csproj" />
17+
<ProjectReference Include="..\Gttsb.Core\Gttsb.Core.csproj" />
1818
</ItemGroup>
1919

2020
</Project>
File renamed without changes.

0 commit comments

Comments
 (0)