Last active
April 4, 2016 21:20
-
-
Save travispaul/f8549409b96591990f4a to your computer and use it in GitHub Desktop.
Example SMF Manifest for running Atlassian Bamboo on SmartOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | |
<service_bundle type="manifest" name="bamboo"> | |
<service name="atlassian/bamboo" type="service" version="1"> | |
<dependency name='network' grouping='require_all' restart_on='error' type='service'> | |
<service_fmri value='svc:/milestone/network:default' /> | |
</dependency> | |
<dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'> | |
<service_fmri value='svc:/system/filesystem/local:default' /> | |
</dependency> | |
<method_context> | |
<method_credential user='bamboo' group='other' /> | |
<method_environment> | |
<envvar name="LD_PRELOAD_32" value="/usr/lib/extendedFILE.so.1" /> | |
<envvar name="PATH" value="/opt/local/sbin:/opt/local/bin:/sbin:/usr/sbin:/usr/bin" /> | |
</method_environment> | |
</method_context> | |
<instance name='agent' enabled='false'> | |
<exec_method type="method" name="start" exec="/opt/atlassian/bamboo/start.sh" timeout_seconds="60" /> | |
<exec_method type="method" name="stop" exec=":kill" timeout_seconds="60" /> | |
<property_group name="startd" type="framework"> | |
<propval name="duration" type="astring" value="contract" /> | |
<propval name="ignore_error" type="astring" value="core,signal" /> | |
</property_group> | |
<template> | |
<common_name> | |
<loctext xml:lang='C'>Bamboo Agent</loctext> | |
</common_name> | |
</template> | |
</instance> | |
<stability value="Unstable" /> | |
</service> | |
</service_bundle> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To setup: | |
# mkdir -p /opt/atlassian/bamboo | |
# useradd -c "Bamboo Build Agent" -d /opt/atlassian/bamboo bamboo | |
# chown -R bamboo /opt/atlassian/bamboo | |
# (copy jarfile to /opt/atlassian/bamboo/bamboo-agent-5.7.2.jar) | |
# (copy this script to /opt/atlassian/bamboo/start.sh) | |
# chmod a+rx /opt/atlassian/bamboo/start.sh | |
# svccfg import -V bamboo-manifest.xml | |
# svcadm clear bamboo | |
# svcs bamboo | |
# (for troubleshooing check /var/svc/log/atlassian-bamboo:agent.log) | |
# (https://wiki.smartos.org/display/DOC/Basic+SMF+Commands) | |
# Absolute path to jar | |
bamboo_jar=/opt/atlassian/bamboo/bamboo-agent-5.7.2.jar | |
# Bamboo Host Server URL | |
bamboo_host=http://bamboo-host-server:8085/agentServer | |
/opt/local/bin/java -jar $bamboo_jar $bamboo_host & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment