Re: Pipeline Changes Page

2019-06-19 Thread Quang Truong
I think I found the issue, don't know how to delete this thread so I update 
the root cause for anyone might encounter the same issue.

We use the checkout step in a shared lib with a hardcode of repository 
browser object to the old repo server

checkout(changelog: true, poll: true,
scm: [$class: 'GitSCM', branches: [[name: '*/' + branchName]],
browser: [$class: 'GitLab',
repoUrl: "/$repoDirName",
version: '8.6'],
doGenerateSubmoduleConfigurations: false,
extensions: extensions,
submoduleCfg: [],
userRemoteConfigs: [[url: repoName]]
])

Hope this can help!




-- 
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/d98d74a4-0028-45dc-8966-dd5f9579e0a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Pipeline Changes Page

2019-06-19 Thread Quang Truong
Hi,

I have a problem on the multibranch pipeline when I change the Git 
repository server in the configuration and Jenkinsfile script, everything 
is fine except the Changes page points to the old repository server for all 
the links.

I have updated all configurations in job and system configuration to the 
new repository server but seems there is a hidden place that point to the 
old one.

I can't find many documents about this Changes page and how to have the 
data generated. Got a comment:

"Jenkins keeps local workspace for each job. After the first checkout, that 
workspace will be at certain SCM revision. Next time the job runs, it will 
compare local workspace revision to latest revision on server, and get a 
changelog that way"

But I can't figure out where the local workspace is located, because we use 
the build slave and cleanup the workspace on new build so this must be on 
the master

I found in the build.xml (in 
jobs//branches//builds/



2


git@:.git




*/master


false

http:///
8.6



Please help to give a hint.

PS: I found another note in Git plugin about the Repository Browser which 
set the links in Changes page but I don't see it in any of my job 
configuration. I'm using Jenkins 2.164.3 LTS and Git plugin 3.10.0

Thanks,
Quang



-- 
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/06c02733-43fb-4b46-be5f-d0765256773f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't add SonarQube User Token to Jenkins configuration...

2019-06-19 Thread Quang Truong
Hi Jeff,

You can create the credential with "Secret text" type, which you use the 
token from Sonar as the secret text

Best Regards,
Quang

-- 
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/50886038-fe40-447d-b5b3-6d5f313c4a24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error in Manage Jenkin page

2019-06-07 Thread Quang Truong
Seems you're trying to connect to a tool app under TLS with 
un-trusted/self-signed cert. With Jenkins you have to add your cert into 
Java keystore, unfortunately I haven't success to do that so I can't add 
more comment but you can start with that for your research.

On Thursday, June 6, 2019 at 3:04:50 PM UTC-7, Vimal Kumar wrote:
>
> Guys,
>
> I'm very new to Jenkins and i am seeing below error message when i trying 
> to configure Plugin.  Any help really appreciated. 
>
> There were errors checking the update sites: SSLHandshakeException: 
> sun.security.validator.ValidatorException: PKIX path building failed: 
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find 
> valid certific
>
> Thanks
> Vimal
>

-- 
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/60265015-8f9a-443f-98f7-facc771ff5ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pipeline ignore error

2019-06-07 Thread Quang Truong
Not sure if I understand you correctly, just do try catch like java code 

Scripted:
stage ('abc') {
  try {
sh "rm file'
  } catch (e) {
echo "Error deleting file!"
  }
}

Declarative:
stage ('abc') {
  script {
try {
  sh "rm file'
} catch (e) {
  echo "Error deleting file!"
}
  }
}


-- 
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/0ef015be-3335-416f-ae2e-ae6cebbb0b1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SonarQube Server authentication token in Jenkins is default none

2019-05-31 Thread Quang Truong
>From the Credential Provider dialog, select Secret Text, then use your 
token in the secret field. You can read the detail of the credential plugin 
how to use this plugin

On Thursday, May 30, 2019 at 10:11:06 AM UTC-7, Manu pprp wrote:
>
> Hi Quang Truong,
>
> Thanks for the response.
>
> But, I would like to add "SonarQube Server *authentication token"*, not 
> the username and password. 
>
> I don't see any option to add "token" from the Credential Provider dialog 
> dropdown, could you please refer to the attached image for the same.
>
>
>
>
>>

-- 
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/8dd1ece9-773f-4260-a351-34f7e510a0cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SonarQube Server authentication token in Jenkins is default none

2019-05-29 Thread Quang Truong
Click on the Add button, select Jenkins on the popup, system will launch 
the Credential Provider dialog to create a credential for your sonar user.

https://plugins.jenkins.io/credentials

-- 
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/928b4fb1-6748-4115-b6ea-4eb1531f5fae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: build image based on PullRequest and test it

2019-05-29 Thread Quang Truong
Hi Polak,

Please find my update inline below

On Sunday, May 26, 2019 at 10:51:29 PM UTC-7, Polak wrote:
>
> Sorry for late answer from me. Thank you for your solution. Really 
> appreciate. It's really hard subject for me (not long time ago I have only 
> heard about something like Jenkins and Docker). Currently I have:
> 1. Multibranch Pipeline.
> 2. Dockerfile is inside project folder. What is "Jenkins ChangeSet" - do 
> you mean "currentBuild.changeSets"? Why and how should I change 
> dockerfile during pipeline execution? :)
>
[Quang] Because I don't want to rebuild the docker image every build (it 
takes me around 15 mins to build the image) so I build it whenever the 
Dockerfile has changed. So when there is a Git commit triggers our 
pipeline, I will check the changeSets (you're correct, I use the 
currentBuild.changeSets) to list all the committed files, if the Dockerfile 
has changed means we have to rebuild the existing image. If you don't have 
this need, ignore it, rebuild the docker image on every build to make sure 
you have the latest image.

