From acbbe5c46a086911307e163a41c32666d3892a7b Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 7 Mar 2025 11:43:33 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adi=20fichero=20jenkins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f5d208c --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,61 @@ +pipeline { + agent any + + // this section configures Jenkins options + options { + + // only keep 10 logs for no more than 10 days + buildDiscarder(logRotator(daysToKeepStr: '10', numToKeepStr: '10')) + + // cause the build to time out if it runs for more than 12 hours + timeout(time: 12, unit: 'HOURS') + + // add timestamps to the log + timestamps() + } + + // this section configures triggers + triggers { + // create a cron trigger that will run the job every day at midnight + // note that the time is based on the time zone used by the server + // where Jenkins is running, not the user's time zone + cron '@midnight' + } + + // the pipeline section we all know and love: stages! :D + stages { + stage('Requirements') { + steps { + echo 'Installing requirements...' + } + } + stage('Build') { + steps { + echo 'Building..' + } + } + stage('Test') { + steps { + echo 'Testing..' + } + } + stage('Report') { + steps { + echo 'Reporting....' + } + } + } + + // the post section is a special collection of stages + // that are run after all other stages have completed + post { + + // the always stage will always be run + always { + + // the always stage can contain build steps like other stages + // a "steps{...}" section is not needed. + echo "This step will run after all other steps have finished. It will always run, even in the status of the build is not SUCCESS" + } + } +}