Warning, /packaging/appimage-packaging/blinken-appimage/Jenkinsfile is written in an unsupported language. File is not indexed.

0001 #!groovy
0002 
0003 /*
0004 The MIT License
0005 Copyright (c) 2015-, CloudBees, Inc., and a number of other of contributors
0006 Permission is hereby granted, free of charge, to any person obtaining a copy
0007 of this software and associated documentation files (the "Software"), to deal
0008 in the Software without restriction, including without limitation the rights
0009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0010 copies of the Software, and to permit persons to whom the Software is
0011 furnished to do so, subject to the following conditions:
0012 The above copyright notice and this permission notice shall be included in
0013 all copies or substantial portions of the Software.
0014         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
0017 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0018 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0019 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
0020 THE SOFTWARE.
0021 */
0022 
0023 pipeline {
0024     agent { node { label 'linux' } }
0025     environment {
0026         WORKSPACE=pwd()
0027         HOME="/var/jenkins_home"
0028         PATH="/opt/usr/bin:$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"
0029         JOB_NAME="blinken-appimage"
0030         RBENV_VERSION="2.5.0"
0031     }
0032     options {
0033         disableConcurrentBuilds()
0034         timestamps()
0035         buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
0036     }
0037     stages {
0038             stage( 'Checkout' ) {
0039                 steps {
0040                     checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, \
0041                     extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: '.']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://anongit.kde.org/appimage-packaging']]]
0042                     checkout changelog: true, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, \
0043                     extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "$JOB_NAME/appimage-template"]], submoduleCfg: [], userRemoteConfigs: [[url: 'https://gitlab.com/sgclarkkde/appimage-tooling.git']]]
0044                     copyArtifacts projectName: "kde-kf5-artifact", selector: lastCompleted(), target: "${env.WORKSPACE}/${env.JOB_NAME}", flatten: true
0045                 }
0046             }
0047             stage( 'Setup' ) {
0048                 steps {
0049                     sh '''
0050                     echo "BUNDLE_PATH: ~/vendor/bundle" >> $HOME/.bundle/config
0051                     echo 'BUNDLE_DISABLE_SHARED_GEMS: "1"' >> $HOME/.bundle/config
0052                     '''
0053                     sh '''#!/usr/bin/env bash
0054                         set -e
0055                         echo $PATH
0056                         if [[ ! -d ~/.rbenv ]] ; then
0057                             git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
0058                             git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
0059                             git clone git://github.com/carsomyr/rbenv-bundler.git ~/.rbenv/plugins/bundler
0060                             rbenv init -
0061                             rbenv install 2.5.0
0062                             rbenv rehash
0063                         else
0064                             echo "Rbenv exists, moving on"
0065                             if [[ ! -d $HOME/.rbenv/versions/2.5.0 ]] ; then
0066                                 rbenv install 2.5.0
0067                                 rbenv rehash
0068                             fi
0069                          fi
0070                         echo 'eval "$(rbenv init -)"' >> $HOME/.bashrc && rbenv init -
0071                         '''
0072                     sh '''#!/usr/bin/env bash
0073                         set -e
0074                         if [[ ! -d $HOME/.gem ]] ; then
0075                             rm -rfv $HOME/.gem
0076                         fi
0077                         which ruby
0078                         ruby -v
0079                         gem update --system
0080                         gem install bundler && rbenv rehash
0081                         '''
0082                     }
0083             }
0084             stage( 'Build' ) {
0085                 steps {
0086                         sh 'rbenv init -'
0087                         sh 'which ruby && ruby -v'
0088                         sh '''#!/usr/bin/env bash
0089                         set -e
0090                         echo $PATH
0091                         cd $JOB_NAME && chmod +x setup.sh
0092                         bundle lock --update
0093                         bundle install
0094                         bundle show rspec
0095                         rbenv rehash
0096                         bundle list --paths
0097                         bundle env
0098                         bundle exec ruby deploy.rb
0099                         '''
0100                     }
0101             }
0102             stage('Tests') {
0103                 steps {
0104                      step([$class: 'LogParserPublisher', failBuildOnError: true, projectRulePath: "$JOB_NAME/appimage-template/parser.rules", showGraphs: true, unstableOnWarning: true, useProjectRule: true])
0105             }
0106         }
0107     }
0108             post {
0109                     always {
0110                                 archiveArtifacts artifacts: "$JOB_NAME/artifacts/*.gz", fingerprint: true
0111                     }
0112             }
0113 }