git-js
git-js copied to clipboard
Docker K8s pod restarts | No logs no error shown
I have been using simple-git with my node.js in one of my recent projects. It works perfectly in my local setup machine but it fails to do so in the server setup. I will try to explain in detail here.
Process & Logic: The aim behind my project is to automate the monotonous task of the git process i.e. to automate everything from taking the clone of a repo, checking out some branch, adding files through code, doing git add . and then committing and pushing changes to the remote repo.
Issue: The pod restarts without any apparent reason no console log is generated. We do get SIGTERM signal and then it restarts
The Code structure pseudocode
//step: clone _________________________________________
simpleGit({
baseDir: '',
timeout: {
block: 60 * 1000
}
}).clone()
.then(res => {console})
.catch(err => {console})
// step: checkout (in case it is different) _________________________________________
simpleGit({
baseDir: '',
timeout: {
block: 60 * 1000
}
}).checkout(name)
.then(res => {console})
.catch(err => {console})
// step: make changes _________________________________________
// in this step we write all files with node fs module to the git baseDir
// step: add files _________________________________________
simpleGit({
baseDir: '',
timeout: {
block: 60 * 1000
}
}).add('.')
.then(res => {console})
.catch(err => {console})
// step: commit _________________________________________
simpleGit({
baseDir: '',
timeout: {
block: 60 * 1000
}
}).commit(message)
.then(res => {console})
.catch(err => {console})
// step: push _________________________________________
simpleGit({
baseDir: '',
timeout: {
block: 60 * 1000
}
}).push(remoteurl, branch)
.then(res => {console})
.catch(err => {console})
`
So this fails sometimes during clone, pull, or push randomly
Looking forward to hearing from you.
Thanks