This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| environment { | |
| secret = credentials('TEST') | |
| } | |
| stages { | |
| stage('Example stage 1') { | |
| steps { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| environment { | |
| NAME = 'ricardo' | |
| LASTNAME = 'gonzalez' | |
| } | |
| stages { | |
| stage('Build') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| stages { | |
| stage('Deploy') { | |
| steps { | |
| retry(3){ | |
| sh 'echo hello' | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| stages { | |
| stage('Timeout') { | |
| steps { | |
| retry(3) { | |
| sh 'I am not going to work :c' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| stages { | |
| stage('Build') { | |
| steps { | |
| sh 'echo "My first pipeline"' | |
| sh ''' | |
| echo "By the way, I can do more stuff in here" | |
| ls -lah |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pipeline { | |
| agent any | |
| stages { | |
| stage('Build') { | |
| steps { | |
| echo 'Building..' | |
| } | |
| } | |
| stage('Test') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Jenkinsfile (Scripted Pipeline) | |
| node { | |
| stage('Build') { | |
| // | |
| } | |
| stage('Test') { | |
| // | |
| } | |
| stage('Deploy') { | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Jenkinsfile (Declarative Pipeline) | |
| pipeline { | |
| agent any | |
| stages { | |
| stage('Build') { | |
| steps { | |
| // | |
| } | |
| } | |
| stage('Test') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM centos | |
| RUN yum -y install openssh-server | |
| RUN useradd remote_user && \ | |
| echo "1234" | passwd remote_user --stdin && \ | |
| mkdir /home/remote_user/.ssh && \ | |
| chmod 700 /home/remote_user/.ssh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM centos | |
| RUN yum -y install openssh-server | |
| RUN useradd remote_user && \ | |
| echo "1234" | passwd remote_user --stdin && \ | |
| mkdir /home/remote_user/.ssh && \ | |
| chmod 700 /home/remote_user/.ssh |