> 3. Currently I made own image of jenkins slave based on 
> https://hub.docker.com/r/jenkinsci/jnlp-slave/ + installed postgres, 
> rail, ruby. Whole multibranch pipeline works perfect (build with success) 
> on this slave.
>
[Quang] I'd suggest using the swarm client: https://plugins.jenkins.io/swarm 
because 
you don't have to create a node entry from Jenkins master, just start the 
slave client with the java command. So in your Jenkinsfile, after create 
the docker image, start a container with the java command that point to 
your master, something like: 
java -jar /home/jenkins/swarm-client-3.9.jar -master ${env.JENKINS_URL} 
-username ${jenkins_user} -password ${jenkins_pwd} -labels ${docker_label} 
-name ${docker_build} -executors 1 -fsroot /home/jenkins

> 4. Do you run build/test using some plugin or by adding something to 
> Jenkinsfile or maybe something another?
>
[Quang] As long as your docker container is a Jenkins slave, you can do 
whatever you like from Jenkins. 

> 5. Honestly, also no idea how... :/
>

Here is a brief sample:
Dockerfile

FROM ubuntu:16.04

RUN apt-get -y update && apt-get install -y \
  sudo \
  openssh-server \
  openssl \
  openjdk-8-jre \
  git

RUN adduser --disabled-password --gecos "" --uid 1000 jenkins \
  && adduser jenkins sudo \
  && mkdir /home/jenkins/slave
&& echo "jenkins ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

RUN curl -L 
https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/swarm-client/3.9/swarm-client-3.9.jar
 
\
  -o /home/jenkins/slave/swarm-client-3.9.jar

USER jenkins


Jenkinsfile

node('docker_host') {
  stage('Prepare Env') {
def imgID = sh(script: "docker images -q ${imgName}", returnStdout: 
true)
if ((imgID == null) || (imgID == '')) {
  sh(script: "docker build -t ${imgName} -q -f ${dockerfile} ./")
}
def cmd = "java -jar /home/jenkins/swarm-client-3.9.jar -master 
${env.JENKINS_URL} -username ${jenkins_user} -password ${jenkins_pwd} 
-labels ${docker_label} -name ${docker_build} -executors 1 -fsroot 
/home/jenkins"
sh """#!/bin/sh -e
  docker run -td --name ${containerName} --volume ${map_volume} 
${imgName} bash -c ${cmd}"""
  }
}
node(docker_build) {
  stage('Build') {
// Do your build and test here
  }
}
node('docker_host') {
  // Cleanup your docker container and image
}

