Re: Multibranch pipeline / Gitlab integration: tag push events

2018-03-29 Thread Samuel Mutel
https://issues.jenkins-ci.org/browse/JENKINS-45838

Le jeudi 29 mars 2018 14:13:35 UTC+2, Samuel Mutel a écrit :
>
> Hello,
>
> I would like to know if someone has already setup the multibranch pipeline 
> and the gitlab integration to start a job when a tag is pushed?
>
> I setup the integration in GITLAB project, I setup also the multibranch 
> pipeline. When a code is pushing to the master branch, it is working fine.
> But if I create a new tag and push it. It is created in the tag tab in 
> multibranch pipeline but the job is not started automatically.
>
> Any idea?
>
> 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/c7de01a1-a87e-43c4-93d6-9072864b8567%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multibranch pipeline / Gitlab integration: tag push events

2018-03-29 Thread Samuel Mutel
Hello,

I would like to know if someone has already setup the multibranch pipeline 
and the gitlab integration to start a job when a tag is pushed?

I setup the integration in GITLAB project, I setup also the multibranch 
pipeline. When a code is pushing to the master branch, it is working fine.
But if I create a new tag and push it. It is created in the tag tab in 
multibranch pipeline but the job is not started automatically.

Any idea?

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/0ed526be-2644-4ece-9304-db44c30628b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bash variables defined during a step

2018-03-06 Thread Samuel Mutel
Yes it is what I did and I think it is the best way. Thanks.

Le 6 mars 2018 5:48 PM, "Victor Martinez"  a
écrit :

> GString might be a bit crazy to escape some chars, maybe it's worthy to
> create a sh file somewhere and just call it? Then you get the benefits of
> being able to call/use it without the need to be in the pipeline itself.
>
> My two cents
>
> --
> 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/3F2ozjnSiTE/unsubscribe.
> To unsubscribe from this group and all its topics, 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/af107496-9a0e-4dbf-89d7-32e60bc192f0%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/CAA3rH8aCWw4nKwZixm_Q6op8oodcDvuH5Rsm4B9pN9XT_iQ7uQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Bash variables defined during a step

2018-03-06 Thread Samuel Mutel
Hello,

I would like to define a variable in shell and to use it.
How can I do this?

For example:

