mirror of
https://github.com/philippdieter/puppet-ldapquery.git
synced 2025-10-13 04:54:47 +00:00
Improve jenkins build and potential to publish
This commit is contained in:
parent
23d7e2402f
commit
35b795632b
6
.env.sh
Normal file
6
.env.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
if [ -x ~/.rbenv/bin/rbenv ]; then
|
||||||
|
export PATH="$HOME/.rbenv/bin:$PATH"
|
||||||
|
eval "$(~/.rbenv/bin/rbenv init -)"
|
||||||
|
fi
|
29
Jenkinsfile
vendored
29
Jenkinsfile
vendored
@ -1,19 +1,30 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
triggers { pollSCM('*/15 * * * *') }
|
||||||
|
|
||||||
|
environment {
|
||||||
|
PATH = "$PATH:~/.rbenv/bin"
|
||||||
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('bundle') {
|
stage('test') {
|
||||||
steps {
|
steps {
|
||||||
sh 'bundle'
|
sh '. .env.sh && printenv && bundle'
|
||||||
|
sh '. .env.sh && bundle exec rake test'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('rake test') {
|
|
||||||
|
stage('build') {
|
||||||
|
when {
|
||||||
|
branch 'master'
|
||||||
|
}
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
sh 'bundle exec rake test'
|
sh '. .env.sh && bundle exec rake clean'
|
||||||
}
|
sh '. .env.sh && bundle exec rake build'
|
||||||
}
|
|
||||||
stage('module:build') {
|
sh '[ "$(git rev-list -n 1 $(git tag | tail -n 1 ))" == "$(git rev-list -n 1 HEAD)" ] && bundle exec rake publish pkg/*.tar.gz'
|
||||||
steps {
|
|
||||||
sh 'bundle exec rake module:build'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,8 @@ module PuppetX
|
|||||||
tls = Puppet[:ldaptls]
|
tls = Puppet[:ldaptls]
|
||||||
ca_file = "#{Puppet[:confdir]}/ldap_ca.pem"
|
ca_file = "#{Puppet[:confdir]}/ldap_ca.pem"
|
||||||
|
|
||||||
|
# TODO if not exists ldap_ca.pem fail
|
||||||
|
|
||||||
conf = {
|
conf = {
|
||||||
host: host,
|
host: host,
|
||||||
port: port
|
port: port
|
||||||
|
Loading…
x
Reference in New Issue
Block a user