I have to deploy my web application (which is made in React) in Apache2 using Jenkins.
I want jenkins instead of redirecting the repository data to "Building in workspace /var/jenkins_home/workspace/" to automatically redirect them to "/var/www/" and build the build there when a push is made and so on updating the website automatically.
I've been looking for many parts and I can't find information that can help me, I don't know if it's possible.
I use Ubuntu as operating system, but later I will deploy the Jenkins server to CentOS Stream.
So information for either one can work for me.
Try using bash command but it didn't work
"dir("folder") { sh "pwd" }"
In folder I added the path to "/www/var/home/osboxes/jenkins/var/jenkins_home/workspace/CI - CD" but it gave me the following error:
In oders of complexity:
For all these try to use jenkins pipelines as code and commit your jenkinsfile in the project code.