Please make sure you have try catch in case your pipeline has failed then 
you will cleanup the docker garbage. I haven't had time to explore the 
docker plugin to have a better approach yet, you can take a look at this: 
https://go.cloudbees.com/docs/plugins/docker-workflow/

Good luck!
 

>
> pt., 24 maj 2019 o 03:17 Quang Truong > 
> napisaƂ(a):
>
>> We implemented a similar Use Case: 
>>
>>- Create an isolate environment for each team
>>- Whenever they have commit/PR triggers a build and create a 
>>container to build that project.
>>- If the Dockerfile in that project has changed, refresh the docker 
>>image then create container based on the new image.
>>
>> The solution is (refer and tailor on your case):
>>
>>- Use multibranch project so Jenkins will trigger with git commit/PR
>>- Put Dockerfile into the project folder (let the team maintains 
>>their environment), use the Jenkins ChangeSet to verify if the Dockerfile 
>>has changed so you will refresh (remove the existing image then build a 
>> new 
>>one with the updated Dockerfile) the docker image on your Jenkins executor
>>- Build the docker image/container as a Jenkins slave (use 
>>swarm-client, accept the security iss

Re: build image based on PullRequest and test it

2019-05-23 Thread Quang Truong
We implemented a similar Use Case: 

   - Create an isolate environment for each team
   - Whenever they have commit/PR triggers a build and create a container 
   to build that project.
   - If the Dockerfile in that project has changed, refresh the docker 
   image then create container based on the new image.

The solution is (refer and tailor on your case):

   - Use multibranch project so Jenkins will trigger with git commit/PR
   - Put Dockerfile into the project folder (let the team maintains their 
   environment), use the Jenkins ChangeSet to verify if the Dockerfile has 
   changed so you will refresh (remove the existing image then build a new one 
   with the updated Dockerfile) the docker image on your Jenkins executor
   - Build the docker image/container as a Jenkins slave (use swarm-client, 
   accept the security issue with this plugin)
   - Run the build/test the project on your new slave container (consider 
   about concurrent pipeline with the new container)
   - If the build is green, back to the slave/host then push/update the 
   image into the docker registry

Hope this can help

-- 
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/5ca8978f-78ed-468a-8050-f7193df7f5c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


On-prem k8s cluster and k8s plugin

2019-05-23 Thread Quang Truong
Hi,

I start working with k8s and my working environment is the on-prem so I try 
to build the on-prem k8s via kubeadm and calico cni:

http://www.centinosystems.com/blog/sql/getting-started-with-kubernetes-on-prem/
https://docs.projectcalico.org/v3.7/getting-started/kubernetes/

I try to configure the service account for k8s plugin and run a simple test 
but not sure which part I have done wrong the 1st run (when first download 
the image to the cluster) the jnlp pod will use jenkins user

+ id
uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins)
+ ls -lh /home/jenkins
total 8
drwxr-sr-x2 jenkins  jenkins 4.0K Apr 29 11:54 agent
drwxr-xr-x3 jenkins  jenkins 4.0K May 23 22:45 workspace


But from the second, when the image is on the machine then the pod will run 
with root user

+ id uid=0(root) gid=0(root) 
groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
 

+ ls -lh /home/jenkins 

total 8 

drwxr-sr-x 2 jenkins jenkins 4.0K Apr 29 11:54 agent 

drwxr-xr-x 3 root root 4.0K May 23 22:45 workspace


Here is the pod describe

