include maven build output in Artifacts

338 views
Skip to first unread message

Geovanie Marquez

unread,
Sep 5, 2014, 3:18:50 PM9/5/14
to go...@googlegroups.com

I put this into a command:

Command
mvn

Arguments
clean
install
-l
mvn.log


This into the artifact source:
mvn.log with type "Build Artifact"



It looks like the command is being executed by an anonymous user since I have not set up user authentication yet, but this user is not allowed to create files in "/var/lib/go-agent/pipelines/demo_pipeline/" directory

How do people retrieve the build log of maven when using go?

Marius Ciotlos

unread,
Sep 5, 2014, 3:25:18 PM9/5/14
to go...@googlegroups.com
Hi, just define a "build" artefact, and then you can access the log from the Artifacts tab on the job. 

Geovanie Marquez

unread,
Sep 5, 2014, 4:29:01 PM9/5/14
to go...@googlegroups.com
I stated in my original post that I attempted to add a build-artifact. My problem is that I tried to define a build artifact and it is not showing me any other build artifact other than the "cruise-output" artifact.

I think my problem is permissions related since all directories under the demo_pipeline that I have set up belong to the user "go" and the job is being run by "anonymous", but I am not sure how to deal with this. 

Who owns the jobs in the AGENT_WORK_DIR for the job being run (for instance < AGENT_WORK_DIR >/pipelines/demo_pipeline). Shouldn't it be the user who is running the job (in my case anonymous?) so that they are allowed to create artifacts? 

Marius Ciotlos

unread,
Sep 5, 2014, 4:48:40 PM9/5/14
to go...@googlegroups.com
I don't think it's a permission problem, must be an artifact setup problem.
We've ran maven jobs and collected the output and they are always ran by the go user.
Could you post here how you've setup the artifact?

In my case if I wasn't sure how to set it up I start with * and browse from there and narrow it down later after I have a clear picture of what is generated.

Marius

Marius Ciotlos

unread,
Sep 5, 2014, 4:53:46 PM9/5/14
to go...@googlegroups.com
You can simulate your job by running same command directly on the agent as go user inside the pipeline directory and see if files get generated properly.
You can also check directly on the agent if the file gets created in your current setup when you run the job.

I've re-read the original post an realised that Artifact setup was specified there.

Cheers,
Marius

Geovanie Marquez

unread,
Sep 5, 2014, 5:13:30 PM9/5/14
to go...@googlegroups.com
yeah you are right ..
never mind I just verified that user 'go' is indeed who runs these commands. hmmm I wonder why I am not able to make the artifact available for return.

Artifact is configured as 
Source="mvn.log"
Destination=
Type="Build Artifacts"

the job fails and that it OK, I just want the maven logs to show up on the go UI.

this is my latest run:
[go] Start to prepare demo_pipeline/16/demo-stage-1/1/defaultJob on hadoop-test.in.wellcentive.com [/var/lib/go-agent] at Fri Sep 05 16:54:34 EDT 2014

[go] Start updating files at revision 7f4909835eae858dd4ec553d5428799f18af5e9d from g...@git.company.com:/rundeck.git
[GIT] Cleaning all unversioned files in working copy
[GIT] Cleaning submodule configurations in .git/config
[GIT] Fetching changes
[GIT] Performing git gc
[GIT] Updating working copy to revision 7f4909835eae858dd4ec553d5428799f18af5e9d
HEAD is now at 7f49098 D-4260: set logging level to default to debug=yes for production and cert OUTBOUND-DAILY-EXPORT job, also fixed a typo
[GIT] Removing modified files in submodules
[GIT] Cleaning all unversioned files in working copy

[go] Start to build demo_pipeline/16/demo-stage-1/1/defaultJob on hadoop-test.in.wellcentive.com [/var/lib/go-agent] at Fri Sep 05 16:54:35 EDT 2014

[go] Current job status: passed.

[go] Start to execute task: <exec command="mvn" >
<arg>-l</arg>
<arg>mvn.log</arg>
<arg>clean</arg>
<arg>install</arg>
</exec>. 
[go] setting environment variable 'GO_SERVER_URL' to value 'https://127.0.0.1:8154/go/'
[go] setting environment variable 'GO_TRIGGER_USER' to value 'anonymous'
[go] setting environment variable 'GO_PIPELINE_NAME' to value 'demo_pipeline'
[go] setting environment variable 'GO_PIPELINE_COUNTER' to value '16'
[go] setting environment variable 'GO_PIPELINE_LABEL' to value '16'
[go] setting environment variable 'GO_STAGE_NAME' to value 'demo-stage-1'
[go] setting environment variable 'GO_STAGE_COUNTER' to value '1'
[go] setting environment variable 'GO_JOB_NAME' to value 'defaultJob'
[go] setting environment variable 'GO_REVISION' to value '7f4909835eae858dd4ec553d5428799f18af5e9d'
[go] setting environment variable 'GO_TO_REVISION' to value '7f4909835eae858dd4ec553d5428799f18af5e9d'
[go] setting environment variable 'GO_FROM_REVISION' to value '7f4909835eae858dd4ec553d5428799f18af5e9d'
Error happened while attempting to execute 'mvn -l mvn.log clean install'. 
Please make sure [mvn] can be executed on this agent.

[Debug Information] Environment variable PATH: /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/latest/bin:/var/go/bin
[go] Start to create properties demo_pipeline/16/demo-stage-1/1/defaultJob on hadoop-test.in.wellcentive.com [/var/lib/go-agent] at Fri Sep 05 16:54:35 EDT 2014
[go] Start to upload demo_pipeline/16/demo-stage-1/1/defaultJob on hadoop-test.in.wellcentive.com [/var/lib/go-agent] at Fri Sep 05 16:54:35 EDT 2014
[go] The rule [**/mvn.log] cannot match any resource under [pipelines/demo_pipeline]
[go] Uploading finished. Failed to upload [**/mvn.log]
[go] Job completed demo_pipeline/16/demo-stage-1/1/defaultJob on hadoop-test.in.wellcentive.com [/var/lib/go-agent] at Fri Sep 05 16:54:35 EDT 2014

Geovanie Marquez

unread,
Sep 5, 2014, 6:23:25 PM9/5/14
to go...@googlegroups.com
It's the path variable that is messed up. My 'go' user (on the machine) has the correct path variable but the user 'go' that the go-server sees does not have this path variable properly set.

[Debug Information] Environment variable PATH: /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/java/latest/bin:/var/go/bin

and maven is installed under '/usr/local/maven/bin'

anyways, hope this helps someone else.

Marius Ciotlos

unread,
Sep 6, 2014, 1:57:32 AM9/6/14
to Geovanie Marquez, go...@googlegroups.com
Go user should be the same. The only explanation that i have is that you haven't restarted the agent after maven installation on your go agent. 

Cheers,
Marius
--
You received this message because you are subscribed to a topic in the Google Groups "go-cd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/go-cd/piDZCTH5d-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Geovanie Marquez

unread,
Sep 6, 2014, 9:21:12 AM9/6/14
to go...@googlegroups.com, geovanie...@gmail.com
You're right. I just bounced the server and it worked even after removing the symbolic link I created to get around this. I guess thinking back it makes sense that the  'source' command only works for the shell environment and not other services. A proper restart would have done this right. 
Reply all
Reply to author
Forward
0 new messages