Compare commits
2 Commits
d37ed1c01a
...
main
Author | SHA1 | Date | |
---|---|---|---|
c64143f320 | |||
3c4e465084 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -335,3 +335,5 @@ ASALocalRun/
|
|||||||
.vscode/.UserSecrets/secrets.json
|
.vscode/.UserSecrets/secrets.json
|
||||||
|
|
||||||
.vscode/jsonl/*
|
.vscode/jsonl/*
|
||||||
|
.vscode/.year-season-source
|
||||||
|
.vscode/.year-season-destination
|
67
.vscode/tasks.json
vendored
67
.vscode/tasks.json
vendored
@ -88,6 +88,73 @@
|
|||||||
],
|
],
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "podmanLogin",
|
||||||
|
"command": "podman",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"login",
|
||||||
|
"gitea.phares.duckdns.org:443"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "podmanBuild",
|
||||||
|
"command": "podman",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"-t",
|
||||||
|
"kanbn-to-quartz",
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "podmanImageList",
|
||||||
|
"command": "podman",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"image",
|
||||||
|
"ls"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "podmanRun",
|
||||||
|
"command": "podman",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"-p",
|
||||||
|
"5001:5001",
|
||||||
|
"--name",
|
||||||
|
"kanbn-to-quartz-api-001",
|
||||||
|
"a3de856b5731"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "podmanTag",
|
||||||
|
"command": "podman",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"tag",
|
||||||
|
"a3de856b5731",
|
||||||
|
"gitea.phares.duckdns.org:443/phares3757/kanbn-to-quartz:latest"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "podmanPush",
|
||||||
|
"command": "podman",
|
||||||
|
"type": "process",
|
||||||
|
"args": [
|
||||||
|
"push",
|
||||||
|
"gitea.phares.duckdns.org:443/phares3757/kanbn-to-quartz:latest"
|
||||||
|
],
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Publish AOT",
|
"label": "Publish AOT",
|
||||||
"command": "dotnet",
|
"command": "dotnet",
|
||||||
|
@ -23,8 +23,3 @@ EXPOSE 5001
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
ENTRYPOINT [ "dotnet", "KanbnToQuartz.dll" ]
|
ENTRYPOINT [ "dotnet", "KanbnToQuartz.dll" ]
|
||||||
|
|
||||||
# docker build -t sprint-console-001 .
|
|
||||||
# docker images ls | grep -i 001
|
|
||||||
# docker run -p 5001:5001 --name sprint-console-api-001 sprint-console-001
|
|
||||||
# docker run -p 5001:5001 --name sprint-console-api-001 sprint-console-001
|
|
@ -6,6 +6,7 @@ namespace KanbnToQuartz.Models;
|
|||||||
public record AppSettings(string Company,
|
public record AppSettings(string Company,
|
||||||
string Destination,
|
string Destination,
|
||||||
string DirectoryFindReplace,
|
string DirectoryFindReplace,
|
||||||
|
string DirectoryBFindReplace,
|
||||||
string FileFindReplace,
|
string FileFindReplace,
|
||||||
string Source,
|
string Source,
|
||||||
string TextBFindReplace,
|
string TextBFindReplace,
|
||||||
|
@ -18,6 +18,9 @@ public class CopyService
|
|||||||
List<Record> results = [];
|
List<Record> results = [];
|
||||||
string path;
|
string path;
|
||||||
string fileB;
|
string fileB;
|
||||||
|
string pathB;
|
||||||
|
string pathC;
|
||||||
|
string pathD;
|
||||||
string textB;
|
string textB;
|
||||||
string? text;
|
string? text;
|
||||||
Record record;
|
Record record;
|
||||||
@ -25,6 +28,7 @@ public class CopyService
|
|||||||
string[] lines;
|
string[] lines;
|
||||||
string pathName;
|
string pathName;
|
||||||
string directory;
|
string directory;
|
||||||
|
string[] segments;
|
||||||
string destination;
|
string destination;
|
||||||
string relativePath;
|
string relativePath;
|
||||||
string directoryName;
|
string directoryName;
|
||||||
@ -37,6 +41,7 @@ public class CopyService
|
|||||||
string sourceDirectoryName = Path.GetDirectoryName(sourceDirectory);
|
string sourceDirectoryName = Path.GetDirectoryName(sourceDirectory);
|
||||||
string destinationDirectory = Path.GetFullPath(appSettings.Destination);
|
string destinationDirectory = Path.GetFullPath(appSettings.Destination);
|
||||||
string[] directoryFindReplace = appSettings.DirectoryFindReplace.Split('|');
|
string[] directoryFindReplace = appSettings.DirectoryFindReplace.Split('|');
|
||||||
|
string[] directoryBFindReplace = appSettings.DirectoryBFindReplace.Split('|');
|
||||||
string[] files = Directory.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories);
|
string[] files = Directory.GetFiles(sourceDirectory, "*", SearchOption.AllDirectories);
|
||||||
int sourceDirectoryLength = sourceDirectory.Length;
|
int sourceDirectoryLength = sourceDirectory.Length;
|
||||||
foreach (string file in files)
|
foreach (string file in files)
|
||||||
@ -53,12 +58,33 @@ public class CopyService
|
|||||||
relativeDirectory = Path.GetRelativePath(sourceDirectoryName, directoryName);
|
relativeDirectory = Path.GetRelativePath(sourceDirectoryName, directoryName);
|
||||||
for (int i = 0; i < lines.Length; i++)
|
for (int i = 0; i < lines.Length; i++)
|
||||||
{
|
{
|
||||||
if (!lines[i].StartsWith(textBFindReplace))
|
if (!lines[i].Contains(textBFindReplace))
|
||||||
continue;
|
continue;
|
||||||
path = lines[i].Substring(textBFindReplace.Length, lines[i].Length - 1 - textBFindReplace.Length);
|
if (!lines[i].EndsWith(')') && !lines[i].EndsWith(")~~"))
|
||||||
pathName = Path.GetFileName(path);
|
continue;
|
||||||
relativePath = Path.GetRelativePath(sourceDirectoryName, path);
|
if (lines[i].StartsWith(textBFindReplace))
|
||||||
lines[i] = $"- [{pathName}]({relativePath})";
|
path = lines[i].Substring(textBFindReplace.Length, lines[i].Length - 1 - textBFindReplace.Length);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
segments = lines[i].Split("~~");
|
||||||
|
if (segments.Length < 2 || !segments[1].StartsWith(textBFindReplace))
|
||||||
|
continue;
|
||||||
|
path = segments[1].Substring(textBFindReplace.Length, segments[1].Length - 1 - textBFindReplace.Length);
|
||||||
|
}
|
||||||
|
if (string.IsNullOrEmpty(directoryBFindReplace[0]))
|
||||||
|
{
|
||||||
|
pathD = path;
|
||||||
|
pathName = Path.GetFileName(path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pathB = path.Replace(directoryBFindReplace[0], directoryBFindReplace[1]);
|
||||||
|
pathC = directoryBFindReplace[1][0] != '/' ? pathB : pathB.Replace('\\', '/');
|
||||||
|
pathName = Path.GetFileName(pathC);
|
||||||
|
pathD = $"{pathC}{directoryFindReplace[1]}{pathName}";
|
||||||
|
}
|
||||||
|
relativePath = Path.GetRelativePath(sourceDirectoryName, pathD);
|
||||||
|
lines[i] = lines[i].Replace($"{textBFindReplace}{path}", $"- [{pathName}]({relativePath}");
|
||||||
}
|
}
|
||||||
textB = string.Join(Environment.NewLine, lines);
|
textB = string.Join(Environment.NewLine, lines);
|
||||||
text = textB.Replace(textFindReplace[0], textFindReplace[1].Replace("%", relativeDirectory));
|
text = textB.Replace(textFindReplace[0], textFindReplace[1].Replace("%", relativeDirectory));
|
||||||
@ -88,6 +114,8 @@ public class CopyService
|
|||||||
|
|
||||||
public void CopyDirectory()
|
public void CopyDirectory()
|
||||||
{
|
{
|
||||||
|
if (!Directory.Exists(_AppSettings.Source))
|
||||||
|
_ = Directory.CreateDirectory(_AppSettings.Source);
|
||||||
if (Directory.Exists(_AppSettings.Destination))
|
if (Directory.Exists(_AppSettings.Destination))
|
||||||
Directory.Delete(_AppSettings.Destination, recursive: true);
|
Directory.Delete(_AppSettings.Destination, recursive: true);
|
||||||
ReadOnlyCollection<Record> records = GetRecords(_AppSettings);
|
ReadOnlyCollection<Record> records = GetRecords(_AppSettings);
|
||||||
|
Reference in New Issue
Block a user