Compare commits

...

8 Commits

Author SHA1 Message Date
Mauricio Siu
3590f3bed2 Merge pull request #332 from Dokploy/canary
v0.6.2
2024-08-07 21:48:49 -06:00
Mauricio Siu
c70089ee53 refactor(logs): add error log in build application 2024-08-07 21:41:25 -06:00
Mauricio Siu
161e479a0b chore(version): bump version 2024-08-07 21:08:42 -06:00
Mauricio Siu
bd735bfb64 Merge pull request #331 from Dokploy/322-git-submodules-are-not-cloned
fix(git): add --recursive-submodules flag
2024-08-07 21:09:29 -06:00
Mauricio Siu
85c814620e Merge pull request #330 from Dokploy/fix/add-validation-git-source
fix(git): don't add to ssh known host when is a http or https url
2024-08-07 20:59:42 -06:00
Mauricio Siu
fb013fe4ec fix(git): add --recursive-submodules flag 2024-08-07 20:58:16 -06:00
Mauricio Siu
90a1bd9027 fix(git): don't add to ssh known host when is a http or https url 2024-08-07 20:51:27 -06:00
Mauricio Siu
610ef8f35c Update README.md 2024-08-05 10:23:46 -06:00
4 changed files with 17 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<div align="center">
<h1 align="center">Dokploy</h1>
<div>
<img style="object-fit: cover; border-radius:20px;" align="center" width="50%"src="https://raw.githubusercontent.com/Dokploy/docs/main/public/logo.png" >
<img style="object-fit: cover; border-radius:20px;" align="center" width="50%"src="https://dokploy.com/og.png" >
</div>

View File

@@ -1,6 +1,6 @@
{
"name": "dokploy",
"version": "v0.6.1",
"version": "v0.6.2",
"private": true,
"license": "Apache-2.0",
"type": "module",

View File

@@ -54,7 +54,11 @@ export const buildApplication = async (
await mechanizeDockerContainer(application);
writeStream.write("Docker Deployed: ✅");
} catch (error) {
writeStream.write("Error ❌");
if (error instanceof Error) {
writeStream.write(`Error ❌\n${error?.message}`);
} else {
writeStream.write("Error ❌");
}
throw error;
} finally {
writeStream.end();

View File

@@ -33,7 +33,9 @@ export const cloneGitRepository = async (
const knownHostsPath = path.join(SSH_PATH, "known_hosts");
try {
await addHostToKnownHosts(customGitUrl);
if (!isHttpOrHttps(customGitUrl)) {
await addHostToKnownHosts(customGitUrl);
}
await recreateDirectory(outputPath);
// const command = `GIT_SSH_COMMAND="ssh -i ${keyPath} -o UserKnownHostsFile=${knownHostsPath}" git clone --branch ${customGitBranch} --depth 1 ${customGitUrl} ${gitCopyPath} --progress`;
// const { stdout, stderr } = await execAsync(command);
@@ -56,6 +58,7 @@ export const cloneGitRepository = async (
customGitBranch,
"--depth",
"1",
"--recurse-submodules",
customGitUrl,
outputPath,
"--progress",
@@ -84,6 +87,11 @@ export const cloneGitRepository = async (
}
};
const isHttpOrHttps = (url: string): boolean => {
const regex = /^https?:\/\//;
return regex.test(url);
};
const addHostToKnownHosts = async (repositoryURL: string) => {
const { domain, port } = sanitizeRepoPathSSH(repositoryURL);
const knownHostsPath = path.join(SSH_PATH, "known_hosts");
@@ -121,7 +129,7 @@ const sanitizeRepoPathSSH = (input: string) => {
return {
user: found.groups?.user ?? "git",
domain: found.groups?.domain,
port: 22,
port: Number(found.groups?.port ?? 22),
owner: found.groups?.owner ?? "",
repo: found.groups?.repo,
get repoPath() {