Cloudbees Jenkins job cannot install packages via Yum - jenkins

I have Jenkins running on a Cloudbees Fedora 17 node. I need my job to be able to install certain packages to build my project correctly for deployment but my yum install commands fail because the jenkins user does not have the correct permissions.
I cannot SSH into the box or use the jenkins CLI to assign root permissions to use sudo and Cloudbees doesn't appear to enable the Script Console. Neither can I run the yum command as with su because it expects the administrator password which I cannot enter remotely.
What can I do?

I am not aware that you can install additional software on the CloudBees Jenkins master node. But you can request from CloudBees support that additional software packages will be installed on the automatically created CloudBees build nodes.
As alternative you can also create your own build nodes (called OPE in CloudBees). This is helpful for a lot of cases such as specific software requirements (such as closed source software which requires a license) or just to be much more flexible when it comes to require packages installed on it.
Since you didn't mention what kind of packages are missing: There are a lot of frameworks that provide much more ruby, java, python, go etc. versions as any Linux distribution. CloudBees provides documentation for a lot of them on http://dev-at-cloud-docs.cloudbees.com/docs/dev-at-cloud-docs-1.1/Build+Tools.html

This is the problem with hosted solutions like what Cloudbees offers. If you need access to operating system level permissions on the host server, then you have little choice but to host Jenkins yourself, or to obtain a different licensing structure with CloudBees in order to have a VPS, or some other isolated but still SaaS hosted solution.

Related

Update jenkins war on one machine and then move it to another one: possible?

I have a machine with blocked outgoing connections so it is not possible to update jenkins nor install the plugins I need for my work.
My idea is the following: I download the jenkins .war on my personal laptop and complete the installation + the plugin download.
Then I just move this .war to the machine where I need jenkins to be up and running.
Is it possible? Where are the plugins/updated data stored?
Also, would it be a problem the fact that my laptop has windows as os, while the destination machine is a linux RHEL?
Your solution sounds crazy :D
This could be help you:
Update Jenkins war
If you have shell access with root privilege, there is a manual way.
Download latest war file inside your linux, using wget , curl or just upload it using winscp from your windows.
Stop jenkins
Backup EVERYTHING: linux snapshot, jenkins workspace, jenkins war file, etc
Replace the old war with new war
Start jenkins
Detailed steps in this webs:
https://mohitgoyal.co/2017/02/15/upgrade-jenkins-server-to-a-new-version/
https://www.thegeekstuff.com/2016/06/upgrade-jenkins-and-plugins/
Plugin
Jenkins has an option to install plugins called Manage Plugins
This offer two options :
(1) Install plugins using available option
For official and compatible plugins, suggested by Jenkins :
(2) Install plugins using upload option
For custom plugins or when is not available on official repositories:

jenkins manually install plugins

My IT department has blocked internet access to all but a few sites and they don't want to keep adding new sites to the proxy. Consequently, during the installation of Jenkins on linux, none of the plugins were added. Is there a way to download all the plugins and install them manually? There are too many to download and install them individually.
The best solution would be if I could re-install Jenkins without needing to connect to the internet at all.

Mimic prod environment on CI server

I have to setup CI/CD for my organisation.
My requirement is that ci-sever (whether hosted or on-premise ) should mimic the prod environment like operating system , /var/log directories , nginx , php-fpm configuration so on. It gives us more confidence when running integration test cases.
As we setup jenkins on-premise server so we can easily replicate the prod environment on jenkinsserver.
How can I do that with any ci hosting service like travis-ci , 'codeship' , 'circle-ci' etc ??
Operating system
If you use ubuntu 12.04/14.04 then most commercial offering (travis, cicrcle ci, I think codeship also) are already using it so you're ok there. If not then I believe you'll need to use docker to setup a container with the expected operating system
2.software packages and other configuration
All commercial offering support specifying the system packages you need and installing on build (Usually with cached, so quicker then usual install). Of course if you are using a docker container you can pre bake it with all the packages you need.
Same go for /var/log just run a script in "pre" step of the build and setup whatever you need and expect
Bonus points
The best way to handle production infrastructure is automation so if you automate your infrastructure setup with configuration management tool (ansible is my favorite, other popular options are salt, chef, puppet, engineCf) and then use the same script to prepare the environment in your build jobs..

OpenShift Cloud Computing: Advanced installation

I want to install OpenShift using the advanced installation - method on Centos7 (EC2). But first I need to know some issues:
URL of tutorial: https://docs.openshift.com/enterprise/3.0/admin_guide/install/advanced_install.html#installing-ansible
First I need to configure the prerequisitions on the master and its 2 nodes (https://docs.openshift.org/latest/install_config/install/prerequisites.html).
When that's done the advanced installation will start.
1) Do I have to install ansible on the master only and running the installer at the end or do I need to install anything on the node (except docker)?
2) Which steps do I have to follow here: https://github.com/openshift/openshift-ansible or just download the repo and following the tutorial.
3) Is there something necessary what needs to be installed or configured which is not cited?
You are correct to start with the prerequisite steps outlined in the origin documentation.
In particular,
Ensure that you've completed host preparation steps. These steps include packages that must be installed on every system.
Ensure that you've configured host access. The ansible installer uses ssh key authentication by default so you must be able to login to each system (including the master) from the master with ssh key authentication.
Ensure that the output of hostname -f outputs the correct hostname of each system.
Once you've finished with the prerequisite steps, you will move on to the advanced installation section. Steps for installing ansible and creating an ansible host inventory can be found here. You only need to install ansible on the master. Once you've installed ansible and created a host inventory you can run the ansible playbook to begin the installation.
Afterwards, you can verify the installation and then complete follow up items such as configuring authentication, creating a router and creating a docker registry.
If you encounter any problems with the advanced installer, create an issue with the openshift-ansible project.

Is there a way to install the ios-universal-framework on a cloudbees spawned Jenkins slave?

Using a Master Jenkins on premises, and the cloudbees plugin, I am able to kick off iOS builds to a cloud bees instance. It's pretty sweet.
My IOS developers require cloning the ios-universal-framework repo, and then running an install.sh script contained within that repo. Everything works fine until the script issues a "sudo" command to copy files into the directory
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications"
The cp command needs sudo privileges. I'm thinking this is not possible but since I'm on the free trial plan, this is where I can find support. Thanks to all for reading.
Tony

Resources