diff options
author | Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> | 2014-09-16 18:22:40 +0100 |
---|---|---|
committer | Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> | 2014-09-16 18:22:40 +0100 |
commit | 0f11a6cbe1f4a70279c06ecdacaea942db36c209 (patch) | |
tree | 7fdd79bce4258dbadf532a094fd750cf5374d581 | |
parent | 9727091d1d127d375287a1c8d5d33413691db511 (diff) | |
parent | 68e2d0bcddcb6cab8a5d378bbf2e5e42f7cad42a (diff) | |
download | definitions-0f11a6cbe1f4a70279c06ecdacaea942db36c209.tar.gz |
Merge branch 'baserock/franred/gerrit-in-baserock'
Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk>
Richard Maw <richard.maw@codethink.co.uk>
Merged-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
-rw-r--r-- | clusters/gerrit-openstack.morph | 16 | ||||
-rwxr-xr-x | gerrit.configure | 50 | ||||
-rw-r--r-- | strata/ceph-service.morph | 15 | ||||
-rw-r--r-- | strata/ceph-service/nspr.morph | 6 | ||||
-rw-r--r-- | strata/network-security.morph | 19 | ||||
-rw-r--r-- | strata/network-security/nspr.morph | 12 | ||||
-rw-r--r-- | strata/network-security/nss.morph (renamed from strata/ceph-service/nss.morph) | 0 | ||||
-rw-r--r-- | strata/patch-manager-gerrit.morph | 11 | ||||
-rw-r--r-- | strata/patch-manager-gerrit/gerrit-installation-binaries.morph | 28 | ||||
-rw-r--r-- | strata/tools.morph | 6 | ||||
-rw-r--r-- | systems/ceph-service-x86_64-generic.morph | 2 | ||||
-rw-r--r-- | systems/gerrit-x86_64.morph | 33 |
12 files changed, 178 insertions, 20 deletions
diff --git a/clusters/gerrit-openstack.morph b/clusters/gerrit-openstack.morph new file mode 100644 index 00000000..bdfb128c --- /dev/null +++ b/clusters/gerrit-openstack.morph @@ -0,0 +1,16 @@ +name: open-stack-gerrit +kind: cluster +description: | + Deploy gerrit morphology into openstack +systems: +- morph: systems/gerrit-x86_64.morph + deploy: + openstack-image: + type: openstack + location: http://openstack-host:5000/v2.0/ + DISK_SIZE: 4G + OPENSTACK_USER: openstack-user + OPENSTACK_TENANT: openstack-tenant + OPENSTACK_IMAGENAME: Gerrit + CLOUD_INIT: yes + KERNEL_ARGS: console=ttyS0 console=tty0 diff --git a/gerrit.configure b/gerrit.configure new file mode 100755 index 00000000..b691ea95 --- /dev/null +++ b/gerrit.configure @@ -0,0 +1,50 @@ +#!/bin/sh +# +# Copyright (C) 2014 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# +# This is a "morph deploy" configuration extension to enable bash +# as default shell in gerrit systems. +set -e + +ROOT="$1" + +############################################################################### + +# Set bash as default shell +ln -sfn bash "$ROOT/bin/sh" + +############################################################################### +echo "Creating gerrit-daemon unit file" + +cat << EOF > "$ROOT"/etc/systemd/system/gerrit-daemon.service +[Unit] +Description=Gerrit Code Review Server Service + +ConditionPathExists=/home/gerrit2/gerrit/.gerrit_controller + +[Service] +User=gerrit2 +Group=gerrit2 +Environment="PATH=/usr/bin:/bin" +Type=forking +ExecStart=/home/gerrit2/gerrit/.gerrit_controller/bin/gerrit.sh start + +[Install] +WantedBy=multi-user.target +EOF +ln -sfn "../gerrit-daemon.service" \ + "$ROOT/etc/systemd/system/multi-user.target.wants/gerrit-daemon.service" diff --git a/strata/ceph-service.morph b/strata/ceph-service.morph index 79db626d..25d6712d 100644 --- a/strata/ceph-service.morph +++ b/strata/ceph-service.morph @@ -2,20 +2,8 @@ name: ceph-service kind: stratum build-depends: - morph: strata/foundation.morph +- morph: strata/network-security.morph chunks: -- name: nspr - morph: strata/ceph-service/nspr.morph - repo: upstream:nspr-hg - ref: a6ee84946475c1fb7624973af28163f6da247c0d - unpetrify-ref: baserock/morph - build-depends: [] -- name: nss - morph: strata/ceph-service/nss.morph - repo: upstream:nss - ref: ee1c99a3c8c29f50a91ab28f2f7b7773f6355487 - unpetrify-ref: baserock/morph - build-depends: - - nspr - name: libaio morph: strata/ceph-service/libaio.morph repo: upstream:libaio @@ -71,7 +59,6 @@ chunks: build-depends: - libaio - gperftools - - nss - leveldb - libeditline - keyutils diff --git a/strata/ceph-service/nspr.morph b/strata/ceph-service/nspr.morph deleted file mode 100644 index a5224fb4..00000000 --- a/strata/ceph-service/nspr.morph +++ /dev/null @@ -1,6 +0,0 @@ -name: nspr -kind: chunk -build-system: autotools -configure-commands: -- ./configure --prefix=$PREFIX --with-mozilla --with-pthreads $([ $(uname -m) = x86_64 - ] && echo --enable-64bit) diff --git a/strata/network-security.morph b/strata/network-security.morph new file mode 100644 index 00000000..3d0c7814 --- /dev/null +++ b/strata/network-security.morph @@ -0,0 +1,19 @@ +name: network-security +kind: stratum +build-depends: +- morph: strata/core.morph +chunks: +- name: nspr + morph: strata/network-security/nspr.morph + repo: upstream:nspr-hg + ref: a6ee84946475c1fb7624973af28163f6da247c0d + unpetrify-ref: baserock/morph + build-depends: [] +- name: nss + morph: strata/network-security/nss.morph + repo: upstream:nss + ref: ee1c99a3c8c29f50a91ab28f2f7b7773f6355487 + unpetrify-ref: baserock/morph + build-depends: + - nspr + diff --git a/strata/network-security/nspr.morph b/strata/network-security/nspr.morph new file mode 100644 index 00000000..27613eb4 --- /dev/null +++ b/strata/network-security/nspr.morph @@ -0,0 +1,12 @@ +name: nspr +kind: chunk +build-system: autotools +configure-commands: +- | + case "$MORPH_ARCH" in + x86_64|ppc64) + EXTRA_ARGS="--enable-64bit";; + *) + EXTRA_ARGS="";; + esac + ./configure --prefix="$PREFIX" --with-mozilla --with-pthreads $EXTRA_ARGS diff --git a/strata/ceph-service/nss.morph b/strata/network-security/nss.morph index c83fd174..c83fd174 100644 --- a/strata/ceph-service/nss.morph +++ b/strata/network-security/nss.morph diff --git a/strata/patch-manager-gerrit.morph b/strata/patch-manager-gerrit.morph new file mode 100644 index 00000000..bcc03c86 --- /dev/null +++ b/strata/patch-manager-gerrit.morph @@ -0,0 +1,11 @@ +name: patch-manager-gerrit +kind: stratum +build-depends: +- morph: strata/tools.morph +chunks: +- name: gerrit-installation-binaries + morph: strata/patch-manager-gerrit/gerrit-installation-binaries.morph + repo: github:franred/gerrit-installation-binaries + ref: ef262c635890f19eaff8ef6bbd831ee9b0d8693e + unpetrify-ref: master + build-depends: [] diff --git a/strata/patch-manager-gerrit/gerrit-installation-binaries.morph b/strata/patch-manager-gerrit/gerrit-installation-binaries.morph new file mode 100644 index 00000000..b0d1a393 --- /dev/null +++ b/strata/patch-manager-gerrit/gerrit-installation-binaries.morph @@ -0,0 +1,28 @@ +name: gerrit-installation-binaries +kind: chunk +configure-commands: [] +build-commands: +- cat jdk-8u20-linux-x64.tar.gz_* > jdk-8u20-linux-x64.tar.gz +install-commands: +- mkdir -p "$DESTDIR$PREFIX"/bin +- mkdir -p "$DESTDIR$PREFIX"/lib +- mkdir -p "$DESTDIR$PREFIX"/share/gerrit +- cp gerrit-2.9.war "$DESTDIR$PREFIX"/share/gerrit +- tar zxf jdk-8u20-linux-x64.tar.gz -C "$DESTDIR$PREFIX"/lib +- unzip jce_policy-8.zip -d "$DESTDIR$PREFIX"/lib/jdk1.8.0_20/jre/lib/security +- ln -sfn "$PREFIX"/lib/jdk1.8.0_20/jre/bin/java "$DESTDIR$PREFIX"/bin/ +system-integration: + gerrit-installation-binaries-misc: + 01-adduser: + - adduser -D -h /home/gerrit2 -g 'Gerrit Administrator' -s /bin/sh gerrit2 + 02-install-gerrit: + - | + install -D /usr/share/gerrit/gerrit-2.9.war /home/gerrit2/gerrit/gerrit-2.9.war \ + -o gerrit2 -g gerrit2 -m 644 + chown gerrit2 /home/gerrit2/gerrit + sudo LD_LIBRARY_PATH=/usr/jdk1.8.0_20/jre/lib/amd64/jli \ + -u gerrit2 java -jar /home/gerrit2/gerrit/gerrit-2.9.war \ + init --batch -d /home/gerrit2/gerrit/.gerrit_controller \ + --no-auto-start + sed -i "s|canonicalWebUrl =.*|canonicalWebUrl = http://localhost:8080|g" \ + /home/gerrit2/gerrit/.gerrit_controller/etc/gerrit.config diff --git a/strata/tools.morph b/strata/tools.morph index 6ee70fdb..e039b50a 100644 --- a/strata/tools.morph +++ b/strata/tools.morph @@ -170,3 +170,9 @@ chunks: ref: a4769dc7999b53260325fb89945bef85714fb338 unpetrify-ref: baserock/morph build-depends: [] +- name: procps-ng + repo: upstream:procps-ng + ref: 85fff468fa263cdd2ff1c0144579527c32333695 + unpetrify-ref: v3.3.9 + build-depends: [] + prefix: / diff --git a/systems/ceph-service-x86_64-generic.morph b/systems/ceph-service-x86_64-generic.morph index 567443c4..182cf0cd 100644 --- a/systems/ceph-service-x86_64-generic.morph +++ b/systems/ceph-service-x86_64-generic.morph @@ -12,6 +12,8 @@ strata: morph: strata/foundation.morph - name: bsp-x86_64-generic morph: strata/bsp-x86_64-generic.morph +- name: network-security + morph: strata/network-security.morph - name: ceph-service morph: strata/ceph-service.morph configuration-extensions: diff --git a/systems/gerrit-x86_64.morph b/systems/gerrit-x86_64.morph new file mode 100644 index 00000000..0dbca14e --- /dev/null +++ b/systems/gerrit-x86_64.morph @@ -0,0 +1,33 @@ +name: gerrit-x86_64 +kind: system +description: system to install gerrit on it +arch: x86_64 +strata: +- name: build-essential + morph: strata/build-essential.morph +- name: bsp-x86_64-generic + morph: strata/bsp-x86_64-generic.morph +- name: foundation + morph: strata/foundation.morph +- name: core + morph: strata/core.morph +- name: tools + morph: strata/tools.morph +- name: nfs + morph: strata/nfs.morph +- name: databases + morph: strata/databases.morph +- name: network-security + morph: strata/network-security.morph +- name: cloudinit-support + morph: strata/cloudinit-support.morph +- name: patch-manager-gerrit + morph: strata/patch-manager-gerrit.morph +configuration-extensions: +- set-hostname +- add-config-files +- simple-network +- nfsboot +- install-files +- cloud-init +- gerrit |