diff --git a/DockerFile b/DockerFile index 9b4edc1..5bb4d32 100644 --- a/DockerFile +++ b/DockerFile @@ -7,5 +7,8 @@ RUN apk add git WORKDIR /App/docker-test-folder RUN git init +RUN git config --global user.email "markjameshoward@hotmail.co.uk" +RUN git config --global user.name "Mark Howard" + WORKDIR /App ENTRYPOINT ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/DockerFilePub b/DockerFilePub new file mode 100644 index 0000000..aed4104 --- /dev/null +++ b/DockerFilePub @@ -0,0 +1,9 @@ +FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine + +RUN apk update +RUN apk add git + +RUN mkdir -p /my-app/docker-test-folder +WORKDIR /my-app/docker-test-folder +RUN git init +WORKDIR / diff --git a/HelperClasses/FileWatching.cs b/HelperClasses/FileWatching.cs index dc33533..3c2ee9a 100644 --- a/HelperClasses/FileWatching.cs +++ b/HelperClasses/FileWatching.cs @@ -32,6 +32,7 @@ public static void OnChanged(object sender, FileSystemEventArgs e) BatchingUpFileChanges = false; Console.WriteLine($"Batch {batch} Processing....."); + DebugMessages.FileChanged(e?.Name); GitRepoExaminer.Run(); Console.WriteLine($"Batch {batch} Completed....."); } diff --git a/Logging/DebugMessages.cs b/Logging/DebugMessages.cs index 2c8df64..304eeaf 100644 --- a/Logging/DebugMessages.cs +++ b/Logging/DebugMessages.cs @@ -2,6 +2,10 @@ public abstract class DebugMessages() { + public static void FileChanged(string filename) + { + logger?.LogDebug($"File changed: {filename}"); + } public static void FoundFileOfType(string type, string hash) { logger?.LogDebug($"Processing file of type {type.Replace('\n', ' ')} hashCode={hash}"); diff --git a/Properties/launchSettings.json b/Properties/launchSettings.json index 8650d39..5481088 100644 --- a/Properties/launchSettings.json +++ b/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "visual": { "commandName": "Project", - "commandLineArgs": "-p /App/docker-test-folder -d" + "commandLineArgs": "-p c:\\dev\\test -d" } } } diff --git a/notes.txt b/notes.txt index 02c22c0..de5da79 100644 --- a/notes.txt +++ b/notes.txt @@ -1,8 +1,27 @@ -- Docker builds dotnet publish --os linux --arch x64 /t:PublishContainer --- Create the docker image manually rather than Dotnet doing it for us with /t:publishContainer -docker build -t visual-git -f DockerFile . +-- *** This is the approach currenlty working for DOCKER***** ------ + + -- Create the docker image manually rather than Dotnet doing it for us with /t:publishContainer + -- this Docker File copies over the source so we can run 'dotnet run' on the bash in docker + docker build -t visual-git -f DockerFile . + + --Then update the launch settings + { + "profiles": { + "visual": { + "commandName": "Project", + "commandLineArgs": "-p /App/docker-test-folder -d" + } + } + } + +----------------------------------------------------------------- + + +-- Create a base Image that can be used with PublishContainer +docker build -t bigusbirdicus/ashotofcode:visualgit-baseimage -f DockerFilePub . -- Building dotnet publish --os linux --self-contained true -p:PublishSingleFile=true diff --git a/visual.csproj b/visual.csproj index a01f785..55b6bad 100644 --- a/visual.csproj +++ b/visual.csproj @@ -10,6 +10,10 @@ true true + visual-git-container-dotnetpublished + docker.io/bigusbirdicus/ashotofcode:visualgit-baseimage + app + Entrypoint