Name:   builder-0322cb0d-37be-438d-949c-fce0149039e5-5c743-2830b
Namespace:  default
Priority:   0
PriorityClassName:  
Node:   /
Start Time: Thu, 23 May 2019 16:18:00 -0700
Labels: jenkins=slave
jenkins/builder-0322cb0d-37be-438d-949c-fce0149039e5=
true
Annotations:buildUrl: 
cni.projectcalico.org/podIP: 192.168.243.226/32
Status: Running
IP: 192.168.243.226
Containers:
  jnlp:
Container ID:   docker:
//325602117ce4b0df6ef1d73e44ed7426251a0ea801990c065bce993e9af25cb4
Image:  jenkins/jnlp-slave:alpine
Image ID:   docker-pullable:
//jenkins/jnlp-slave@sha256:3c4227433a1bbd070b250d491bdee1696e6c163cff8a470df9c848da94306693
Port:   
Host Port:  
State:  Running
  Started:  Thu, 23 May 2019 16:18:02 -0700
Ready:  True
Restart Count:  0
Environment:
  JENKINS_SECRET:  <*my_jenkins_secret*>
  JENKINS_AGENT_NAME:  builder-0322cb0d-37be-438d-949c-fce0149039e5-
5c743-2830b
  JENKINS_NAME:builder-0322cb0d-37be-438d-949c-fce0149039e5-
5c743-2830b
  JENKINS_URL: 
  HOME:/home/jenkins
Mounts:
  /home/jenkins from workspace-volume (rw)
  /var/run/secrets/kubernetes.io/serviceaccount from default-token-tmzcc 
(ro)
Conditions:
  Type  Status
  Initialized   True 
  Ready True 
  ContainersReady   True 
  PodScheduled  True 
Volumes:
  workspace-volume:
Type:   EmptyDir (a temporary directory that shares a pod's 
lifetime)
Medium: 
SizeLimit:  
  default-token-tmzcc:
Type:Secret (a volume populated by a Secret)
SecretName:  default-token-tmzcc
Optional:false
QoS Class:   BestEffort
Node-Selectors:  
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  TypeReason Age   From   Message
  --      ---
  Normal  Scheduled  30s   default-scheduler  Successfully assigned 
default/builder-0322cb0d-37be-438d-949c-fce0149039e5-5c743-2830b to <>
  Normal  Pulled 28s   kubelet, ubuntuContainer image 
"jenkins/jnlp-slave:alpine" already present on machine
  Normal  Created28s   kubelet, ubuntuCreated container jnlp
  Normal  Started28s   kubelet, ubuntuStarted container jnlp




I'm not sure where the problem is, from my k8s cluster or configuration for 
jenkins connection, what should be the troubleshooting steps

Any comments will be helped, much appreciate on reading my issue.

Thanks,
Quang


-- 
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/93755219-2dc3-481a-b6a6-d0812dfc2945%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Kubernetes plugin with Rancher cluster

2019-04-22 Thread Quang Truong
Hi,

I have setup an on-prem cluster with Rancher 2.X (
https://rancher.com/docs/rke/latest/en/installation/), when I set the 
worker node on the same master, the jnlp slave can start successfully. 
However, when I try a new node in the cluster, I use the master on one 
machine and another machine as worker node then I got this error with the 
slave pod:

SEVERE: http:///tcpSlaveAgentListener/ is invalid: 404 
Not Found
java.io.IOException: http:///tcpSlaveAgentListener/ is 
invalid: 404 Not Found
at 
org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:202)
at hudson.remoting.Engine.innerRun(Engine.java:523)
at hudson.remoting.Engine.run(Engine.java:474)

I try to test the connection on both the master and worker node with:

curl http:///tcpSlaveAgentListener/

then I got response: 


   Jenkins

I'm new with Kubernetes so not sure what happen here. It would be great if 
you can have a suggestion of which on-prem Kubernetes tool should be good 
in case the error because the way Rancher handle the NodePort between 
master and worker node(s).

Thanks,
Quang

-- 
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/846ac733-e967-47d7-a3df-532848b7b71f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to trigger remote deploy using Jenkins on another server

