Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-10-04 Thread Hung
Well,

I have an update.  I am not sure this is as intended but here is what I had
to do to get Jenkins working on my machine.

I had to make the jenkins user a login able user.  When I su jenkins to see
what was happening with git, I notice we kept getting an error in the
keychain saying it had no keychain to store, so we finally found a way to
turn jenkins into a log able account.  

I would love to tell you how I did it, but I kind of fumble around and I
finally saw that I could switch user to jenkins and I did.  Once I did that
the Mac made a keychain for jenkins and then I was able to pass the git
portion.

When I get time to try and do it again on another Mac, I will try to record
all the stuff we tried to turn jenkins into a log able account.   If someone
already knows how would be great for someone to post that info here.



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4847122.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1475646075288-4847122.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-09-16 Thread Hung
Thanks, I will try to see if I can this to work a little more before trying
to install older version of git.  I didn't any setting for me to choose
https or ssh.  I just added the credentials in the SCM location when i added
my repo.  I chose username and password and provided both.  Here is image of
the credential in the Jenkins Credential Tab.


 

If there is a location in the Jenkins to say use https or ssh, please let me
know.



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4842697.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474082919062-4842697.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Mac Jenkins Can't Clone/fetch from GitHub

2016-09-16 Thread Hung
HI,  I am new to setting up Jenkins.  I am trying to setup a Jenkins server
on a Mac Mini.  I am having trouble with the Jenkins setup because I made a
simple project that is to sync to a github repo and then run a script. 
Unfortunately I can't get this simple project to run correctly.  I keep
getting a timeout error.  Here is a Console output.

 15:16:57 Building in workspace
