A Freelance DevOps doing container stuff and automating unhealthy amounts of software.
Need something automated or containerized? Feel free to hit me up :)
I'm not that familiar with JavaScript development, but this could do it for you:
node{stage("Checkout"){//checkout your app}stage("Build"){//Build your app}stage("Deployment"){sshPublisher(publishers:[sshPublisherDesc(configName:'',sshCredentials:[encryptedPassphrase:'{encrypted_ssh_passphrase}',key:'',keyPath:'',username:'user'],transfers:[sshTransfer(cleanRemote:false,excludes:'',execCommand:'commandToExecuteAfterTransfer',execTimeout:120000,flatten:false,makeEmptyDirs:false,noDefaultExcludes:false,patternSeparator:'[, ]+',remoteDirectory:'remoteDirectoryOfYourServer',remoteDirectorySDF:false,removePrefix:'',sourceFiles:'pathToFilesToCopy/*')],usePromotionTimestamp:false,useWorkspaceInPromotion:false,verbose:false)])}}
This is done via the SSH-Publisher Plugin. Though I still do not recommend deploying via Jenkins, since the SSH and SCP Publisher Plugins are very old (2 and 10 years respectively) and may contain vulnerabilities.
Another approach would be this, which is marginally better, if your target-server supports it. This approach again, is not really recommendable either, since it requires NPM to be on a production machine, which is a bad idea tbh.
What I instead would recommend is, let Ansible or other tools take care of it.
Push your built code to a git repo and let ansible pull the production code. That way you don't need a compiler/interpreter on your prod machine. This could also be automated via jenkins easily, since it has ansible plugins that could run your playbooks after the production code is committed to git.
I love jenkins, but it's not the best tool for everything, unfortunately :D
A Freelance DevOps doing container stuff and automating unhealthy amounts of software.
Need something automated or containerized? Feel free to hit me up :)
No worries, Jenkins is a powerful tool for many use-cases and languages.
If you need advice, feel free to hit me up or answer in another comment, I've been doing continuous delivery for a few years now and got a little bit of experience with it :D
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm not that familiar with JavaScript development, but this could do it for you:
This is done via the SSH-Publisher Plugin. Though I still do not recommend deploying via Jenkins, since the SSH and SCP Publisher Plugins are very old (2 and 10 years respectively) and may contain vulnerabilities.
Another approach would be this, which is marginally better, if your target-server supports it. This approach again, is not really recommendable either, since it requires NPM to be on a production machine, which is a bad idea tbh.
What I instead would recommend is, let Ansible or other tools take care of it.
Push your built code to a git repo and let ansible pull the production code. That way you don't need a compiler/interpreter on your prod machine. This could also be automated via jenkins easily, since it has ansible plugins that could run your playbooks after the production code is committed to git.
I love jenkins, but it's not the best tool for everything, unfortunately :D
I see, I new to jenkins so I don't know, Now this is something I need to think hard about. Thank you
No worries, Jenkins is a powerful tool for many use-cases and languages.
If you need advice, feel free to hit me up or answer in another comment, I've been doing continuous delivery for a few years now and got a little bit of experience with it :D