Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pseudo script for installing Jenkins CI on Smart OS. SMF service manifest file included.
#!/bin/pseudo-bash
# Read through this and modify to taste.
# Tested on:
# image_uuid: bad2face-8738-11e2-ac72-0378d02f84de
# smartos base64 1.9.0
#
# jenkins is run as the "admin" user, with its home directory set to /home/admin/jenkins
mkdir ~/jenkins
# ensure java is installed:
pkgin in sun-jre6
# download jenkins
wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war
# get service manifest, and edit if appropriate (see below)
wget https://gist.github.com/mattconnolly/6264850/raw/ef573c704173538d0661de6e44db9bd0a4c5478a/jenkins.xml
svccfg validate jenkins.xml
svccfg import jenkins.xml
tail -f /var/svc/log/application-jenkins\:default.log &
svcadm enable jenkins
if [[ $success ]]
then cheer!
else weep
fi
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Copyright (C) 2007 Paul Oswald
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!-- updated by Jim Park <jpark@jim80.net> for use with SmartOS and Jenkins -->
<service_bundle type="manifest" name="Jenkins">
<service name="application/jenkins" type="service" version="1">
<!-- Initial state of the service is disabled -->
<create_default_instance enabled="false" />
<!-- Only one instance of Hudson should ever run per server -->
<single_instance />
<dependency name="multi-user-server" type="service" grouping="require_all" restart_on="none">
<service_fmri value="svc:/milestone/multi-user-server" />
</dependency>
<method_context>
<method_credential user="admin" group="staff" />
<method_environment>
<envvar name="PATH" value="/usr/bin:/usr/sbin:/opt/local/bin" />
<envvar name="JENKINS_HOME" value="/home/admin/jenkins" />
</method_environment>
</method_context>
<!-- Set the JENKINS_HOME env variable, and run the war file in /home/admin/jenkins.war -->
<exec_method type="method" name="start" exec="/opt/local/bin/java -Xmx512m -jar /home/admin/jenkins.war" timeout_seconds="0"/>
<exec_method type="method" name="stop" exec=":kill -TERM" timeout_seconds="30"/>
<!-- We are going to be kicking off a single child process so we want Wait mode-->
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="child" />
</property_group>
<stability value="Unstable" />
<template>
<common_name>
<loctext xml:lang="C">Jenkins Continuous Build Server</loctext>
</common_name>
<documentation>
<doc_link name="jenkins-ci.org" uri="http://jenkins-ci.org" />
</documentation>
</template>
</service>
</service_bundle>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.