Create and push new git branch?

2018-08-07 Thread jbrooks
Hi folks,

I've googled extensively, but I haven't seen any documentation or answers 
on how to create a new git branch in Pipeline. I must be missing something 
obvious, but the Git plugin page doesn't indicate anything other than 
checking out code with credentials. Has anyone here used Jenkins to create 
a branch and then push it to remote?

Thanks!
Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/22a42e16-f0df-4dad-9e1f-3996cae8d40a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Weird bug in Calculate Changelog behavior

2017-12-21 Thread jbrooks
Hmm, that's what I was afraid of! Darn my novel approaches! *shakes fist*

Yeah, I'm looking for a way to make sure that, for manual builds, I can 
still generate changelogs for branches. It's possible there's a more 
idiomatic way to do this and I'm just not aware of it.

Thanks!
Jack

On Thursday, December 21, 2017 at 6:59:57 PM UTC-5, Mark Waite wrote:
>
> I suspect it is not interpreting that variable because variable expansion 
> is not implemented for that field.  I suspect the original author did not 
> consider variable expansion in handling that field.
>
> I think that is a novel use of the field, asking it to compute changes 
> since the last successful build.  I'm more accustomed to that field being 
> used to define a common branch against which diffs are performed.
>
> Mark Waite
>
> On Thu, Dec 21, 2017 at 4:23 PM > wrote:
>
>> Hi all-
>>
>> I'm using the "Calculate Changelog Against a Specific Branch" additional 
>> behavior, and I've used the GIT_PREVIOUS_SUCCESSFUL_COMMIT env variable. 
>> However, I'm getting this error in my build:
>>
>> Using 'Changelog to branch' strategy.
>> fatal: bad revision '^origin/$GIT_PREVIOUS_SUCCESSFUL_COMMIT'
>> ERROR: Unable to retrieve changeset
>>
>> I've attached a screenshot of the config. It's straightforward: use the 
>> origin repo, and use a variable. Why isn't this field interpolating the 
>> variable? (I've tried other variables- it just doesn't seem to respect 
>> variables at all, regardless of whether I have braces around them or not.)
>>
>> Cheers,
>> Jack
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/80a97199-bece-45e6-afec-9ae3062d7aeb%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9aabdb3f-33b1-4c26-9308-59ab316c03b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Weird bug in Calculate Changelog behavior

2017-12-21 Thread jbrooks
Hi all-

I'm using the "Calculate Changelog Against a Specific Branch" additional 
behavior, and I've used the GIT_PREVIOUS_SUCCESSFUL_COMMIT env variable. 
However, I'm getting this error in my build:

Using 'Changelog to branch' strategy.
fatal: bad revision '^origin/$GIT_PREVIOUS_SUCCESSFUL_COMMIT'
ERROR: Unable to retrieve changeset

I've attached a screenshot of the config. It's straightforward: use the 
origin repo, and use a variable. Why isn't this field interpolating the 
variable? (I've tried other variables- it just doesn't seem to respect 
variables at all, regardless of whether I have braces around them or not.)

Cheers,
Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/80a97199-bece-45e6-afec-9ae3062d7aeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Checking if params.FOO is undefined

2017-10-19 Thread jbrooks
Hi all,

Let's say I have a Jenkinsfile for a job that is normally built with Build 
Parameters, and so has params.FOO in it. Then let's say that I want to also 
be able to automatically build this using a  ultibranch pipeline job. 
Obviously, params.FOO will be undefined, causing the job to fail; is it 
possible to write the Jenkinsfile to check if a variable is undefined?

Thanks!
Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/172dd537-83d9-4850-9cdb-661377ae158a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Want to get branch or ref string from Github Web Hook on Build

2017-08-08 Thread jbrooks
Hi all,

