cloudbees

Get username logged in Jenkins from Jenkins Workflow (Pipeline) Plugin

倖福魔咒の 提交于 2019-11-30 11:55:49
问题 I am using the Pipeline plugin in Jenkins by Clouldbees (the name was Workflow plugin before), I am trying to get the user name in the Groovy script but I am not able to achieve it. stage 'checkout svn' node('master') { // Get the user name logged in Jenkins } 回答1: Did you try installing the Build User Vars plugin? If so, you should be able to run node { wrap([$class: 'BuildUser']) { def user = env.BUILD_USER_ID } } or similar. 回答2: To make it work with Jenkins Pipeline: Install user build

Load file from '/conf' directory on Cloudbees

余生颓废 提交于 2019-11-30 08:20:38
问题 What we do : We run Play2 application on Cloudbees and we load a file from '/conf' directory (inside the classpath of the application). These 2 snippets work in local and at heroku Play.application().getFile("conf/myfile.json") and new File("conf/myfile.json") However, on Cloudbees, we get FileNotFoundException : java.io.FileNotFoundException: /var/genapp/apps/..../conf/myfile.json (No such file or directory) So how to load a file from classpath on Cloudbees? 回答1: Well, files in '/conf' are

Get username logged in Jenkins from Jenkins Workflow (Pipeline) Plugin

被刻印的时光 ゝ 提交于 2019-11-30 04:59:10
I am using the Pipeline plugin in Jenkins by Clouldbees (the name was Workflow plugin before), I am trying to get the user name in the Groovy script but I am not able to achieve it. stage 'checkout svn' node('master') { // Get the user name logged in Jenkins } Did you try installing the Build User Vars plugin ? If so, you should be able to run node { wrap([$class: 'BuildUser']) { def user = env.BUILD_USER_ID } } or similar. YourAboutMeIsBlank To make it work with Jenkins Pipeline: Install user build vars plugin Then run the following: pipeline { agent any stages { stage('build user') { steps {

Intermittent Error during WebSocket handshake: Unexpected response code: 400 on CloudBees

你说的曾经没有我的故事 提交于 2019-11-29 07:23:26
I am running a websocket app on CloudBees - and I intermittently see: Error during WebSocket handshake: Unexpected response code: 400 I have told it to use http 1.1 to allow Upgrades via: bees app:proxy:update http_version=1.1 And it works, but I sometimes see the error (not always). This is almost certainly due to not using https (SSL). Websocket over plain http is vulnerable to proxies in the middle (often transparent) operating at the http layer breaking the connection. This is common on cellular networks, or office networks that may use multiple wireless connections with a proxy that

Git environment variables for use in executing Jenkins shell scripts

孤街醉人 提交于 2019-11-29 03:53:54
Hope someone can help - I have the following plugin installed in my Jenkins instance - but I don't seem to be able to get hold of the Git variables below. I need these to complete our CI setup. Is there something that I'm missing? I'm passing them in like: ssh builder@10.10.10.10 "./build-pass.sh $GIT_BRANCH" https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin Environment variables The git plugin sets several environment variables you can use in your scripts: GIT_COMMIT - SHA of the current GIT_BRANCH - Name of the branch currently being used, e.g. "master" or "origin/foo" GIT_AUTHOR_EMAIL

Intermittent Error during WebSocket handshake: Unexpected response code: 400 on CloudBees

老子叫甜甜 提交于 2019-11-28 01:16:59
问题 I am running a websocket app on CloudBees - and I intermittently see: Error during WebSocket handshake: Unexpected response code: 400 I have told it to use http 1.1 to allow Upgrades via: bees app:proxy:update http_version=1.1 And it works, but I sometimes see the error (not always). 回答1: This is almost certainly due to not using https (SSL). Websocket over plain http is vulnerable to proxies in the middle (often transparent) operating at the http layer breaking the connection. This is common

Git environment variables for use in executing Jenkins shell scripts

烂漫一生 提交于 2019-11-27 18:08:06
问题 Hope someone can help - I have the following plugin installed in my Jenkins instance - but I don't seem to be able to get hold of the Git variables below. I need these to complete our CI setup. Is there something that I'm missing? I'm passing them in like: ssh builder@10.10.10.10 "./build-pass.sh $GIT_BRANCH" https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin Environment variables The git plugin sets several environment variables you can use in your scripts: GIT_COMMIT - SHA of the