@@ -10,24 +10,26 @@ async function addScript(
10
10
port : string ,
11
11
build_cmds : string ,
12
12
) {
13
- if ( document . resource_type === "URL" ) {
14
- await exec (
15
- `bash -c "echo 'bash ../../src/backend/utils/automate.sh -u ${ document . resource } ${ document . subdomain } ' > /hostpipe/pipe"` ,
16
- ) ;
17
- } else if ( document . resource_type === "PORT" ) {
18
- await exec (
19
- `bash -c "echo 'bash ../../src/backend/utils/automate.sh -p ${ document . resource } ${ document . subdomain } ' > /hostpipe/pipe"` ,
20
- ) ;
21
- } else if ( document . resource_type === "GITHUB" && static_content == "Yes" ) {
22
- await exec (
23
- `bash -c "echo 'bash ../../src/backend/utils/container.sh -s ${ document . subdomain } ${ document . resource } ${ env_content } ' > /hostpipe/pipe"` ,
24
- ) ;
25
- } else if ( document . resource_type === "GITHUB" && static_content == "No" ) {
26
- const dockerfile = dockerize ( stack , port , build_cmds ) ;
27
- await exec (
28
- `bash -c "echo 'bash ../../src/backend/utils/container.sh -g ${ document . subdomain } ${ document . resource } ${ env_content } ${ dockerfile } ${ port } ' > /hostpipe/pipe"` ,
29
- ) ;
30
- }
13
+ if ( document . resource_type === "URL" ) {
14
+ await exec (
15
+ `bash -c "echo 'bash ../../src/backend/utils/automate.sh -u ${ document . resource } ${ document . subdomain } ' > /hostpipe/pipe"` ,
16
+ ) ;
17
+ } else if ( document . resource_type === "PORT" ) {
18
+ await exec (
19
+ `bash -c "echo 'bash ../../src/backend/utils/automate.sh -p ${ document . resource } ${ document . subdomain } ' > /hostpipe/pipe"` ,
20
+ ) ;
21
+ } else if ( document . resource_type === "GITHUB" && static_content == "Yes" ) {
22
+ Deno . writeTextFile ( `/hostpipe/.env` , env_content )
23
+ await exec (
24
+ `bash -c "echo 'bash ../../src/backend/utils/container.sh -s ${ document . subdomain } ${ document . resource } ' > /hostpipe/pipe"` ,
25
+ ) ;
26
+ } else if ( document . resource_type === "GITHUB" && static_content == "No" ) {
27
+ let dockerfile = dockerize ( stack , port , build_cmds ) ;
28
+ Deno . writeTextFile ( `/hostpipe/Dockerfile` , dockerfile )
29
+ Deno . writeTextFile ( `/hostpipe/.env` , env_content )
30
+ await exec (
31
+ `bash -c "echo 'bash ../../src/backend/utils/container.sh -g ${ document . subdomain } ${ document . resource } ${ port } ' > /hostpipe/pipe"` ) ;
32
+ }
31
33
}
32
34
33
35
async function deleteScript ( document : DfContentMap ) {
0 commit comments