deploy not working

This commit is contained in:
mbecker20
2022-04-05 04:48:29 -07:00
parent e70ca668f5
commit 29c663b4e2
8 changed files with 32 additions and 30 deletions

View File

@@ -50,8 +50,6 @@ async function cloneRepo(
githubAccount && SECRETS.GITHUB_ACCOUNTS[githubAccount]
)
: await clonePeriphery(server, deployment);
console.log("repo cloned");
console.log(cloneCle);
const onCloneCle =
server.isCore && onClone
? await execute(
@@ -62,8 +60,6 @@ async function cloneRepo(
)} && ${onClone.command}`
)
: undefined;
console.log("on clone executed");
console.log(onCloneCle);
const onPullCle =
server.isCore && onPull
? await execute(
@@ -74,8 +70,6 @@ async function cloneRepo(
)} && ${onPull.command}`
)
: undefined;
console.log("on pull executed");
console.log(onPullCle);
const { command, log, isError } = mergeCommandLogError(
{
name: "clone",
@@ -87,7 +81,6 @@ async function cloneRepo(
},
{ name: "on pull", cle: onPullCle }
);
console.log("log merged")
addDeploymentUpdate(
app,
_id!,

View File

@@ -60,17 +60,6 @@ async function deployDeployment(
build && build.dockerBuildArgs
? join(build.dockerAccount || "", build.pullName!)
: undefined;
const containerMount =
deployment.repo && deployment.containerMount
? {
repoFolder: join(
SYS_DEPLOYMENT_REPO_PATH,
deployment.containerName!,
deployment.repoMount || ""
),
containerMount: deployment.containerMount,
}
: undefined;
const { command, log, isError } = server
? await deployPeriphery(
server,
@@ -84,7 +73,16 @@ async function deployDeployment(
image: image ? image : deployment.image,
},
SYSROOT,
containerMount,
deployment.repo && deployment.containerMount
? {
repoFolder: join(
SYS_DEPLOYMENT_REPO_PATH,
deployment.containerName!,
deployment.repoMount || ""
),
containerMount: deployment.containerMount,
}
: undefined,
(build && build.dockerAccount) || deployment.dockerAccount,
((build && build.dockerAccount) || deployment.dockerAccount) &&
SECRETS.DOCKER_ACCOUNTS[

View File

@@ -89,13 +89,23 @@ const Update: Component<{ update: UpdateType; showName: boolean }> = (p) => {
</pre>
<Show when={p.update.log.stderr}>
<div>stderr</div>
<pre class={combineClasses(s.Log, "scroller")}>
<pre
class={combineClasses(s.Log, "scroller")}
style={{
"max-height": p.update.log.stdout ? "30vh" : "60vh",
}}
>
{p.update.log.stderr}
</pre>
</Show>
<Show when={p.update.log.stdout}>
<div>stdout</div>
<pre class={combineClasses(s.Log, "scroller")}>
<pre
class={combineClasses(s.Log, "scroller")}
style={{
"max-height": p.update.log.stderr ? "30vh" : "60vh",
}}
>
{p.update.log.stdout}
</pre>
</Show>

View File

@@ -10,7 +10,7 @@
}
.Log {
white-space: pre-line;
white-space: pre-wrap;
overflow-wrap: anywhere;
/* word-wrap: break-word; */
tab-size: 2;
@@ -18,5 +18,7 @@
max-width: 90vw;
margin-left: 2rem;
box-sizing: border-box;
max-height: 20vh;
max-height: 30vh;
background-color: rgba(c.$darkgrey, 0.6);
padding: 1rem;
}

View File

@@ -21,7 +21,7 @@
display: grid;
width: fit-content;
/* border: solid 1px rgba(2, 107, 121, 0.25); */
background-color: c.$darkgrey;
background-color: c.$grey;
z-index: 21;
border-radius: 0.25rem;
box-sizing: border-box;
@@ -117,7 +117,7 @@
top: 100%;
left: 0;
padding: 0rem 0.5rem;
background-color: c.$darkgrey;
background-color: c.$grey;
border-radius: 0.25rem;
z-index: 30;
white-space: nowrap;
@@ -140,5 +140,5 @@
}
.SelectorItem:hover {
background-color: c.$grey;
background-color: c.$lightgrey;
}

View File

@@ -166,4 +166,5 @@ input::placeholder {
.scroller::-webkit-scrollbar-thumb {
background: rgba(252, 234, 222, 0.3);
border-radius: 0.25rem;
}

View File

@@ -22,6 +22,7 @@ const deploy = fp((app: FastifyInstance, _: {}, done: () => void) => {
}
: undefined;
await deleteContainer(deployment.containerName!);
console.log("deploying")
const log = await dockerRun(
{
...deployment,
@@ -35,6 +36,7 @@ const deploy = fp((app: FastifyInstance, _: {}, done: () => void) => {
deployment.dockerAccount &&
SECRETS.DOCKER_ACCOUNTS[deployment.dockerAccount]
);
console.log("deployed");
res.send(log);
});

View File

@@ -18,7 +18,6 @@ const git = fp((app: FastifyInstance, _: {}, done: () => void) => {
onClone,
onPull,
} = deployment;
console.log("cloning repo");
const cloneCle = await clone(
repo!,
join(CONTAINER_REPO_ROOT, containerName!),
@@ -26,7 +25,6 @@ const git = fp((app: FastifyInstance, _: {}, done: () => void) => {
branch,
githubAccount && SECRETS.GITHUB_ACCOUNTS[githubAccount]
);
console.log("repo cloned");
const onCloneCle =
onClone &&
(await execute(
@@ -36,7 +34,6 @@ const git = fp((app: FastifyInstance, _: {}, done: () => void) => {
onClone.path || ""
)} && ${onClone.command}`
));
console.log("on clone executed");
const onPullCle =
onPull &&
(await execute(
@@ -46,7 +43,6 @@ const git = fp((app: FastifyInstance, _: {}, done: () => void) => {
onPull.path || ""
)} && ${onPull.command}`
));
console.log("on pull executed");
const log = mergeCommandLogError(
{ name: "clone", cle: cloneCle },
{ name: "on clone", cle: onCloneCle },