2018-10-12 Thread Quang Truong
Another way that you can use any configuration management tool to trigger 
the remote process, for me, I use Ansible, it's an agentless tool, you can 
also take a look on other tools such as puppet, chef or salt. Your scenario 
is quite usual, build (on Jenkins slave) => deploy (on other machine), 
usually we use those CM tool for the remote configuration.

If you're working on Windows, another way should be WinRM but you have to 
open the firewall that might loosen your security setting.

On Friday, October 12, 2018 at 2:11:11 AM UTC-7, Ricky LI wrote:
>
> Hello,
>
> I got a problem with jenkins. Now I have a jenkins server running, pulling 
> source code from our SVN server, the builds are successfully done.
>
> However, there's some other scripts  ( or deployment) on the SVN server 
> that need to be executed once all projects are built successfully, how 
> could I tell jenkins to trigger automatically these scripts on a remote 
> server to deploy everything after builds ?
>
> If anyone knows the how, I will appreciate the help, 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/6ed051a4-e4c2-459e-b586-4bc1f14d67f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins docker with NIS user

2018-10-10 Thread Quang Truong
Hi,

I'm using jenkins docker to spin up a jenkins master, however, we're using 
NIS user to manage the access to jenkins. I have tried to search around but 
I can't see how to integrate the PAM NIS user for jenkins docker. I walk 
through this discussion 

 
about jenkins docker conttainer with AD but not sure how to deal with NIS 
(I have no idea about the mechanism of NIS user too)

Much appreciate on the hints for how to configure with jenkins container

Thanks,
Quang

-- 
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/7804f281-b288-4312-ae84-e5eb9097e95b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Batch command with slave mode configuration

2015-09-28 Thread Quang Truong
I have found the root cause: because I changed the way to invoke the slave 
and the account running the slave connection doesn't have enough permission 
so that Jenkins doesn't have permission to see nbtstat command.

A workaround is running the slave.jar to call the jnlp from Jenkins master 
by the java which is defined in Javahome.

Regards,
Quang

On Friday, September 18, 2015 at 1:15:39 AM UTC+7, Quang Truong wrote:

> Thanks Victor!
>
> I have tried with backlash (actually we can use even Linux syntax here) 
> and use %windir% instead of C:\Windows but still got the syntax error. I 
> don't know how to correct the syntax for this block in FOR command
>
> '"%windir%\System32\nbtstat.exe" -A %VM_IP% ^|FIND "<20>"'
>
> Thanks,
> Quang
>
> On Thursday, September 17, 2015 at 2:39:33 AM UTC+7, Quang Truong wrote:
>
>> Dear all,
>>
>> I have encountered an issue like this:
>>
>> - If I setup a slave by downloading and running the jnlp file (no need to 
>> install as Window service, just leave the java dialog as connected 
>> process). Then I can run this batch command:
>>
>> setlocal EnableDelayedExpansion
>> FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO 
>> (
>> SET Test_Machine_Name=%%G
>> echo Test_Machine_Name=!Test_Machine_Name!
>> )
>>
>> to return a target machine name (from provide IP %VM_IP%)
>>
>> - But if I run the commandline to setup the slave ( java -jar slave.jar 
>> -jnlpUrl http://:8080/computer//slave-agent.jnlp 
>> -secret ) then I encounter this error: 
>> 'nbtstat' is not recognized as an internal or external command,
>> operable program or batch file.
>> I have tried to point the absolute path of the nbtstat
>>
>> setlocal EnableDelayedExpansion
>> FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
>> %VM_IP%" ^|FIND "<20>"') DO (
>> SET Test_Machine_Name=%%G
>> echo Test_Machine_Name=!Test_Machine_Name!
>> )
>> then got the syntax incorrect.
>>
>> Please help to guide for solving this issue
>>
>> Thanks,
>> Quang
>>
>

-- 
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/33e3f88b-d13d-46dc-85d9-c756d8b15d8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to update environment variable value via EnvInject plugin

2015-09-28 Thread Quang Truong
Hi,

I'm using EnvInject plugin to pass the variables across jobs but in one job 
the value of one variable might change within that job and I want to update 
that variable's value within that job.

