-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: support smartos (with hosts from Joyent) #64
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# io.js Build SmartOS Setup | ||
|
||
To set up hosts, make sure you add them to your ssh config first: | ||
``` | ||
Host iojs-build-smartos-64-1 | ||
HostName 165.225.137.91 | ||
User root | ||
|
||
Host iojs-build-smartos-32-1 | ||
HostName 165.225.138.254 | ||
User root | ||
``` | ||
|
||
Note that these hostnames are also used in the ansible-inventory file. The IP addresses will need to be updated each time the servers are reprovisioned. | ||
|
||
To set up a host, run: | ||
|
||
```text | ||
$ ansible-playbook -i ../ansible-inventory ansible-playbook.yaml | ||
``` | ||
|
||
**Users**: The ansible-vars.yaml file contains a list of users who's GitHub public keys are pulled and placed into | ||
authorized_keys for both root and iojs users. This file should be updates when new users are added to the build project | ||
who are able to help maintain the containerized builds. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
- hosts: iojs-build-smartos | ||
|
||
remote_user: root | ||
|
||
vars: | ||
- ansible_python_interpreter: "/usr/bin/env python" | ||
|
||
tasks: | ||
|
||
- include_vars: ansible-vars.yaml | ||
tags: vars | ||
|
||
- name: General | pkgin Update | ||
command: pkgin up | ||
tags: general | ||
|
||
- name: General | Install required packages | ||
command: pkgin -y in {{ item }} | ||
with_items: packages | ||
tags: general | ||
|
||
- name: User | Add {{ server_user }} group | ||
command: groupadd {{ server_user }} | ||
tags: user | ||
|
||
- name: User | Add {{ server_user }} user | ||
user: name="{{ server_user }}" shell=/bin/bash append=yes groups=staff,{{ server_user }} | ||
tags: user | ||
|
||
- name: User | Unlock {{ server_user }} user | ||
command: passwd -N {{ server_user }} | ||
tags: user | ||
|
||
- name: User | Download pubkey(s) | ||
get_url: url=https://github.com/{{ item }}.keys dest=/tmp/{{ item }}.keys | ||
delegate_to: 127.0.0.1 | ||
with_items: ssh_users | ||
tags: user | ||
|
||
- name: General | Create authorized_keys for root | ||
authorized_key: user="root" key="{{ lookup('file', '/tmp/' + item + '.keys') }}" | ||
with_items: ssh_users | ||
tags: user | ||
|
||
- name: General | Create authorized_keys for {{ server_user }} | ||
authorized_key: user="{{ server_user }}" key="{{ lookup('file', '/tmp/' + item + '.keys') }}" | ||
with_items: ssh_users | ||
tags: user | ||
|
||
- name: Jenkins | Download Jenkins' slave.jar | ||
command: curl -sL https://jenkins-iojs.nodesource.com/jnlpJars/slave.jar -o /home/{{ server_user }}/slave.jar | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy SMF manifest | ||
copy: src=./resources/jenkins_manifest.xml dest=/home/{{ server_user }}/jenkins_manifest.xml owner={{ server_user }} group={{ server_user }} mode=0755 | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy secrets into manifest | ||
replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{secret\}\}" replace="{{ server_secret }}" | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy server id into manifest | ||
replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{id\}\}" replace="{{ server_id }}" | ||
tags: jenkins | ||
|
||
- name: Jenkins | Copy destination cpu architecture into manifest | ||
replace: dest=/home/{{ server_user }}/jenkins_manifest.xml regexp="\{\{destcpu\}\}" replace="{{ destcpu }}" | ||
tags: jenkins | ||
|
||
- name: Jenkins | Import jenkins SMF manifest | ||
command: svccfg -v import /home/{{ server_user }}/jenkins_manifest.xml | ||
tags: jenkins | ||
|
||
- name: Jenkins | Start service | ||
command: svcadm enable svc:/application/jenkins:default | ||
tags: jenkins |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
server_user: iojs | ||
# override through host_vars if needed. we need it since we currently | ||
# run 32-bit tests on a 64-bit host. default is 64-bit. | ||
destcpu: x64 | ||
ssh_users: | ||
- geek | ||
- rvagg | ||
- jbergstroem | ||
packages: | ||
- openjdk7 | ||
- git | ||
- gcc49 | ||
- gcc49-libs | ||
- gccmakedep | ||
- gmake | ||
- automake | ||
- libtool |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
iojs-build-smartos-* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version='1.0'?> | ||
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> | ||
<service_bundle type='manifest' name='jenkins'> | ||
<service name='application/jenkins' type='service' version='1'> | ||
|
||
<create_default_instance enabled='true' /> | ||
|
||
<single_instance /> | ||
|
||
<dependency name='network' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/milestone/network:default' /> | ||
</dependency> | ||
<dependency name='filesystem' grouping='require_all' restart_on='error' type='service'> | ||
<service_fmri value='svc:/system/filesystem/local' /> | ||
</dependency> | ||
|
||
<method_context working_directory="/home/iojs"> | ||
<method_credential user='iojs' group='iojs' privileges='basic,net_privaddr' /> | ||
<method_environment> | ||
<envvar name='NODE_COMMON_PIPE' value='/home/iojs/test.pipe' /> | ||
<envvar name='OSTYPE' value='solaris' /> | ||
<envvar name='JOBS' value='8' /> | ||
<envvar name='DESTCPU' value='{{destcpu}}' /> | ||
<envvar name='PATH' value='/usr/local/sbin:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin' /> | ||
</method_environment> | ||
</method_context> | ||
|
||
<exec_method type='method' | ||
name='start' | ||
exec='/opt/local/bin/java -Xmx512m -jar slave.jar -jnlpUrl https://jenkins-iojs.nodesource.com/computer/iojs-joyent-smartos-{{id}}/slave-agent.jnlp -secret {{secret}} >> /home/iojs/jenkins_console.log' | ||
timeout_seconds='60' /> | ||
|
||
<exec_method type="method" | ||
name="stop" | ||
exec=":kill" | ||
timeout_seconds="60" /> | ||
|
||
<exec_method name='refresh' | ||
type='method' | ||
exec=':kill -HUP' | ||
timeout_seconds='60' /> | ||
|
||
<property_group name="startd" type="framework"> | ||
<propval name="duration" type="astring" value="child"/> | ||
<propval name="ignore_error" type="astring" value="core,signal"/> | ||
</property_group> | ||
|
||
<property_group name="application" type="application"></property_group> | ||
|
||
<stability value='Evolving' /> | ||
|
||
<template> | ||
<common_name> | ||
<loctext xml:lang='C'>Jenkins Continuous Build Server</loctext> | ||
</common_name> | ||
<documentation> | ||
<doc_link name='hudson.dev.java.net' uri='http://jenkins-ci.org/' /> | ||
</documentation> | ||
</template> | ||
</service> | ||
</service_bundle> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.