sh "find packages -name internal-* -type d -exec bash -c 'for arg; do 
export VERSION=\$(grep \${arg##*/} nexus-cicd-versions.txt | cut -d: 
-f2);sed -i \'s/#VERSION#/${env.VERSION}/g\' \$arg/0/package.json; done' _ 
{} +"

The content of VERSION is the result of a grep from file. I displayed the 
variable, it works.
Now I would like to use VERSION in the sed part. But I am not able to get 
the value of VERSION.
I tried ${env.VERSION}, ${VERSION}, $VERSION, ...

Thanks for your help on this topic.

-- 
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/8d8356af-d32f-491a-9e5c-3dab8b0ff257%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Question about marathon deployment

2018-03-02 Thread Samuel Mutel
Hello,

To start a docker container through marathon, I use this piece of code 
which is working fine:

withCredentials([
  string(credentialsId: '1d759531-1e0d-40b8-a434-911d97c58d36', variable: 
'DCOS_PRIVATE_KEY')
]) {
  marathon(
url: 'http://10.86.155.5:8080',
forceUpdate: true,
credentialsId: 
'{"uid":"cicd","login_endpoint":"${env.DCOS_ENDPOINT}","scheme":"RS256","private_key":"$DCOS_PRIVATE_KEY"}',
filename: 'Marathon.json'
  )
}

The variable env.DCOS_ENDPOINT contains 
https://qdcos.xit.rxcorp.com/acs/api/v1/auth/login.
We can see that I use the IP of the leader in the url field which is not 
good. If the leader is down or if the leader has changed, the deployment 
will fail.
So I tried to replace by the line below but it does not work:

url: 'https://qdcos.xit.rxcorp.com/marathon',

I tried to connect with cicd account so I don't think that it's a issue on 
the account.
I think that it's work because the endpoint on the leader does not need any 
authentication. So in fact it works but the authentication is not mandatory.
Using the url https://qdcos.xit.rxcorp.com/marathon, the authentication 
seems to be mandatory. It's why it does not work.

Any help should be appreciated !
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/d3f49627-7f28-42c7-8ddd-de3fbb5fdc9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Build step and multibranch job

2018-03-01 Thread Samuel Mutel
The second one is working fine.
I forgot to specify the branch name.
Here is the piece of code:

build(
 job: 'CIO-CICD/universe/master',
 wait: false
)

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/4efe8906-3a40-468a-ad02-9d4c8fcefafc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Build step and multibranch job

2018-03-01 Thread Samuel Mutel
Hello,

I would like to start a multibranch job from another job in a jenkinsfile.
So I put this piece of code:

build(
  job: 'CIO-CICD/universe',
  wait: false
)

But it does not seems to work correctly ...
Any idea? How to specify the branch name?

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/e39799cf-25e6-4cfa-a208-413cbff19107%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question about credentialsId in marathon request

2018-02-15 Thread Samuel Mutel
I found a way with "withCredentials" function ...

withCredentials([
  string(credentialsId: 'XX-XX-XX-XX-XX-XX', variable: 'DCOS_PRIVATE_KEY')
]) {
  marathon(
url: 'http://XX.XX.XX.XX:8080',
forceUpdate: false,
credentialsId: 
'{"uid":"cicd","login_endpoint":"${env.DCOS_ENDPOINT}","scheme":"RS256","private_key":"$DCOS_PRIVATE_KEY"}'
,
filename: 'Marathon.json'
  )
}


Le mercredi 14 février 2018 10:38:02 UTC+1, Samuel Mutel a écrit :
>
> Hello,
>
> In the jenkins documentation I found this way to specify the credentials 
> in marathon deployment:
>
> credentialsId: 
> '{"uid":"jenkins","login_endpoint":"https://leader.mesos/acs/api/v1/auth/login","scheme":"RS256","private_key":"-BEGIN
>  RSA PRIVATE KEY-\nMIIEpAI..."}'
>
>
> It works fine but ... is it possible to store these credentials in the 
> credentials part of jenkins and use a credential id in the pipeline?
>
>
> Thanks.
>
> Regards.
>
>

-- 
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/7d989331-464c-4c90-9b9c-9f492e35ad99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Question about credentialsId in marathon request

2018-02-14 Thread Samuel Mutel
Hello,

In the jenkins documentation I found this way to specify the credentials in 
marathon deployment:

credentialsId: 
'{"uid":"jenkins","login_endpoint":"https://leader.mesos/acs/api/v1/auth/login","scheme":"RS256","private_key":"-BEGIN
 RSA PRIVATE KEY-\nMIIEpAI..."}'


It works fine but ... is it possible to store these credentials in the 
credentials part of jenkins and use a credential id in the pipeline?


Thanks.

Regards.

-- 
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/11b04200-c753-4be1-9219-b30b6c67b5a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multibranch pipeline - Gitlab CE - Hook

2017-11-09 Thread Samuel Mutel
Hello,

I would like to link Jenkins with multibranch pipeline project and GITLAB 
CE in order to automate:
  - Create / Delete branches automatically in Jenkins when it's done in GIT
  - Launch a build each time a commit or pull request is performed

What is the best way to do that?

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/9ee79334-5ef9-4b1d-a0d2-7b665026b49c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline - GIT - SSH authentication

2017-10-30 Thread Samuel Mutel
It works now with Git Plugin 3.6.3. 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/e042ee8e-61a9-4c84-9da4-2088972a4ff6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline - GIT - SSH authentication

2017-10-26 Thread Samuel Mutel
Indexing requires read access to the repository... so that it can, you 
know, see what branches have a Jenkinsfile
=> OK but why the module does not use the SSH key for that operation? Is-it 
a bug?

-- 
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/b56235c8-c402-447a-b385-33425eb4a4d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline - GIT - SSH authentication

2017-10-26 Thread Samuel Mutel
Hello,

I think I found the explanation of my issue. I setup the private key 
directly on the jenkins home and it works fine.
All my project are private in GITLAB and the module Multibranch Pipeline is 
not using the private key setup inside the job for the branch indexing.
The module use the private key after. We can see this in the log below 
(using GIT_SSH to set credentials toto).
Now the question is : could we setup a private project in GITLAB but 
authorize the branch indexing to public ... ?

Started by user Mutel, Samuel 
[Thu Oct 26 09:38:03 CEST 2017] Starting branch indexing...
 > git --version # timeout=10
 > git ls-remote 
 > ssh://g...@git.xit.rxcorp.com/CIO/schedular/schedular-frontend.git # 
 > timeout=10
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to 
ssh://g...@git.xit.rxcorp.com/CIO/schedular/schedular-frontend.git
 > git config remote.origin.url 
 > ssh://g...@git.xit.rxcorp.com/CIO/schedular/schedular-frontend.git # 
 > timeout=10
Fetching & pruning origin...
Fetching upstream changes from origin
 > git --version # timeout=10
using GIT_SSH to set credentials toto
 > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* 
 > --prune
Listing remote references...
 > git config --get remote.origin.url # timeout=10
using GIT_SSH to set credentials toto
 > git ls-remote -h 
 > ssh://g...@git.xit.rxcorp.com/CIO/schedular/schedular-frontend.git # 
 > timeout=10
Checking branches...
  Checking branch master
  ‘Jenkinsfile-test’ found
Met criteria
No changes detected: master (still at 055c9f366de388694ac5d9970da8208b8d8ea935)
Processed 1 branches
[Thu Oct 26 09:38:08 CEST 2017] Finished branch indexing. Indexing took 5 sec
Finished: SUCCESS

-- 
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/12601f97-7110-4018-b437-dc052a259b88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline - GIT - SSH authentication

2017-10-25 Thread Samuel Mutel
I tried also to "enter directly" the private key but it does not work.
Something curious ... When I parse the log file of the SSH server located 
on the GITLAB server, I see error message related to a connection with 
login/password and not related to a connection with ssh key.
It's mean that the job is not using ssh key at all.

-- 
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/dcc7d24b-7cc5-49e7-9787-dacdc69843cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multibranch Pipeline - GIT - SSH authentication

2017-10-25 Thread Samuel Mutel


Here is my multibranch config:




Here is my credential config:




Started

[Wed Oct 25 09:47:52 CEST 2017] Starting branch indexing...

 > git --version # timeout=10

 > git ls-remote 
ssh://git.xit.rxcorp.com/CIO/schedular/schedular-frontend.git # timeout=10

ERROR: [Wed Oct 25 09:48:00 CEST 2017] Could not update folder level 
actions from source f1c31476-efde-455c-983b-1a3c120cf9a0

hudson.plugins.git.GitException: Command "git ls-remote 
ssh://git.xit.rxcorp.com/CIO/schedular/schedular-frontend.git" returned 
status code 128:

stdout: 

stderr: 

Permission denied, please try again.

Permission denied, please try again.

Received disconnect from 10.121.1.11 port 22:2: Too many authentication 
failures

Authentication failed.

fatal: Could not read from remote repository.



-- 
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/f1aeb23c-90c6-4562-9681-860d1e13aee6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multibranch Pipeline - GIT - SSH authentication

2017-10-24 Thread Samuel Mutel
Hello,

I setup a multibranch pipeline job in Jenkins.

In branch sources, I used GIT.

With this job, for GIT authentication I tried to use credentials stored in 
Jenkins:
  - SSH private key stored in the master
  - Login/Password

Unfortunately it does not work ...

ERROR: [Tue Oct 24 16:15:13 CEST 2017] Could not update folder level actions 
from source 61faff97-9161-4212-87c4-399a6b858ae0
hudson.plugins.git.GitException: Command "git ls-remote git@X:XX.git" 
returned status code 128:
stdout: 
stderr: 
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from XX.XX.XX.XX port 22:2: Too many authentication failures
Authentication failed.
fatal: Could not read from remote repository.


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/eab4181b-240e-448f-9df0-dfdc165759cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.