Secrets: https://support.cloudbees.com/hc/en-us/articles/203802500-Injecting-Secrets-into-Jenkins-Build-Jobs?mobile_site=true
I believe they’d be environment variables. Compiling: if you’re using maven just run mvn clean package or you could have mvn deploy push the artifact to some repository and your staging machine would just pull from that repo. For pipeline/git the following page might help: https://jenkins.io/doc/tutorials/build-a-java-app-with-maven/#fork-sample-repository On Wed, Oct 3, 2018 at 01:38 <robert.rajen...@ithands.biz> wrote: > # i don't know much about Jenkins pipeline but this is my first time and > here is what I did > > //** pipeline to get the code from git branches and deploy to the staging > or production server **// > > node { > def mvnHome > stage('Preparation') { // for display purposes > // Get some code from a GitHub repository > git 'https://github.com/jglick/simple-maven-project-with-tests.git' > // Get the Maven tool. > // ** NOTE: This 'M3' Maven tool must be configured > // ** in the global configuration. > } > stage('Execute commannds') { > //** Here you will aff the additional commands line npm > > } > } > stage('deploy staging') { > ssh $user@IP 'cd $location && git status && git pll origin staging > '\ > > } > } > > if this is right Please guide me that how do I add the staging and > production branches accordingly and if i want to compile the code on the > way how do i do that . + how do i add secret variables in the jenkins that > i can use in the pipeline script > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to jenkinsci-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/74eaf638-f1ba-4026-a67b-a2479da965e0%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/74eaf638-f1ba-4026-a67b-a2479da965e0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CADgiF9%2BY06e4jjiCtDXo5RUK6htv%3DCQA6usCB%2BYycbX_1kPxuQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.