/Users/Shared/Jenkins/Home/workspace/MacWitchesServers
15:16:57  > /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
15:16:57 Fetching changes from the remote Git repository
15:16:57  > /usr/bin/git config remote.origin.url
https://github.com/MyAccount/sample # timeout=10
15:16:57 Fetching upstream changes from https://github.com/MyAccount/sample
15:16:57  > /usr/bin/git --version # timeout=10
15:16:57 using GIT_ASKPASS to set credentials 
15:16:57  > /usr/bin/git fetch --tags --progress
https://github.com/MyAccount/sample +refs/heads/*:refs/remotes/origin/*
15:26:57 ERROR: Timeout after 10 minutes
15:26:57 ERROR: Error fetching remote repo 'origin'
15:26:57 hudson.plugins.git.GitException: Failed to fetch from
https://github.com/MyAccount/sample
15:26:57at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
15:26:57at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1051)
15:26:57at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1082)
15:26:57at hudson.scm.SCM.checkout(SCM.java:495)
15:26:57at
hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
15:26:57at
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
15:26:57at
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
15:26:57at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
15:26:57at hudson.model.Run.execute(Run.java:1741)
15:26:57at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
15:26:57at
hudson.model.ResourceController.execute(ResourceController.java:98)
15:26:57at hudson.model.Executor.run(Executor.java:410)
15:26:57 Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git
fetch --tags --progress https://github.com/MyAccount/sample
+refs/heads/*:refs/remotes/origin/*" returned status code 143:
15:26:57 stdout: 
15:26:57 stderr: 
15:26:57at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1752)
15:26:57at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1495)
15:26:57at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
15:26:57at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
15:26:57at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:795)
15:26:57... 11 more
15:26:57 ERROR: null

I su jenkins and did a manual git fetch and there was no issue.  Do anyone
know where I am going wrong.  I did a normal installation of jenkins and
selected plugin related to github.

I am running Jenkins ver. 2.7.4

Thank you for any help, and I stuck at this point.



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474065395598-4842626.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-09-16 Thread Hung
Hi Mark, 

Thank for for your reply and help.  I tried the public repo and I was able
to download just find.  So it does look like it is the credentials.  My
environment block ssh incoming and out going so I can't use ssh as a way to
access the private repo.

I am currently using username and password in the configuration.  That seems
to not be working here.  Any clues?  Is there a pluggin I am not using
correctly?  I have a Centos machine that was previously setup on a Jenkin
that works have these differences.

I am seeing this in the console output, "using GIT_ASKPASS to set
credentials", while the Centos one we have this, "using .gitcredentials to
set credentials"

I was searching the net and saw documentation on GIT_ASKPASS require input
from users, could it be timing out because it is not passing the data to the
GIT_ASKPASS?

How can I setup my Jenkins to use .gitcredentials instead of GIT_ASKPASS?

Thanks again for any help.



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4842693.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474080231887-4842693.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-09-19 Thread Hung
So I installed the older pluggin you link, and I am still having the same
issue.  The log still show askpass is being used.

Here is the Centos Jenkin that is working log of the git call

11:40:14 using .gitcredentials to set credentials
11:40:14  > git config --local credential.helper store
--file=/tmp/git6774799234765831045.credentials # timeout=10
11:40:14  > git fetch --tags --progress https://github.com/MyAccount/Sample
+refs/heads/*:refs/remotes/origin/*
11:40:20  > git config --local --remove-section credential # timeout=10
11:40:20  > git rev-parse refs/remotes/origin/dev^{commit} # timeout=10
11:40:20  > git rev-parse refs/remotes/origin/origin/dev^{commit} #
timeout=10
11:40:20 Checking out Revision 736768d34c48a7078b6330d8777d2c252291f961
(refs/remotes/origin/dev)
11:40:20  > git config core.sparsecheckout # timeout=10
11:40:20  > git checkout -f 736768d34c48a7078b6330d8777d2c252291f961
11:40:21  > git rev-list 736768d34c48a7078b6330d8777d2c252291f961 #
timeout=10
11:40:26 [workspace] $ /bin/sh -xe /tmp/hudson8706993192070172306.sh

Here is my Mac Jenkins logs

23:36:55 using .gitcredentials to set credentials
23:36:55  > /usr/bin/git config --local credential.username jenkins-builder
# timeout=10
23:36:55  > /usr/bin/git config --local credential.helper store
--file=/Users/Shared/Jenkins/tmp/git5395379929780946755.credentials #
timeout=10
23:36:55  > /usr/bin/git -c core.askpass=true fetch --tags --progress
https://github.com/MyAccount/Sample +refs/heads/*:refs/remotes/origin/*
23:46:55 ERROR: Timeout after 10 minutes
23:46:55  > /usr/bin/git config --local --remove-section credential #
timeout=10
23:46:55 ERROR: Error fetching remote repo 'origin'
23:46:55 hudson.plugins.git.GitException: Failed to fetch from
https://github.com/MyAccount/Sample
23:46:55at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799)
23:46:55at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055)
23:46:55at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086)
23:46:55at hudson.scm.SCM.checkout(SCM.java:495)
23:46:55at
hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
23:46:55at
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
23:46:55at
jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
23:46:55at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
23:46:55at hudson.model.Run.execute(Run.java:1741)
23:46:55at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
23:46:55at
hudson.model.ResourceController.execute(ResourceController.java:98)
23:46:55at hudson.model.Executor.run(Executor.java:410)
23:46:55 Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git
-c core.askpass=true fetch --tags --progress
https://github.com/MyAccount/Sample +refs/heads/*:refs/remotes/origin/*"
returned status code 143:
23:46:55 stdout: 
23:46:55 stderr: error: git-credential-osxkeychain died of signal 15
23:46:55 
23:46:55at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1740)
23:46:55at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1476)
23:46:55at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
23:46:55at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
23:46:55at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
23:46:55... 11 more
23:46:55 ERROR: null


This is a little different than the first error as it report an error :
 stderr: error: git-credential-osxkeychain died of signal 15

Anyone know what this error means?  Do I need to have a jenkins account on
my mac?



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4843016.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474268885996-4843016.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-09-16 Thread Hung
Yes, it is running Mac git 1.9.5, with Git LFS installed.




--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4842703.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474088499709-4842703.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-09-16 Thread Hung
I have the first, username and password.  I didn't do an id or description,
is that bad?
I will try to add another one to see if maybe I type something wrong.  

I though everything was good because when I had wrong data I get a big red
warning that it couldn't authenticate.

This is unfortunate as I was hoping I did something wrong.  I guess I have
to try and install older version.



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4842700.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474086530838-4842700.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mac Jenkins Can't Clone/fetch from GitHub

2016-09-19 Thread Hung
Hi,

So I install Jenkins on another mac, this one using my home network with no
firewalls.  I still can't get it to work.  Here is my log, also using the
older git plugin, here is the log, different error but still unable to
process git request.

using .gitcredentials to set credentials
 > git config --local credential.username voltage-builder # timeout=10
 > git config --local credential.helper store
--file=/Users/Shared/Jenkins/tmp/git3983407691039161185.credentials #
timeout=10
 > git -c core.askpass=true fetch --tags --progress
https://github.com/MyAccount/Sample +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
 > git config --local --remove-section credential # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from
https://github.com/MyAccount/Sample
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:799)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1055)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1086)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
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:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Caused by: hudson.plugins.git.GitException: Command "git -c
core.askpass=true fetch --tags --progress
https://github.com/MyAccount/Sample +refs/heads/*:refs/remotes/origin/*"
returned status code 143:
stdout: 
stderr: 
at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1740)
at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1476)
at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
at
org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:797)
... 11 more
ERROR: null
Finished: FAILURE

Anyone gotten Jenkins to work with Mac and Git before?  If so can you let me
know the step you did to get it working?

Here was my step,

Download Jenkins, run the install.

Install the plugin from Manage Plugin
Make a project, add credentials.
Run project.

Are there step I am missing?  Thanks





--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Mac-Jenkins-Can-t-Clone-fetch-from-GitHub-tp4842626p4843079.html
Sent from the Jenkins users mailing list archive at Nabble.com.

-- 
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/1474278966150-4843079.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Need suport about Reporter Output with TestNG

2014-01-26 Thread Nguyen Hung
Hi all, 

I using TestNG to report results of jobs but I met a problem about Reporter 
Output... It does not understand the HTML tags (ex: br ..) = does anyone 
have a simple method for implementing this?

Note: Please see the attachment for more details.

Thanks,
Hung Nguyen

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.
attachment: reporter output with TestNG.png

Re: Need suport about Reporter Output with TestNG

2014-02-05 Thread Nguyen Hung
Hi Shawn,

Thanks for your supports. I updated the new version of TestNG Report plugin
on Jenkins. This bug is fixed :).

Thanks,
Hung Nguyen


On Mon, Jan 27, 2014 at 11:10 PM, Shawn McCarthy
shawn.mccart...@gmail.comwrote:

 Have you tried just br instead of br/ ? I use br in my Reporter.log
 and it looks correct.


 On Sunday, January 26, 2014 8:42:15 PM UTC-7, Nguyen Hung wrote:

 Hi all,

 I using TestNG to report results of jobs but I met a problem about
 Reporter Output... It does not understand the HTML tags (ex: br ..) =
 does anyone have a simple method for implementing this?

 Note: Please see the attachment for more details.

 Thanks,
 Hung Nguyen

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Jenkins Users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/jenkinsci-users/5aNarfXKd8s/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 jenkinsci-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Jenkins in container is offline

2016-09-21 Thread Hung Suen
I posted the topic to Jenkins developers. Should have posted it here.
https://groups.google.com/d/topic/jenkinsci-dev/LCPjMbKCmGM/discussion

-- 
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/b3c1a12a-f2f7-44ab-9227-9546cd228853%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using CSS in html published on Jenkins build

2017-08-29 Thread Hung L.
Thanks for your reply.  I have problems accessing this repository through 
git.  When I clone it, it says I'm cloning an empty repository although I 
do see a readme.txt in it.  Any ideas?

On Tuesday, August 29, 2017 at 10:42:57 AM UTC-4, Reinhold Fuereder wrote:
>
> Hi Hung,
>
>  
>
> You can use so-called Jenkins User Content: see 
> https://wiki.jenkins-ci.org/display/JENKINS/User+Content for details.
>
>  
>
> E.g. I am using that for web resources in HTML Emails sent from Jenkins: I 
> am provisioning/deploying "file.png" via Ansible to " folder, typically '/var/lib/jenkins'>/userContent". It is then accessible 
> via: https:///userContent/diff.png
>
>  
>
> HTH Reinhold
>
>  
>
>  
>
> *Von:* jenkins...@googlegroups.com  [mailto:
> jenkins...@googlegroups.com ] *Im Auftrag von *Hung L.
> *Gesendet:* Dienstag, 29. August 2017 15:54
> *An:* Jenkins Users
> *Betreff:* Using CSS in html published on Jenkins build
>
>  
>
> Hi,
>
> I have a question on using CSS styles in html file that is being published 
> on Jenkins build.  After each build, we publish a summary html file on 
> Jenkins dashboard using the "Publish HTML Reports" plugin.  Our HTML has 
> reference to some CSS.  Right now, we're using inline CSS but Jenkins does 
> not allow inline CSS by default, see 
> https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy. 
>  I am able to override the default settings to allow the inline CSS, but 
> I'm not sure if that's the right thing to do.  
>
>  
>
> Right now, I'm looking for an alternative.  I know Jenkins has some 
> built-in CSS files which I hope to make a reference from our html. 
>  However, I don't know how to do it as they are referenced by a random link 
> (I think), for example:
>
>  type="text/css" />  where xx is random.  
>
>  
>
> An another alternative is to publish my own CSS file somewhere on Jenkins 
> server and make a reference to that.  However, I'm not sure how to do that.
>
>  
>
> Any suggestions?  Thanks.
>
> -- 
> 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/2b892ec2-9f0f-4866-855c-d6fc546a8ad4%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/2b892ec2-9f0f-4866-855c-d6fc546a8ad4%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/71af9a8d-8bc0-4a5d-9726-ba7474302cf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using CSS in html published on Jenkins build

2017-08-29 Thread Hung L.
Hi,
I have a question on using CSS styles in html file that is being published 
on Jenkins build.  After each build, we publish a summary html file on 
Jenkins dashboard using the "Publish HTML Reports" plugin.  Our HTML has 
reference to some CSS.  Right now, we're using inline CSS but Jenkins does 
not allow inline CSS by default, 
see 
https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy. 
 I am able to override the default settings to allow the inline CSS, but 
I'm not sure if that's the right thing to do.  

Right now, I'm looking for an alternative.  I know Jenkins has some 
built-in CSS files which I hope to make a reference from our html. 
 However, I don't know how to do it as they are referenced by a random link 
(I think), for example:
  where xx is random.  

An another alternative is to publish my own CSS file somewhere on Jenkins 
server and make a reference to that.  However, I'm not sure how to do that.

Any suggestions?  Thanks.

-- 
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/2b892ec2-9f0f-4866-855c-d6fc546a8ad4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Kubernetes-Plugin] Declarative pipelines with Pod yaml, jnlp arguments issue

2018-05-01 Thread Hung Do
Ah I thought I could just use the JNLP from the openshift-slave-maven-centos7 
<https://hub.docker.com/r/openshift/jenkins-slave-maven-centos7/>directly. 
The end goal is to do the build with the openshift-slave-maven container 
and do some integration tests with an attached mysql container, while at 
the end also do some openshift CLI commands with the maven container. For 
example, I started with the scripted pipelines syntax first. 

podTemplate(label: 'maven2', serviceAccount: 'jenkins', cloud: 'openshift', 
containers: [
 containerTemplate(name: 'jnlp', image: 
'docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9', 
alwaysPullImage: true, workingDir: '/tmp', args: '${computer.jnlpmac} 
${computer.name}', envVars: [
   containerEnvVar(key: 'MAVEN_MIRROR_URL', value: 'xx')
 ]),
 containerTemplate(name: 'mysql', image: 'mysql:5.6', alwaysPullImage: true, 
envVars: [
   containerEnvVar(key: 'MYSQL_DATABASE', value: 'xxx'),
   containerEnvVar(key: 'MYSQL_USER', value: 'xxx'),
   containerEnvVar(key: 'MYSQL_PASSWORD', value: 'xxx'),
   containerEnvVar(key: 'MYSQL_RANDOM_ROOT_PASSWORD', value: 'yes')], ports: 
[portMapping(containerPort: 3306)])], volumes: [
 emptyDirVolume(mountPath: '/var/lib/mysql')
 ]
 ) {

node('maven2') {
   stage('checkout') {
   checkout scm
   }

stage('check java') {
   sh "java -version"
   }

This worked out perfectly fine, I thought mapping  it 1:1 to the 
declarative + yaml format would achieve the same result, but that was not 
the case.

Op dinsdag 1 mei 2018 19:55:23 UTC+2 schreef Matthew Ceroni:
>
> Why even over ride the JNLP container? Just use the default and add 
> another container to the POD with your build tools (then you don't even 
> have to use the YAML format since you won't require any of the extended 
> benefits it provides). Then use the container step to execute in that 
> container.
>
> On Tuesday, May 1, 2018 at 5:53:06 AM UTC-7, Hung Do wrote:
>>
>> Hi everyone,
>>
>> I have a problem with this Jenkinsfile, which doesn't wants to build for 
>> me
>>
>> #!/usr/bin/env groovy
>>
>> pipeline {
>>   agent {
>> kubernetes {
>>   label 'maven2'
>>   cloud 'openshift'
>>   serviceAccount 'jenkins'
>>   yaml """
>> apiVersion: v1
>> kind: Pod
>> spec:
>>   containers:
>>   - name: jnlp
>> image: 
>> docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9
>> imagePullPolicy: Always
>> workingDir: /tmp
>> args: ["${computer.jnlpmac} ${computer.name}"]
>> """
>> }
>> }
>> stages {
>> stage('Check Java') {
>> steps {
>> sh 'java -version'
>> }
>> }
>> }
>> }
>>
>>
>> With this Jenkinsfile, I get the following error 
>>
>> [Pipeline] End of Pipeline
>> groovy.lang.MissingPropertyException: No such property: computer for class: 
>> groovy.lang.Binding
>> at groovy.lang.Binding.getVariable(Binding.java:63)
>> at 
>> org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:242)
>> at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:288)
>> at 
>> org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:292)
>> at 
>> org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:268)
>> at 
>> com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
>> at 
>> com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
>> at WorkflowScript.run(WorkflowScript:18)
>> at 
>> org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:56)
>> at WorkflowScript.run(WorkflowScript:3)
>> at ___cps.transform___(Native Method)
>> at 
>> com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
>> at 
>> com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
>> at 
>> com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
>> at sun.reflect.GeneratedMethodAccessor425.invoke(Unknown Source)
>> at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav

Re: [Kubernetes-Plugin] Declarative pipelines with Pod yaml, jnlp arguments issue

2018-05-01 Thread Hung Do
I have removed the 'args' parameter from the yaml in the declarative syntax 
and the container(openshift-slave-maven-centos7) just crashes unfortunately.

<https://lh3.googleusercontent.com/-I2SPhMJzWHM/Wujg6UvS0nI/AsI/TaXSid7yUg4VF5FKUw18Tbeg7xJqNOrjgCLcBGAs/s1600/Jenkinswithoutargs.png>

<https://lh3.googleusercontent.com/-I2SPhMJzWHM/Wujg6UvS0nI/AsI/TaXSid7yUg4VF5FKUw18Tbeg7xJqNOrjgCLcBGAs/s1600/Jenkinswithoutargs.png>




Op dinsdag 1 mei 2018 20:55:32 UTC+2 schreef Carlos Sanchez:
>
> Just remove the 'args' parameter, it would use environments variables 
>
> On Tue, May 1, 2018, 20:18 Hung Do <hungd...@gmail.com > 
> wrote:
>
>> Ah I thought I could just use the JNLP from the 
>> openshift-slave-maven-centos7 
>> <https://hub.docker.com/r/openshift/jenkins-slave-maven-centos7/>directly. 
>> The end goal is to do the build with the openshift-slave-maven container 
>> and do some integration tests with an attached mysql container, while at 
>> the end also do some openshift CLI commands with the maven container. For 
>> example, I started with the scripted pipelines syntax first. 
>>
>> podTemplate(label: 'maven2', serviceAccount: 'jenkins', cloud: 
>> 'openshift', containers: [
>>  containerTemplate(name: 'jnlp', image: 
>> 'docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9', 
>> alwaysPullImage: true, workingDir: '/tmp', args: '${computer.jnlpmac} ${
>> computer.name}', envVars: [
>>containerEnvVar(key: 'MAVEN_MIRROR_URL', value: 'xx')
>>  ]),
>>  containerTemplate(name: 'mysql', image: 'mysql:5.6', alwaysPullImage: 
>> true, envVars: [
>>containerEnvVar(key: 'MYSQL_DATABASE', value: 'xxx'),
>>containerEnvVar(key: 'MYSQL_USER', value: 'xxx'),
>>containerEnvVar(key: 'MYSQL_PASSWORD', value: 'xxx'),
>>containerEnvVar(key: 'MYSQL_RANDOM_ROOT_PASSWORD', value: 'yes')], 
>> ports: [portMapping(containerPort: 3306)])], volumes: [
>>  emptyDirVolume(mountPath: '/var/lib/mysql')
>>  ]
>>  ) {
>>
>> node('maven2') {
>>stage('checkout') {
>>checkout scm
>>}
>>
>> stage('check java') {
>>sh "java -version"
>>}
>>
>> This worked out perfectly fine, I thought mapping  it 1:1 to the 
>> declarative + yaml format would achieve the same result, but that was not 
>> the case.
>>
>> Op dinsdag 1 mei 2018 19:55:23 UTC+2 schreef Matthew Ceroni:
>>
>>> Why even over ride the JNLP container? Just use the default and add 
>>> another container to the POD with your build tools (then you don't even 
>>> have to use the YAML format since you won't require any of the extended 
>>> benefits it provides). Then use the container step to execute in that 
>>> container.
>>>
>>> On Tuesday, May 1, 2018 at 5:53:06 AM UTC-7, Hung Do wrote:
>>>>
>>>> Hi everyone,
>>>>
>>>> I have a problem with this Jenkinsfile, which doesn't wants to build 
>>>> for me
>>>>
>>>> #!/usr/bin/env groovy
>>>>
>>>> pipeline {
>>>>   agent {
>>>> kubernetes {
>>>>   label 'maven2'
>>>>   cloud 'openshift'
>>>>   serviceAccount 'jenkins'
>>>>   yaml """
>>>> apiVersion: v1
>>>> kind: Pod
>>>> spec:
>>>>   containers:
>>>>   - name: jnlp
>>>> image: 
>>>> docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9
>>>> imagePullPolicy: Always
>>>> workingDir: /tmp
>>>> args: ["${computer.jnlpmac} ${computer.name}"]
>>>> """
>>>> }
>>>> }
>>>> stages {
>>>> stage('Check Java') {
>>>> steps {
>>>> sh 'java -version'
>>>> }
>>>> }
>>>> }
>>>> }
>>>>
>>>>
>>>> With this Jenkinsfile, I get the following error 
>>>>
>>>> [Pipeline] End of Pipeline
>>>> groovy.lang.MissingPropertyException: No such property: computer for 
>>>> class: groovy.lang.Binding
>>>> at groovy.lang.Binding.getVariable(Binding.java:63)
>>>> at 
>>>> org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:242)
>>>> at o

Re: [Kubernetes-Plugin] Declarative pipelines with Pod yaml, jnlp arguments issue

2018-05-01 Thread Hung Do
Sorry, for another post. I don't know how to edit the previous post, I 
forgot to add this, when I removed the args parameter and saw the created 
pod with the crashing container, I have looked into the 'created yaml file' 
in Openshift and saw this :

<https://lh3.googleusercontent.com/-MqtWaGGeeDY/WujjGpNA9GI/AsU/uPIdfmE2By4u8AjLcbale0yslzGH39QHACLcBGAs/s1600/podyaml.png>


Op dinsdag 1 mei 2018 23:51:08 UTC+2 schreef Hung Do:
>
> I have removed the 'args' parameter from the yaml in the declarative 
> syntax and the container(openshift-slave-maven-centos7) just crashes 
> unfortunately.
>
>
> <https://lh3.googleusercontent.com/-I2SPhMJzWHM/Wujg6UvS0nI/AsI/TaXSid7yUg4VF5FKUw18Tbeg7xJqNOrjgCLcBGAs/s1600/Jenkinswithoutargs.png>
>
>
> <https://lh3.googleusercontent.com/-I2SPhMJzWHM/Wujg6UvS0nI/AsI/TaXSid7yUg4VF5FKUw18Tbeg7xJqNOrjgCLcBGAs/s1600/Jenkinswithoutargs.png>
>
> 
>
>
> Op dinsdag 1 mei 2018 20:55:32 UTC+2 schreef Carlos Sanchez:
>>
>> Just remove the 'args' parameter, it would use environments variables 
>>
>> On Tue, May 1, 2018, 20:18 Hung Do <hungd...@gmail.com> wrote:
>>
>>> Ah I thought I could just use the JNLP from the 
>>> openshift-slave-maven-centos7 
>>> <https://hub.docker.com/r/openshift/jenkins-slave-maven-centos7/>directly. 
>>> The end goal is to do the build with the openshift-slave-maven container 
>>> and do some integration tests with an attached mysql container, while at 
>>> the end also do some openshift CLI commands with the maven container. For 
>>> example, I started with the scripted pipelines syntax first. 
>>>
>>> podTemplate(label: 'maven2', serviceAccount: 'jenkins', cloud: 
>>> 'openshift', containers: [
>>>  containerTemplate(name: 'jnlp', image: 
>>> 'docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9'
>>> , alwaysPullImage: true, workingDir: '/tmp', args: '${computer.jnlpmac} 
>>> ${computer.name}', envVars: [
>>>containerEnvVar(key: 'MAVEN_MIRROR_URL', value: 'xx')
>>>  ]),
>>>  containerTemplate(name: 'mysql', image: 'mysql:5.6', alwaysPullImage: 
>>> true, envVars: [
>>>containerEnvVar(key: 'MYSQL_DATABASE', value: 'xxx'),
>>>containerEnvVar(key: 'MYSQL_USER', value: 'xxx'),
>>>containerEnvVar(key: 'MYSQL_PASSWORD', value: 'xxx'),
>>>containerEnvVar(key: 'MYSQL_RANDOM_ROOT_PASSWORD', value: 'yes')], 
>>> ports: [portMapping(containerPort: 3306)])], volumes: [
>>>  emptyDirVolume(mountPath: '/var/lib/mysql')
>>>  ]
>>>  ) {
>>>
>>> node('maven2') {
>>>stage('checkout') {
>>>checkout scm
>>>}
>>>
>>> stage('check java') {
>>>sh "java -version"
>>>}
>>>
>>> This worked out perfectly fine, I thought mapping  it 1:1 to the 
>>> declarative + yaml format would achieve the same result, but that was not 
>>> the case.
>>>
>>> Op dinsdag 1 mei 2018 19:55:23 UTC+2 schreef Matthew Ceroni:
>>>
>>>> Why even over ride the JNLP container? Just use the default and add 
>>>> another container to the POD with your build tools (then you don't even 
>>>> have to use the YAML format since you won't require any of the extended 
>>>> benefits it provides). Then use the container step to execute in that 
>>>> container.
>>>>
>>>> On Tuesday, May 1, 2018 at 5:53:06 AM UTC-7, Hung Do wrote:
>>>>>
>>>>> Hi everyone,
>>>>>
>>>>> I have a problem with this Jenkinsfile, which doesn't wants to build 
>>>>> for me
>>>>>
>>>>> #!/usr/bin/env groovy
>>>>>
>>>>> pipeline {
>>>>>   agent {
>>>>> kubernetes {
>>>>>   label 'maven2'
>>>>>   cloud 'openshift'
>>>>>   serviceAccount 'jenkins'
>>>>>   yaml """
>>>>> apiVersion: v1
>>>>> kind: Pod
>>>>> spec:
>>>>>   containers:
>>>>>   - name: jnlp
>>>>> image: 
>>>>> docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9
>>>>> imagePullPolicy: Always
>>>>> workingDir: /tmp
>>>>> args: ["${computer.jnlpmac} ${computer.name}"]
>>>>> """
>>>>

[Kubernetes-Plugin] Declarative pipelines with Pod yaml, jnlp arguments issue

2018-05-01 Thread Hung Do
Hi everyone,

I have a problem with this Jenkinsfile, which doesn't wants to build for me

#!/usr/bin/env groovy

pipeline {
  agent {
kubernetes {
  label 'maven2'
  cloud 'openshift'
  serviceAccount 'jenkins'
  yaml """
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: jnlp
image: 
docker-registry.default.svc:5000/cicd/jenkins-slave-maven-centos7:v3.9
imagePullPolicy: Always
workingDir: /tmp
args: ["${computer.jnlpmac} ${computer.name}"]
"""
}
}
stages {
stage('Check Java') {
steps {
sh 'java -version'
}
}
}
}


With this Jenkinsfile, I get the following error 

[Pipeline] End of Pipeline
groovy.lang.MissingPropertyException: No such property: computer for class: 
groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:63)
at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:242)
at org.kohsuke.groovy.sandbox.impl.Checker$6.call(Checker.java:288)
at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:292)
at 
org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:268)
at 
com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:29)
at 
com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
at WorkflowScript.run(WorkflowScript:18)
at 
org.jenkinsci.plugins.pipeline.modeldefinition.ModelInterpreter.call(jar:file:/var/lib/jenkins/plugins/pipeline-model-definition/WEB-INF/lib/pipeline-model-definition.jar!/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy:56)
at WorkflowScript.run(WorkflowScript:3)
at ___cps.transform___(Native Method)
at 
com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
at 
com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
at 
com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
at sun.reflect.GeneratedMethodAccessor425.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
at 
com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
at com.cloudbees.groovy.cps.Next.step(Next.java:83)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
at 
org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
at 
org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$101(SandboxContinuable.java:34)
at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.lambda$run0$0(SandboxContinuable.java:59)
at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
at 
org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:58)
at 
org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:332)
at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$200(CpsThreadGroup.java:83)
at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:244)
at 
org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:232)
at 
org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
at 
jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Finished: FAILURE


If I remove this part 

args: ["${computer.jnlpmac} ${computer.name}"]


Then the Jenkinsfile gets accepted, the pod get started, but the container 
crashes because there are no arguments. It is the official 

Re: [Kubernetes-Plugin] Declarative pipelines with Pod yaml, jnlp arguments issue

2018-05-01 Thread Hung Do
I am running on Kubernetes plug 1.6.0 and Jenkins 2.89.4 btw.

-- 
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/5968804e-1bc9-4060-ad0b-0fce1e54f85e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Docker pipeline plugin

2018-01-02 Thread Hung Do
Hi everyone,

I'm struggling a little bit with the docker pipeline plugin,
the building of small image goes well, but when I try to push it to my 
private dockerhub registry, I get the following 

[3-email_feature_jenkinsTest-5LSQUNLKW2A3IQQVQE7P6TOWAJPMB4NKMLQH3CFFATJHMGMXUSZQ]
 Running shell script
+ docker tag --force=true hungdo93/testatot 
registry.hub.docker.com/hungdo93/testatot:test
unknown flag: --force
See 'docker tag --help'.
+ docker tag hungdo93/testatot registry.hub.docker.com/hungdo93/testatot:test


[3-email_feature_jenkinsTest-5LSQUNLKW2A3IQQVQE7P6TOWAJUJAUKMLQH3CFFATJHMGMXUSZQ]
 Running shell script
+ docker push registry.hub.docker.com/hungdo93/testatot:test
The push refers to a repository [registry.hub.docker.com/hungdo93/testatot]
2c55342d652e: Preparing
28baa3bk1903: Preparing
5b1e37e74377: Preparing
04a294je844e: Preparing
denied: requested access to the resource is denied




This is the relevant part of my jenkinsfile

def dockerImage
stage('build docker') {
sh "cp -R src/main/docker target/"
sh "cp target/*.war target/docker/"
dockerImage = docker.build('hungdo93/testatot', 'target/docker')
}

stage('publish docker') {
docker.withRegistry('https://registry.hub.docker.com/', 
'docker-hub-hung') {
dockerImage.push 'test'
}
}
}




Ofcourse, I've made a username/password credentials id 'docker-hub-hung' 
and my private repo is hungdo93/testatot.
I have used the BlueOcean UI for this.

Thanks in advance!

Hung

-- 
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/02fbca3e-f045-4a16-9c74-e21ecc4b6ca0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: E/launcher - unknown error: cannot find Chrome binary

2018-05-04 Thread Liong Hung Wong

Hi Victor,

After changing the agent's docker, it works.

Thank you very much. 


On Friday, 4 May 2018 22:09:41 UTC+8, Victor Martinez wrote:
>
> It looks like you are using an agent based on the dockerhub maven 3.3.3 
> docker image, if so, are you sure that particular binary exists? you can 
> also run which google-chrome to identify where that particular binary is 
> allocated.
>
> Cheers
>
>

-- 
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/93451dca-91d5-4144-95ed-d7c49b2752af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


E/launcher - unknown error: cannot find Chrome binary

2018-05-04 Thread Liong Hung Wong

Hi,

I am getting "cannot find Chrome binary" when running step of a pipeline 
which runs protractor e2e test. Below is the full error log.

When running the same command at command prompt under the jenkins workspace 
folder, it works fine. 

I have google-chrome installed at /usr/bin/. Any idea how to resolve this 
problem?

[Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (test)[Pipeline] sh

[e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA] Running shell 
script
+ ./ng e2e

** NG Live Development Server is listening on localhost:49152, open your 
browser on http://localhost:49152/ **

 [0mDate:  [1m [37m2018-05-04T03:25:34.067Z [39m [22m [0m
 [0mHash:  [1m [37m07a7011210f50a1406eb [39m [22m [0m
 [0mTime:  [1m [37m12224 [39m [22mms [0m
 [0mchunk { [1m [33minline [39m [22m}  [1m [32minline.bundle.js, 
inline.bundle.js.map [39m [22m (inline) 3.89 kB  [1m [33m[entry] [39m [22m [1m 
[32m [rendered] [39m [22m [0m
 [0mchunk { [1m [33mmain [39m [22m}  [1m [32mmain.bundle.js, main.bundle.js.map 
[39m [22m (main) 8.15 kB  [1m [33m[initial] [39m [22m [1m [32m [rendered] [39m 
[22m [0m
 [0mchunk { [1m [33mpolyfills [39m [22m}  [1m [32mpolyfills.bundle.js, 
polyfills.bundle.js.map [39m [22m (polyfills) 204 kB  [1m [33m[initial] [39m 
[22m [1m [32m [rendered] [39m [22m [0m
 [0mchunk { [1m [33mstyles [39m [22m}  [1m [32mstyles.bundle.js, 
styles.bundle.js.map [39m [22m (styles) 14.5 kB  [1m [33m[initial] [39m [22m 
[1m [32m [rendered] [39m [22m [0m
 [0mchunk { [1m [33mvendor [39m [22m}  [1m [32mvendor.bundle.js, 
vendor.bundle.js.map [39m [22m (vendor) 2.76 MB  [1m [33m[initial] [39m [22m 
[1m [32m [rendered] [39m [22m [0m
(node:482) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use 
os.tmpdir() instead.

webpack: Compiled successfully.
[03:25:34] I/file_manager - creating folder 
/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/webdriver-manager/selenium
[03:25:34] I/update - chromedriver: unzipping chromedriver_2.38.zip
[03:25:35] I/update - chromedriver: setting permissions to 0755 for 
/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.38
[03:25:35] I/launcher - Running 1 instances of WebDriver
[03:25:35] I/direct - Using ChromeDriver directly...
[03:25:36] E/launcher - unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.38.552522 
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.10.0-42-generic 
x86_64)
[03:25:36] E/launcher - WebDriverError: unknown error: cannot find Chrome binary
  (Driver info: chromedriver=2.38.552522 
(437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Linux 4.10.0-42-generic 
x86_64)
at Object.checkLegacyResponse 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/selenium-webdriver/lib/http.js:441:30)
at 
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
at Function.createSession 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/node_modules/selenium-webdriver/chrome.js:761:15)
at Direct.getNewDriver 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/built/driverProviders/direct.js:77:33)
at Runner.createBrowser 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/built/runner.js:195:43)
at q.then.then 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/protractor/built/runner.js:339:29)
at _fulfilled 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/q/q.js:834:54)
at self.promiseDispatch.done 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch 
(/var/jenkins_home/workspace/e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA/node_modules/q/q.js:796:13)
at 

Re: E/launcher - unknown error: cannot find Chrome binary

2018-05-04 Thread Liong Hung Wong


PATH environment printed out as below 

[e2e_master-3KI5EHQHBLITI5WIC2ZWJEWJP35AENTM5ILI6HE62TNWQ7BRRVRA] Running shell 
script

+ echo /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


google-chrome is available at /usr/bin/google-chrome


My Jenkinsfile

pipeline {
agent { docker { image 'maven:3.3.3' } }
stages {
stage('build') {
steps {
sh 'mvn clean install'
}
}
stage('test') {
steps {
sh 'echo $PATH'
sh './ng e2e'
}
}
}
}


My protractor.config.js


const { SpecReporter } = require('jasmine-spec-reporter');

exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],

capabilities: {
'browserName': 'chrome',
'chromeOptions': {
'args': ['--no-sandbox', '--headless', '--disable-gpu', 
'--window-size=800,600']
}
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 3,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: 
true } }));
}
};

Regards


On Friday, 4 May 2018 18:09:47 UTC+8, Victor Martinez wrote:
>
> Can you confirm whether the PATH and environment is correctly configured 
> when running the pipeline in the agent? If you run at the very beginning 
> something like the below snippet:
>
> ...
> sh 'echo $PATH'
> ...
>
> If /usr/bin is not part of the path, then you need to figure out how to 
> configure it in the agent itself or explicitly override it with some 
> withEnv step for instance.
>
> Cheers
>

-- 
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/188e7a45-fdaf-4f04-8790-a7930b572e4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.