Travis CI integration with Artifactory - travis-ci

I am trying to use Artifactory to store files from GitHub as binaries to Artifactory.
But vm created by travis is not able to communicate with my local machine.
As travis assigns build environment as vm on ec2/packet/gce if particular sudo and dist options are selected, by default vm on ec2/packet if none of the option is selected.
How can I solve this?

Related

Where should I configure the jobs to build the project and to deploy it?

I am very new to devops and I could really use some help to understand the concept of this.
So I am trying to develop a continuous integration environment using VirtualBox and Vagrant. I've read some examples of how to build such an environment to pull a maven project from github, build it and deploy to the nexus artefact repository.
I have managed to configure a VM with Ubuntu and installed Tomcat on it.
What I don't understand is where should I configure the Jenkins jobs to build the project and to deploy it to nexus and to make it run in Tomcat Server. On my local machine or in the virtual machine ?
Thanks.
If you are using bridged/hostonly networking for ubuntu, then you can run the jenkins in your host machine. If it is NAT/Private networking, use guest machine to run jenkin jobs.

Integrating Jenkins with Gitlab

I need to setup a build configuration in Jenkins so that whenever a build is triggered, I get my latest scripts from Gitlab and copy them to the target systems and run that script on the target.
I couldn't find any relevant info for integrating Gitlab to Jenkins. Are there any specific plugins that I could use?
I am using Jenkins version 2.158
Step by Step procedure for doing what you are looking for:
Add the location of the Script from GitLAB. (E.g.)
Run the script over the target machine.
While Building the job, you will get the code at the root (./) of the job's workspace. Copying and running the script over the target machine can be done by remote script executions. following are the cases we having in running script in the remote machine
Windows (jenkins) to windows - use psexec.exe
Windows (Jenkins) to linux - use plink.exe which is command line putty
Linux (Jenkins) to linux - use SCP and SSH
Linux to Windows - use ansible for windows.
E.g,.
$ scp script.sh remote_username#10.10.0.2:/remote/directory
$ ssh -t remote_username#10.10.0.2 /remote/directory/script.sh
All the best.
Integration between Git Repository Management (github, gitlab,bitbucket, etc) and Jenkins has the following steps :
Developer push some source code (java, php, nodejs, etc) to the Git Repository Management.
The Git Repository Management detects this event and notify to some public http endpoint in your Jenkins. Currently webhook is the most recommended way to implement this notification.
Jenkins receive the http post request(from bitbucket for example) and using some plugin or configurations , Jenkins try to determine or get the basic devops parameters like : branch name, commit author, commit message, technology, etc
Whit the extracted devops parameters, Jenkins launchs a preconfigured job. This job use the previously extracted values to build, compile, zip, install or to do whatever is necessary to startup your application.
If you want to implement this flow, check this post:
https://jrichardsz.github.io/devops/devops-with-git-and-jenkins-using-webhooks
Also, if you need. I will gladly to show you a basic integration using some git repository management and jenkins . Just contact me.

How to run a Jenkins job inside a windows docker container

I am trying to run a jenkins job inside a windows docker container. I have successfully created an image with windows server code docker image which will have MSBuildEngine 4.7.
The problem I am facing is I am not able to run a Jenkins job inside that container.
I am able to do it easily with linux environment.
The actual problem is, Jenkins first puts a shell file which will have the command to run the container and inspect it.
How do I tell Jenkins that my environment is not Linux and it is Windows.
Note: Searching in google does not help now a days. So I directly reached out here
I am working on this issue as well. I am finding that the (maybe just a) underlying issue is how Jenkins tells Docker to mount a volume to the container. I have yet to get around this issue.
edit:
There's a PR addressing this issue and I tested the fork with both Linux and Windows slaves to work as we intend.
Download Rbutcher's fork of the plugin:
git clone https://github.com/rbutcher/docker-workflow-plugin.git
Change to the working branch:
git checkout feat/windows_slaves
Build the plugin:
mvn -DskipTests clean install
Manually import into Jenkins:
Manage Jenkins> Manage Plugins> Advanced>Upload Plugin and select ./target/docker-workflow.hpi.

Can Jenkins be used for Docker Swarm deployment?

How to automate Jenkins for Docker Swarm deployment.
I am wondering if there are any plugins available in Jenkins which will help in Docker Swarm deployment or any other alternative way through which we can achieve the automation of Swarm deployment using Jenkins existing plugins?
Fixed this problem by using a plugin called Publish over SSH
Need to install a Jenkins plugins “Publish over SSH”, this plugin will allows us to
Sends files over SSH(SFTP)
Execute commands on a remote server
First step will be to add remote hosts and second will be to add an execution/build step where the commands will be executed
Follow this link for step by step instruction

Failed to create docker image using docker slave plugin for jenkins

I am trying to create a jenkins job that will build a github project inside a docker container that shall be generated from the Dockerfile contained in the github project itself. To do so, I am using docker slaves plugin but I am running into an issue when I run the jenkins job.
Error during container provisioning
The configuration I am using for the jenkins job is the following:
jenkins job config
So the job right now should only clone the repo and build the image. Any suggestions?
The solution to the problem was to set the remoting image to jenkinsci/slave in the global configuration of jenkins
Jenkins global config

Resources