I have tried to add:
echo var1=%new value%>>"%workspace%\glob.prop"
then use EnvInject this glob.prop into the Environment variable.

However, within the job, the value is still the old one, but after the job 
finishes, the new value is updated within the environment variables list of 
that build. Not sure how to update the value right away so I can use that 
value.

PS: when I write out the glob.prop it has 2 line of the same variable
var1=old value
var1=new value

Thanks,
Quang

-- 
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/1f553b0d-dae0-454f-89d9-729ff4a8a691%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Batch command with slave mode configuration

2015-09-17 Thread Quang Truong
Thanks Victor!

I have tried with backlash (actually we can use even Linux syntax here) and 
use %windir% instead of C:\Windows but still got the syntax error. I don't 
know how to correct the syntax for this block in FOR command

'"%windir%\System32\nbtstat.exe" -A %VM_IP% ^|FIND "<20>"'

Thanks,
Quang

On Thursday, September 17, 2015 at 2:39:33 AM UTC+7, Quang Truong wrote:

> Dear all,
>
> I have encountered an issue like this:
>
> - If I setup a slave by downloading and running the jnlp file (no need to 
> install as Window service, just leave the java dialog as connected 
> process). Then I can run this batch command:
>
> setlocal EnableDelayedExpansion
> FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO (
> SET Test_Machine_Name=%%G
> echo Test_Machine_Name=!Test_Machine_Name!
> )
>
> to return a target machine name (from provide IP %VM_IP%)
>
> - But if I run the commandline to setup the slave ( java -jar slave.jar 
> -jnlpUrl http://:8080/computer//slave-agent.jnlp 
> -secret ) then I encounter this error: 
> 'nbtstat' is not recognized as an internal or external command,
> operable program or batch file.
> I have tried to point the absolute path of the nbtstat
>
> setlocal EnableDelayedExpansion
> FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
> %VM_IP%" ^|FIND "<20>"') DO (
> SET Test_Machine_Name=%%G
> echo Test_Machine_Name=!Test_Machine_Name!
> )
> then got the syntax incorrect.
>
> Please help to guide for solving this issue
>
> Thanks,
> Quang
>

-- 
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/9d7da479-6074-41c3-a41b-558df90784d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Batch command with slave mode configuration

2015-09-16 Thread Quang Truong
Dear all,

I have encountered an issue like this:

- If I setup a slave by downloading and running the jnlp file (no need to 
install as Window service, just leave the java dialog as connected 
process). Then I can run this batch command:

setlocal EnableDelayedExpansion
FOR /f "tokens=1 delims=<" %%G IN ('nbtstat -A %VM_IP% ^|FIND "<20>"') DO (
SET Test_Machine_Name=%%G
echo Test_Machine_Name=!Test_Machine_Name!
)

to return a target machine name (from provide IP %VM_IP%)

- But if I run the commandline to setup the slave ( java -jar slave.jar 
-jnlpUrl http://:8080/computer//slave-agent.jnlp 
-secret ) then I encounter this error: 
'nbtstat' is not recognized as an internal or external command,
operable program or batch file.
I have tried to point the absolute path of the nbtstat

setlocal EnableDelayedExpansion
FOR /f "tokens=1 delims=<" %%G IN ('"C:/Windows/System32/nbtstat.exe -A 
%VM_IP%" ^|FIND "<20>"') DO (
SET Test_Machine_Name=%%G
echo Test_Machine_Name=!Test_Machine_Name!
)
then got the syntax incorrect.

Please help to guide for solving this issue

Thanks,
Quang

-- 
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/3d211bd8-c00e-4291-95d3-f8dcdbc886d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Call vSphere cloud plugin via Groovy DSL

2015-06-15 Thread Quang Truong
Please help to share on how we can use workflow Groovy CPS DSL script to 
run a build step on vSphere plugin instead of using a job? I'm a newbie.

Thanks,
Quang

-- 
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/94e8f700-c685-4d17-a9c3-f478f85c2a10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.