Closed vfiee closed 2 years ago
@vfiee , what is the error?
args "run install"
@vfiee , have you tried the following?
args run install
@vfiee , what is the error?
args "run install"
@vfiee , have you tried the following?
args run install
looks cd command is faild, so npm install is faild too!
{"level":"warn","ts":1664880246.4712973,"logger":"git","msg":"failed executing post-pull command","repo_name":"github-vite-demo","error":"execline-cd: usage: cd path prog...\n"}
{"level":"warn","ts":1664880247.310766,"logger":"git","msg":"failed executing post-pull command","repo_name":"github-vite-demo","error":"npm ERR! code ENOENT\nnpm ERR! syscall open\nnpm ERR! path /var/run/s6/services/caddy/package.json\nnpm ERR! errno -2\nnpm ERR! enoent ENOENT: no such file or directory, open '/var/run/s6/services/caddy/package.json'\nnpm ERR! enoent This is related to npm not being able to find a file.\nnpm ERR! enoent \n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /root/.npm/_logs/2022-10-04T10_44_06_966Z-debug-0.log\n"}
{"level":"warn","ts":1664880248.1021268,"logger":"git","msg":"failed executing post-pull command","repo_name":"github-vite-demo","error":""}
{"level":"info","ts":1664880248.102182,"logger":"git","msg":"provisioned app instance","app":"git"}
{"level":"info","ts":1664880248.102451,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00035cd90"}
{"level":"info","ts":1664880248.1030974,"logger":"http.handlers.git","msg":"provisioned plugin instance","instance_name":"git-github-vite-demo","path":"*","started_at":1664880248.1030953}
looks cd command is faild, so npm install is faild too!
@vfiee , each of the commands have its own shell. Thus, cd
path would not be retained. I suggest adding a script that performs the install. This way you only have a single post pull exec
command.
However, it could be a neat feature to add a script to execute:
{
git {
repo github-vite-demo {
base_dir /tmp/ssh
url https://github.com/vfiee/github-vite-demo.git
branch main
auth key /root/.ssh/id_rsa
post pull script {
name changeDir
content {
cd /tmp/ssh/github-vite-demo
npm run install
npm run build
}
}
}
}
}
looks cd command is faild, so npm install is faild too!
@vfiee , each of the commands have its own shell. Thus,
cd
path would not be retained. I suggest adding a script that performs the install. This way you only have a singlepost pull exec
command.However, it could be a neat feature to add a script to execute:
{ git { repo github-vite-demo { base_dir /tmp/ssh url https://github.com/vfiee/github-vite-demo.git branch main auth key /root/.ssh/id_rsa post pull script { name changeDir content { cd /tmp/ssh/github-vite-demo npm run install npm run build } } } } }
OK, thank you for your timely reply. I'm looking forward to the way shell is executed.
Running the shell is possible, thank you very much! I'll close the issues.
post pull exec {
name changeDir
command /bin/sh
args "/scripts/installAndbuild"
}
Describe the issue
Post pull exec command error
Configuration
Version Information
Provide output of
caddy list-modules -versions | grep git
below:Expected behavior
Expect the command to run successfully
Additional context