From d4fcfdf85ee52397d1474b84772e410b8c29f6bf Mon Sep 17 00:00:00 2001 From: Caleb Washburn Date: Wed, 26 Dec 2018 14:16:46 -0600 Subject: [PATCH] adding final blobs --- .gitignore | 19 ++++++++++++++++ README.md | 7 ++++++ config/blobs.yml | 8 +++++++ config/final.yml | 6 +++++ jobs/jumpbox/monit | 5 +++++ jobs/jumpbox/spec | 33 ++++++++++++++++++++++++++++ jobs/jumpbox/templates/config/bashrc | 9 ++++++++ jobs/tools/monit | 0 jobs/tools/spec | 9 ++++++++ packages/tools/packaging | 32 +++++++++++++++++++++++++++ packages/tools/spec | 9 ++++++++ src/.gitkeep | 0 12 files changed, 137 insertions(+) create mode 100644 .gitignore create mode 100644 config/blobs.yml create mode 100644 config/final.yml create mode 100644 jobs/jumpbox/monit create mode 100644 jobs/jumpbox/spec create mode 100644 jobs/jumpbox/templates/config/bashrc create mode 100644 jobs/tools/monit create mode 100644 jobs/tools/spec create mode 100644 packages/tools/packaging create mode 100644 packages/tools/spec create mode 100644 src/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..565edcf --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +config/dev.yml +config/private.yml +releases/*.tgz +releases/**/*.tgz +dev_releases +.blobs +blobs +.dev_builds +.idea +.DS_Store +.final_builds/jobs/**/*.tgz +.final_builds/packages/**/*.tgz +*.swp +*~ +*# +#* +pkg +bin +*.tgz diff --git a/README.md b/README.md index 04a2a86..871a71a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # jumpbox-boshrelease Bosh release for setting up jumpbox with needed utilities + +Inspired by https://github.com/cloudfoundry-community/jumpbox-boshrelease + +# Included items +- Docker +- git +- pivnet-cli diff --git a/config/blobs.yml b/config/blobs.yml new file mode 100644 index 0000000..6110cfe --- /dev/null +++ b/config/blobs.yml @@ -0,0 +1,8 @@ +tools/bins/pivnet-cli: + size: 9830426 + object_id: d1c3a5f7-8fd8-4db6-52a1-38ad9b018b21 + sha: 10a3faace933eb5667b8ad5f7399ec8a19898732 +tools/git-2.14.1.tar.gz: + size: 6987933 + object_id: adc9a931-7d5e-4d9f-6a48-b1affd23b5a6 + sha: e173270a5f224078e3f6c639937da5bd84045225 diff --git a/config/final.yml b/config/final.yml new file mode 100644 index 0000000..656ce6c --- /dev/null +++ b/config/final.yml @@ -0,0 +1,6 @@ +--- +final_name: jumpbox +blobstore: + provider: s3 + options: + bucket_name: pivotalservices-bosh-blobs diff --git a/jobs/jumpbox/monit b/jobs/jumpbox/monit new file mode 100644 index 0000000..c396855 --- /dev/null +++ b/jobs/jumpbox/monit @@ -0,0 +1,5 @@ +check process watcher + with pidfile /var/vcap/sys/run/jumpbox/watcher.pid + start program "/var/vcap/jobs/jumpbox/bin/jumpbox_ctl start" + stop program "/var/vcap/jobs/jumpbox/bin/jumpbox_ctl stop" + group vcap diff --git a/jobs/jumpbox/spec b/jobs/jumpbox/spec new file mode 100644 index 0000000..8bfb78c --- /dev/null +++ b/jobs/jumpbox/spec @@ -0,0 +1,33 @@ +--- +name: jumpbox +packages: +- tools + +templates: + bin/jumpbox_ctl: bin/jumpbox_ctl + bin/watcher: bin/watcher + config/banner: config/banner + config/bashrc: config/bashrc + +properties: + jumpbox.hostname: + description: "Hostname to set on the jumpbox" + default: "jumpbox.local" + + jumpbox.hosts: + description: "A list of entries to append to /etc/hosts" + default: [] + + jumpbox.ssh_password_auth: + description: "Modify the jumpbox SSH configuration to permit users to authenticate via passwords when using SSH." + default: false + + jumpbox.users: + default: [] + description: |- + List of users to create + - name: cwashburn + shell: /bin/bash + ssh_keys: + - ssh-rsa AAAAB3NzaC1yabcd + - ssh-rsa AAAAB3NzaC1y1234 diff --git a/jobs/jumpbox/templates/config/bashrc b/jobs/jumpbox/templates/config/bashrc new file mode 100644 index 0000000..b745332 --- /dev/null +++ b/jobs/jumpbox/templates/config/bashrc @@ -0,0 +1,9 @@ +#!/bin/bash +## jumpbox system-wide bashrc +export PS1=$(echo '[\[\e[1;33m\t\e[0m\]] \[\e[1;32m\]\u@\h\[\e[0m\] \[\e[1;34m\]\w\[\e[0m\]\n\[\e[1;34m\]\$ \[\e[0m\]') +umask 002 + +################################################################################ +##################################################### env vars you get for free +export DOCKER_HOST=unix:///var/vcap/sys/run/docker/docker.sock +export PATH=/var/vcap/packages/tools/bin:/var/vcap/packages/docker/bin:$PATH diff --git a/jobs/tools/monit b/jobs/tools/monit new file mode 100644 index 0000000..e69de29 diff --git a/jobs/tools/spec b/jobs/tools/spec new file mode 100644 index 0000000..90aa836 --- /dev/null +++ b/jobs/tools/spec @@ -0,0 +1,9 @@ +--- +name: tools +packages: + - tools + +templates: + bin/run: bin/run + +properties: {} diff --git a/packages/tools/packaging b/packages/tools/packaging new file mode 100644 index 0000000..4d4f1c9 --- /dev/null +++ b/packages/tools/packaging @@ -0,0 +1,32 @@ +#!/bin/bash +set -e # exit immediately if a simple command exits with a non-zero status +set -u # report the usage of uninitialized variables + +# Detect # of CPUs so make jobs can be parallelized +CPUS=$(grep -c ^processor /proc/cpuinfo) + # Available variables +# $BOSH_COMPILE_TARGET - where this package & spec'd source files are available +# $BOSH_INSTALL_TARGET - where you copy/install files to be included in package +export HOME=/var/vcap +n=0 # how many jobs have we spun in parallel? + +mkdir ${BOSH_INSTALL_TARGET}/bin + +cp -a tools/bins/* ${BOSH_INSTALL_TARGET}/bin +chmod 0755 ${BOSH_INSTALL_TARGET}/bin/* + + +# GIT +# https://www.kernel.org/pub/software/scm/git +# https://www.kernel.org/pub/software/scm/git/git-2.14.1.tar.gz +(tar -xzvf tools/git-2.14.1.tar.gz + cd git-2.14.1 + ./configure --prefix=${BOSH_INSTALL_TARGET} + make -j${CPUS} all + make install) & +n=$((n + 1)) + +while [[ $n -gt 0 ]]; do + wait -n + n=$((n - 1)) +done diff --git a/packages/tools/spec b/packages/tools/spec new file mode 100644 index 0000000..2a02687 --- /dev/null +++ b/packages/tools/spec @@ -0,0 +1,9 @@ +--- +name: tools + +dependencies: [] + +files: + - tools/bins/pivnet-cli + # git + - tools/git-2.14.1.tar.gz diff --git a/src/.gitkeep b/src/.gitkeep new file mode 100644 index 0000000..e69de29