I have some terraform code that uses a map of tfvars to deploy multiple lambdas to Aws. it all works fine except I want to run the script in a Jenkins pipeline which would need to download the jars from Nexus first for each lamda. is there a way I can read the tfvars file in the Jenkins pipeline to get the names of the jars to download from Nexus, copy them into the working dir on Jenkins and then upload them using terraform?
Related
i have few bit-bucket repositories, and till now i have used circle-ci config files to run test-build-deploy.
Now we migrating to Jenkins, and i don't want to build all the steps from beginning
Is there a simple way to convert circle-ci config files to Jenkins jobs.
I have already created a Jenkins instance, and attached the bit-bucket account to it
I'd like the files generated by Jenkins script to be automatically copied into a given directory on the local network.
Is there a plugin or script for doing that ?
In my case it worked by using SCP in a build step "Execute shell". The remote server needs to be accessible via ssh.
If your artifacts are the result of a maven build, maybe a Nexus Repository Manager is what you are looking for. A simple mvn deploy would do the job.
I have just started trying out Jenkins and Artifactory. I have managed to create a jenkins job that just runs MSBuild to create an .exe. I have also managed to upload this .exe to Artifactory.
What I would now like to do is to be able to add metadata e.g. git commit id, unit test result etc. to the artifacts that I want to load to Artifactory.
In Jenkins I can do that either by including a job configuration or including a filespec .json file.
Is the only way to add properties in the filespec dynamically to create a filespec dynamically? Or is there any other way in Jenkins (perhaps using Artifactory RestAPI) to add properties to the artefact before uploading to Artifactory?
I appreciate all the help I can get.
Thanks!
Sami
What are you using to upload your exe to Artifactory? JFrog CLI? Jenkins artifactory plugin?
Assuming this is the Jenkins Artifactory Plugin, you can use a file spec to define the properties that you want to upload (that is the 'props' element described in https://www.jfrog.com/confluence/display/RTF/Using+File+Specs).
The file spec format supports variables when used with JFrog CLI, the variables defined with --spec-vars (see https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-UploadingFiles), so I imagine that you can also use variables when used from the Jenkins Artifactory plugin...
I want to use a config file provided by config file provider plugin in a pipeline project.
However when I run a build step inside a slave. I get a "PermissionDenied" exception, The same runs in master however.
So question is thats the best possible way to share files between master and slaves. I may not be able to Copy to slave plugin as there doesn't seem to be pipeline support.
If you want to share files between stages or nodes you can use the stash - unstash methods. see the example here
If you want to share files between builds you can use the archive method and the Copy Artifact Plugin
My environment uses Gradle for builds, Jenkins for CI, and Artifactory for a repository. I use the Artifactory plugin for Jenkins.
Jenkins successfully builds my main jar file and uploads it to Artifactory. The build script has a second target for creating a distribution zip file under build/distributions. Jenkins creates the zip file successfully, but I don't know how to tell it to upload that artifact to Artifactory, too.
Is this something I should be able to specify in the Jenkins Artifactory plugin config, or something I should define in the Gradle build script? Thanks for any pointers.
You should configure the archives configuration to include all the archives you intend to publish as described in Gradle's user manual. Not only Artifactory will pick up all the files to deploy automatically (without messing with Published Artifacts configuration), you won't even need to run the second task. All the archives will be creating by running the build task.
I assume you have configured artifactory server correctly in Manage Jenkins section; also your job is setup as a Freestyle Project.
Select your job and click Configure. Check Generic Artifactory Integration in Build Environment. Select your Artifactory Server and Target Repository from drop downs, check Override default deployer credentials if required. In Published Artifacts you enter the pattern for your zip file to be published, e.g. ${WORKSPACE}/distr/*.zip (where by WORKSPACE is jenkins current project's workspace and distr/*.zip your distribution zip file). Check if required Capture and publish build info, Include environment variables etc. Save your job. When you build it the next time, the zip file will be uploaded and will be available in the Builds section on artifactory.