I have my GitHub web hook working on a Pipeline job, which is great! I 
looked at the currentBuild object and my env variables, though, and I don't 
appear not have access to the branch name, or ref string (e.g. 
refs/heads/master). I know that the ref is sent as part of a payload 
(https://developer.github.com/v3/activity/events/types/#pushevent), so it 
seems reasonable to think that Jenkins would pass this data forward somehow.

I tried looking 
at http://javadoc.jenkins-ci.org/hudson/scm/ChangeLogSet.Entry.html to see 
if currentBuild.changeSets would give me anything, but I don't see it. Does 
Jenkins not know how to talk about git refs? Does it just drop everything 
on the floor except the commits?

Cheers,
Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e30f6b41-3c60-402f-933a-f79c6d0138ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Docker Build & Publish using --force=true in Pipeline?

2017-01-20 Thread jbrooks
Hi Nicolas,

Because I use the Docker Pipeline plugin in conjunction with the Amazon ECR 
plugin to push images to the Amazon ECS registry, so it saves me another 
few steps there. At this point, I might as well not use Pipeline (which is 
what I'm doing while I figure out a solution to this).

Cheers,
Jack

On Friday, January 20, 2017 at 1:43:26 AM UTC-5, nicolas de loof wrote:
>
> why not just use a plain sh "docker push foo:tag" step ? I never 
> understood what this docker.xx basic methods where for, as they just 
> replicate the plain docker CLI without extra features
>
> 2017-01-20 3:46 GMT+01:00 >:
>
>> Hi David!
>>
>> I'm not sure that follows. According to the plugin page (
>> https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Pipeline+Plugin),
>>  
>> v1.4 includes a change to "Handle recent deprecation of docker tag 
>> --force", so I've got some reason to believe that it doesn't just run 
>> docker commands. I'm certainly not running a docker command with --force in 
>> it.
>>
>> Jack
>>
>> On Thursday, January 19, 2017 at 7:56:33 PM UTC-5, David Karr wrote:
>>>
>>> The plugin just runs docker commands. If the version of docker you 
>>> have installed on the box doesn't support a "--force" parameter, it 
>>> will fail.  I have no idea what the history is of that, but it seems 
>>> likely this is the cause of your problem. 
>>>
>>> On Tue, Jan 17, 2017 at 12:58 PM,   wrote: 
>>> > All right, I was incorrect about one thing- this was NOT due to Docker 
>>> Build 
>>> > & Publish, but Docker Pipeline (formerly CloudBees Docker Pipeline). 
>>> > Supposedly, this was also resolved back in 1.4; I have 1.9.1. Can 
>>> anyone 
>>> > think of why I'm experiencing this issue in Pipeline? 
>>> > 
>>> > Thanks! 
>>> > Jack 
>>> > 
>>> > On Monday, January 16, 2017 at 9:56:55 PM UTC-5, jbr...@snapapp.com 
>>> wrote: 
>>> >> 
>>> >> Hi all, 
>>> >> 
>>> >> I'm running into an issue when executing a job to build and publish 
>>> an 
>>> >> image to a registry: 
>>> >> 
>>> >> + docker tag --force=true foo:tag foo:tag 
>>> >> unknown flag: --force 
>>> >> See 'docker tag --help'. 
>>> >> 
>>> >> The relevant bit from my Jenkinsfile: 
>>> >> 
>>> >> node { 
>>> >>   stage('deploy'){ 
>>> >> git branch: 'feature/branch', credentialsId: 'foo-key', url: 
>>> >> 'g...@github.com:bar/baz.git' 
>>> >> withDockerRegistry([credentialsId: 'ecr:us-east-1:foo-key', url: 
>>> >> 'https://etcetera/']) { 
>>> >> docker.image('foo:tag').push() 
>>> >> } 
>>> >> 
>>> >> Now, I see that the --force=true issue was resolved 
>>> >> (https://issues.jenkins-ci.org/browse/JENKINS-36188), and I've 
>>> confirmed 
>>> >> that my plugin is up to date. Has anyone run into this? I'm planning 
>>> to open 
>>> >> an issue for this unless I'm missing something. 
>>> >> 
>>> >> Thanks! 
>>> >> Jack 
>>> > 
>>> > -- 
>>> > You received this message because you are subscribed to the Google 
>>> Groups 
>>> > "Jenkins Users" group. 
>>> > To unsubscribe from this group and stop receiving emails from it, send 
>>> an 
>>> > email to jenkinsci-use...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> > 
>>> https://groups.google.com/d/msgid/jenkinsci-users/071e74d8-c5e0-4c4e-afb3-3a8e550aea6d%40googlegroups.com.
>>>  
>>>
>>> > 
>>> > For more options, visit https://groups.google.com/d/optout. 
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/0ecdf71e-6627-45e5-bfff-7d30a93d1998%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/19b3df3d-5a44-40ed-8e70-cced0cb41811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Docker Build & Publish using --force=true in Pipeline?

2017-01-19 Thread jbrooks
Hi David!

I'm not sure that follows. According to the plugin page 
(https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Pipeline+Plugin), 
v1.4 includes a change to "Handle recent deprecation of docker tag 
--force", so I've got some reason to believe that it doesn't just run 
docker commands. I'm certainly not running a docker command with --force in 
it.

Jack

On Thursday, January 19, 2017 at 7:56:33 PM UTC-5, David Karr wrote:
>
> The plugin just runs docker commands. If the version of docker you 
> have installed on the box doesn't support a "--force" parameter, it 
> will fail.  I have no idea what the history is of that, but it seems 
> likely this is the cause of your problem. 
>
> On Tue, Jan 17, 2017 at 12:58 PM,  > 
> wrote: 
> > All right, I was incorrect about one thing- this was NOT due to Docker 
> Build 
> > & Publish, but Docker Pipeline (formerly CloudBees Docker Pipeline). 
> > Supposedly, this was also resolved back in 1.4; I have 1.9.1. Can anyone 
> > think of why I'm experiencing this issue in Pipeline? 
> > 
> > Thanks! 
> > Jack 
> > 
> > On Monday, January 16, 2017 at 9:56:55 PM UTC-5, jbr...@snapapp.com 
> wrote: 
> >> 
> >> Hi all, 
> >> 
> >> I'm running into an issue when executing a job to build and publish an 
> >> image to a registry: 
> >> 
> >> + docker tag --force=true foo:tag foo:tag 
> >> unknown flag: --force 
> >> See 'docker tag --help'. 
> >> 
> >> The relevant bit from my Jenkinsfile: 
> >> 
> >> node { 
> >>   stage('deploy'){ 
> >> git branch: 'feature/branch', credentialsId: 'foo-key', url: 
> >> 'g...@github.com:bar/baz.git' 
> >> withDockerRegistry([credentialsId: 'ecr:us-east-1:foo-key', url: 
> >> 'https://etcetera/']) { 
> >> docker.image('foo:tag').push() 
> >> } 
> >> 
> >> Now, I see that the --force=true issue was resolved 
> >> (https://issues.jenkins-ci.org/browse/JENKINS-36188), and I've 
> confirmed 
> >> that my plugin is up to date. Has anyone run into this? I'm planning to 
> open 
> >> an issue for this unless I'm missing something. 
> >> 
> >> Thanks! 
> >> Jack 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Jenkins Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to jenkinsci-use...@googlegroups.com . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/jenkinsci-users/071e74d8-c5e0-4c4e-afb3-3a8e550aea6d%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/0ecdf71e-6627-45e5-bfff-7d30a93d1998%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Docker Build & Publish using --force=true in Pipeline?

2017-01-17 Thread jbrooks
All right, I was incorrect about one thing- this was NOT due to Docker 
Build & Publish, but Docker Pipeline (formerly CloudBees Docker Pipeline). 
Supposedly, this was also resolved back in 1.4; I have 1.9.1. Can anyone 
think of why I'm experiencing this issue in Pipeline?

Thanks!
Jack

On Monday, January 16, 2017 at 9:56:55 PM UTC-5, jbr...@snapapp.com wrote:
>
> Hi all,
>
> I'm running into an issue when executing a job to build and publish an 
> image to a registry:
>
> + docker tag --force=true foo:tag foo:tag
> unknown flag: --force
> See 'docker tag --help'.
>
> The relevant bit from my Jenkinsfile:
>
> node {
>   stage('deploy'){
> git branch: 'feature/branch', credentialsId: 'foo-key', url: 
> 'g...@github.com:bar/baz.git'
> withDockerRegistry([credentialsId: 'ecr:us-east-1:foo-key', url: '
> https://etcetera/']) {
> docker.image('foo:tag').push()
> }
>
> Now, I see that the --force=true issue was resolved (
> https://issues.jenkins-ci.org/browse/JENKINS-36188), and I've confirmed 
> that my plugin is up to date. Has anyone run into this? I'm planning to 
> open an issue for this unless I'm missing something.
>
> Thanks!
> Jack
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/071e74d8-c5e0-4c4e-afb3-3a8e550aea6d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Docker Build & Publish using --force=true in Pipeline?

2017-01-16 Thread jbrooks
Hi all,

I'm running into an issue when executing a job to build and publish an 
image to a registry:

+ docker tag --force=true foo:tag foo:tag
unknown flag: --force
See 'docker tag --help'.

The relevant bit from my Jenkinsfile:

node {
  stage('deploy'){
git branch: 'feature/branch', credentialsId: 'foo-key', url: 
'g...@github.com:bar/baz.git'
withDockerRegistry([credentialsId: 'ecr:us-east-1:foo-key', url: 
'https://etcetera/']) {
docker.image('foo:tag').push()
}

Now, I see that the --force=true issue was resolved 
(https://issues.jenkins-ci.org/browse/JENKINS-36188), and I've confirmed 
that my plugin is up to date. Has anyone run into this? I'm planning to 
open an issue for this unless I'm missing something.

Thanks!
Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/96b53ca1-2cc9-4c16-89b0-7e6a152dcbd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Git Plugin doesn't pull from repo .git url

2016-12-20 Thread jbrooks
Hi all,

I'm running an issue when I try to use the repository URL (the one used for 
`git clone`) of a private project in the Repository URL field:

> git rev-parse --is-inside-work-tree # timeout=10

Fetching changes from the remote Git repository
 > git config remote.origin.url g...@github.com:foo/bar.git # timeout=10
Fetching upstream changes from g...@github.com:foo/bar.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > git fetch --tags --progress g...@github.com:foo/bar.git 
 > +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException 
:
 Failed to fetch from g...@github.com:foo/bar.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803) 

at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063) 

at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094) 

at hudson.scm.SCM.checkout(SCM.java:495) 

at hudson.model.AbstractProject.checkout(AbstractProject.java:1278) 

at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
 

at 
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 

at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) 

at hudson.model.Run.execute(Run.java:1720) 

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 

at hudson.model.ResourceController.execute(ResourceController.java:98) 

at hudson.model.Executor.run(Executor.java:404) 

Caused by: hudson.plugins.git.GitException 
:
 Command "git fetch --tags --progress g...@github.com:foo/bar.git 
+refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.


If I use the project URL- that is, https://github.com/foo/bar- it's able to see 
it just fine. Is this a documentation issue, or am I supposed to be using the 
*.git repo? If so, what am I doing wrong above? I know I've got my credentials 
set up correctly.


Versions:

Jenkins ver. 2.19.4

Git Plugin: 3.0.1


Thanks!

Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c56bf7af-f20d-4e41-9c40-2b950ea6fafa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Amazon EC2 instance dies on installing Java

2016-12-05 Thread jbrooks
Hi all,

I'm using the Amazon EC2 plugin to create new agents. I've set it up to use 
the Ubuntu 16.04 AMI. Security groups, availability zones, and remote user 
(ubuntu) are all correct. The EC2 key pair is correct and successfully 
connects on testing. I specified that the root prefix should be `sudo`. 
However, when I attempt to provision a new node, I get the following:


INFO: Connecting to xxx.xxx.xxx.xxx on port 22, with timeout 1.
Dec 05, 2016 9:36:57 PM null
INFO: Connected via SSH.
Dec 05, 2016 9:36:57 PM null
INFO: Creating tmp directory (/tmp) if it does not exist
Dec 05, 2016 9:36:57 PM null
INFO: Verifying that java exists
bash: java: command not found
Dec 05, 2016 9:36:57 PM null
INFO: Installing Java
failed: Connection timed out.
failed: Connection timed out.


What am I getting wrong here?


Thanks!

Jack

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7dcf8228-8c00-4da6-a3b7-a8ab5c9e5daf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: google-login user restriction

2016-10-24 Thread jbrooks
Aha! My apologies. It looks like matrix-based security DOES work with the 
Google Login Plugin! Excellent.

Jack

On Monday, October 24, 2016 at 9:26:32 AM UTC-4, jbr...@snapapp.com wrote:
>
> Hi all, 
>
> I've been researching using the Google Login plugin 
>  to 
> authenticate users in a specific domain; however, I don't see any 
> documentation or posts that indicate that I can make access control any 
> more granular than that. Is this true? Is Google Login a binary on/off 
> switch that allows ALL accounts in a domain admin access, or none? Or are 
> there ways to fine tune this based on accounts?
>
> If the former case is true, and no granular control is possible, are there 
> other federated ID plugins that might give me what I'm looking for?
>
> Thanks!
> Jack Brooks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/491b300c-7ef7-4ab6-9f90-107a608d5f36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


google-login user restriction

2016-10-24 Thread jbrooks
Hi all, 

I've been researching using the Google Login plugin 
 to 
authenticate users in a specific domain; however, I don't see any 
documentation or posts that indicate that I can make access control any 
more granular than that. Is this true? Is Google Login a binary on/off 
switch that allows ALL accounts in a domain admin access, or none? Or are 
there ways to fine tune this based on accounts?

If the former case is true, and no granular control is possible, are there 
other federated ID plugins that might give me what I'm looking for?

Thanks!
Jack Brooks

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/18265f43-9486-48c7-ad52-b249af07c9c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.