pipeline { agent any stages { stage(‘Example‘) { steps { echo ‘Hello World‘ } } } post { always { echo ‘I will always say Hello again!‘ } } }
pipeline { agent any stages { stage(‘build‘) { steps { sh ‘mkdir build21‘ } } stage(‘test‘) { steps { sh ‘touch test.txt‘ } } stage(‘deploy‘) { steps { echo ‘发布‘ } } } }
pipeline { agent any environment { CC = ‘clang‘ } stages { stage(‘Example‘) { environment { AN_ACCESS_KEY = credentials(‘my-prefined-secret-text‘) } steps { sh ‘printenv‘ } } } }
原文:https://www.cnblogs.com/hanshengli/p/13568085.html