I have two build jobs.
Job Build and Job Deployment.
Job Deployment depends on the artifacts of Job Build
When Job Build ran the artifacts are available. Now I want to use the SSH Upload Build Step for Job Deployment. It asks for the sources to be deployed.
I give the following path
When I execute the build chain the SSH Upload Build Step failed
Can anybody tell me how to point to the artifact path?
Please check your TC agent or remote host if this *.jar exists there first.
If yes - check the artifacts path and follow documentation:
https://confluence.jetbrains.com/display/TCD3/Build+Artifact
Sometimes when you have a pool with more than 2 TC agents - another TC agent can run Job Deployment step - verify that you build from the same chain and on the same agent (go to agent directory and check work folder).
Related
I am running my maven application on Jenkins. when the build is complete, I get the jar file on my machine.
I want to deploy this jar on 2 different servers with specific IP (x.x.x.x) for testing purposes after the build is complete.
What plugins and/or steps should I follow to achieve that ?
I am trying to setup a maven project in jenkins via freestyle option. I have set manage jenkins->configure system to set maven downlaod automatic. But, when I run the project on the slave where there is no maven isntall, it does not automatically download maven on slave and install as i expected. am i thinking something wrong here?
This is what I have done :
1. Manage jenkins-> configure system-> maven install automatically
2. create a new job and select freestyle project
3. in the build step:
scp pom file from master to slave machine
run maven from slave using this pom file
Here there is no maven installed in slave. But, i though because of step 1, it will automatically download maven on slave and install before running the build .
In your build step you need to "Invoke top-level Maven targets", select the Maven version you configured and trigger the job again.
if the installation you added is by extracting *zip and not from Apache you have a "Label" field that is co-related to the Label of the node you're running on. I always use Tools label on my slaves, so just make sure you have this label configured in the node itself.
What I want to achieve is two step build automation
Step A - Build & Upload to artifact repo
Create build job in Jenkins which will create build after every check-in
Upload every successful build on Archiva server
Step B - Get latest artifact & deploy on required servers
After every desired interval, get latest build from Archiva
Deploy build uploaded in Step A.2 to dev/qa/stg server by unzipping its content in web server directory.
I was able to do achieve Step A by using maven goals in my project pom.xml but any idea/suggestions/best practices for Step B.
I understand/agree, I would need two different jobs having different pom.xml, question remains how will we get latest war from repo in pom and how will be deploy that latest war on remote server by unzipping it, as tomcat there does not have admin module.
I would deploy not a jar/war artifact on step 2, but would create a RPM that contains a needed files structure.
With maven it's quite easy to do with a maven rpm plugin
3-4. Nexus has built in YUM repository support, so you can use yum to install the latest rpm version
So I've always found it better to separate the builds and the deploys.
The schedule for those can be independently managed then.
Assuming you are using linux on the servers you could use the ssh-plugins in jenkins to download the artifact in archiva
wget http://server/repository/internal/group/artifact/version/artifact-version.jar
As for the deploy, you could sftp them over to the deploy server also using jenkins SFTP plugin.
I am experiencing an issue running Jenkins job using slaves.
The job is a Maven job, that updates code from svn and then build and run tests, this project runs well in both master and slave as a standalone project.
The issue is when Master launch this project in the slave, in that case I see:
...
Svn Update OK
Error: Maven Home c:\maven doesn't exist
Both servers have maven on that dir, and both servers are able to run the build without master/slave setup.
Finally,I solve this problem.
The reason of "Error: Maven Home c:\maven doesn´t exist" is that your slave node use the master`s maven setting . If the slave want to use its own setting , it has to override that.
Override the settings as follows:
System Management -> Node Management -> your slave setting -> Node Properties -> check the Tools Locations -> Add , then set the slave maven option,alias select "maven",directory write with the slave maven directory.
you can try it.
You need to invoke your top-level maven targets and set the goals and path to pom, for instance:
goals: clean install
Pom: /home/merbel/sth/pom.xml
Finally i solve this issue, it was very simple just we need to check the global configuration that in maven part we have given correct path or not as a maven home.
for example: in global tools configuration..>come down in maven home part
maven Name: M2_HOME
MAVEN_HOME: /opt/maven
like this we need to give correct path where maven was untar so after checking this try once.....
in most cases it works succesfully.....
My build scenario is like this (simplified):
Compile
Package (*.zip)
Deploy to test environment
Run tests over the environment
If tests fail TeamCity still publishes artifacts. This is unnecessary and consumes disk space. How can i prevent this? Can't find any check box or something (TeamCity 6.5 Enterprise).
As far as I can tell, TeamCity doesn't have a built-in option to disable artifact publishing if the build fails.
However, in the build script called by TeamCity you could try:
Removing artifact paths from the build configuration, and instead emitting the appropriate TeamCity service messages with your artifact paths only when tests are complete and successful.
Only copying files to the artifact paths configured in TeamCity after the tests are complete and successful.