bosh-gen 0.100.0 → 0.101.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bosh/gen/generators/blacksmith_forge_generator/templates/jobs/%job_name%/templates/plans/standalone/manifest.yml.tt +1 -1
- data/lib/bosh/gen/generators/package_apt_generator.rb +4 -44
- data/lib/bosh/gen/generators/package_apt_generator/templates/jobs/%name%-pkg-install/monit +0 -0
- data/lib/bosh/gen/generators/package_apt_generator/templates/jobs/%name%-pkg-install/spec.tt +5 -0
- data/lib/bosh/gen/generators/package_apt_generator/templates/jobs/%name%-pkg-install/templates/bin/pre-start.sh +5 -0
- data/lib/bosh/gen/generators/package_apt_generator/templates/packages/%name%/packaging.tt +33 -0
- data/lib/bosh/gen/generators/package_apt_generator/templates/packages/%name%/spec.tt +4 -0
- data/lib/bosh/gen/version.rb +1 -1
- metadata +7 -6
- data/lib/bosh/gen/generators/package_apt_generator/templates/Vagrantfile +0 -13
- data/lib/bosh/gen/generators/package_apt_generator/templates/src/apt/%name%/aptfile.tt +0 -1
- data/lib/bosh/gen/generators/package_apt_generator/templates/src/apt/%name%/profile.sh.tt +0 -5
- data/lib/bosh/gen/generators/package_apt_generator/templates/src/apt/fetch_debs.sh +0 -70
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b78a94705fa08c3bf3fdf40185d6337754d8a5d35d18a4e0e9fb3afcff9f7ff
|
4
|
+
data.tar.gz: 7b90bac834ecee203a1f81c68e80a2e9280016fb22993c877b2a3e5250d01008
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bb8f1c5c0ac93c85710675f3322415233cb99cdb4ba94fba36ca98ed69464e5000c3d3e9e34e67c8c8a4f87094874da5a3eac818492fc027a6fad7c5c625ee1
|
7
|
+
data.tar.gz: a020deced1a75cc829af9f337251a66dd8e9a37e03148b86609ecfb1bba8de8ad2d520c549bee9db008fab1b0795afdc2e3ed72879edc1b411429345519d3bc3
|
@@ -33,55 +33,15 @@ module Bosh::Gen
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def packaging
|
36
|
-
|
37
|
-
|
38
|
-
set -e # exit immediately if a simple command exits with a non-zero status
|
39
|
-
set -u # report the usage of uninitialized variables
|
40
|
-
|
41
|
-
# Available variables
|
42
|
-
# $BOSH_COMPILE_TARGET - where this package & spec'd source files are available
|
43
|
-
# $BOSH_INSTALL_TARGET - where you copy/install files to be included in package
|
44
|
-
|
45
|
-
mkdir -p $BOSH_INSTALL_TARGET/apt
|
46
|
-
|
47
|
-
for DEB in $(ls -1 apt/#{name}/*.deb); do
|
48
|
-
echo "Installing $(basename $DEB)"
|
49
|
-
dpkg -x $DEB $BOSH_INSTALL_TARGET/apt
|
50
|
-
done
|
51
|
-
|
52
|
-
cp -a apt/#{name}/profile.sh $BOSH_INSTALL_TARGET/
|
53
|
-
SHELL
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def package_specification
|
58
|
-
src_files = ["apt/#{name}/profile.sh", "apt/#{name}/*.deb"]
|
59
|
-
config = { "name" => name, "dependencies" => dependencies, "files" => src_files }
|
60
|
-
create_file package_dir("spec"), YAML.dump(config)
|
61
|
-
end
|
62
|
-
|
63
|
-
def common_helpers
|
64
|
-
directory 'src/apt'
|
65
|
-
chmod 'src/apt/fetch_debs.sh', 0755
|
66
|
-
end
|
67
|
-
|
68
|
-
def vagrantfile
|
69
|
-
copy_file 'Vagrantfile'
|
36
|
+
directory 'packages'
|
37
|
+
directory 'jobs'
|
70
38
|
end
|
71
39
|
|
72
40
|
def show_instructions
|
73
41
|
say "Next steps:", :green
|
74
42
|
say <<-README.gsub(/^ /, '')
|
75
|
-
1. Edit
|
76
|
-
2.
|
77
|
-
|
78
|
-
vagrant up
|
79
|
-
vagrant ssh -c '/vagrant/src/apt/fetch_debs.sh #{name}'
|
80
|
-
vagrant destroy
|
81
|
-
|
82
|
-
You can search for aptitude debian packages using apt-cache:
|
83
|
-
|
84
|
-
vagrant ssh -c 'apt-cache search #{name} | sort'
|
43
|
+
1. Edit packages/#{name}/packaging to specify list of debian packages to install
|
44
|
+
2. Add "#{name}-pkg-install" job into deployment manifest
|
85
45
|
README
|
86
46
|
end
|
87
47
|
|
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eux
|
4
|
+
|
5
|
+
# SEE BELOW to specify the Debian packages to install
|
6
|
+
|
7
|
+
baseDir=$BOSH_INSTALL_TARGET
|
8
|
+
cacheDir="$baseDir/apt/cache"
|
9
|
+
mkdir -p "$cacheDir"
|
10
|
+
|
11
|
+
# https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1577926
|
12
|
+
ls -al /tmp
|
13
|
+
chmod 1777 /tmp
|
14
|
+
|
15
|
+
apt-get install -y apt-transport-https apt-utils
|
16
|
+
|
17
|
+
curl -sL https://raw.githubusercontent.com/starkandwayne/homebrew-cf/master/public.key | apt-key add -
|
18
|
+
echo "deb http://apt.starkandwayne.com stable main" | tee /etc/apt/sources.list.d/starkandwayne.list
|
19
|
+
apt-get update
|
20
|
+
apt-get install install-debs-in-order
|
21
|
+
|
22
|
+
apt-get update
|
23
|
+
|
24
|
+
######################################
|
25
|
+
#
|
26
|
+
# Add list of packages to install here
|
27
|
+
apt-get install -o debug::nolocking=true -o dir::cache=$cacheDir -y -d \
|
28
|
+
<%= deb_package_name %>
|
29
|
+
#
|
30
|
+
######################################
|
31
|
+
|
32
|
+
cd $cacheDir/archives
|
33
|
+
install-debs-in-order . > install-packages.sh
|
data/lib/bosh/gen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.101.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dr Nic Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -206,10 +206,11 @@ files:
|
|
206
206
|
- lib/bosh/gen/generators/new_release_generator/templates/src/.gitkeep
|
207
207
|
- lib/bosh/gen/generators/package_apt_generator.rb
|
208
208
|
- lib/bosh/gen/generators/package_apt_generator/templates/.gitkeep
|
209
|
-
- lib/bosh/gen/generators/package_apt_generator/templates/
|
210
|
-
- lib/bosh/gen/generators/package_apt_generator/templates/
|
211
|
-
- lib/bosh/gen/generators/package_apt_generator/templates/
|
212
|
-
- lib/bosh/gen/generators/package_apt_generator/templates/
|
209
|
+
- lib/bosh/gen/generators/package_apt_generator/templates/jobs/%name%-pkg-install/monit
|
210
|
+
- lib/bosh/gen/generators/package_apt_generator/templates/jobs/%name%-pkg-install/spec.tt
|
211
|
+
- lib/bosh/gen/generators/package_apt_generator/templates/jobs/%name%-pkg-install/templates/bin/pre-start.sh
|
212
|
+
- lib/bosh/gen/generators/package_apt_generator/templates/packages/%name%/packaging.tt
|
213
|
+
- lib/bosh/gen/generators/package_apt_generator/templates/packages/%name%/spec.tt
|
213
214
|
- lib/bosh/gen/generators/package_docker_image_generator.rb
|
214
215
|
- lib/bosh/gen/generators/package_docker_image_generator/templates/jobs/%job_name%/monit.tt
|
215
216
|
- lib/bosh/gen/generators/package_docker_image_generator/templates/jobs/%job_name%/spec.tt
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Vagrant used to allow non-Ubuntu hosts to execute
|
2
|
-
# apt-get commands to fetch debian packages.
|
3
|
-
Vagrant.configure('2') do |config|
|
4
|
-
|
5
|
-
config.vm.hostname='boshrelease-builder'
|
6
|
-
config.vm.box = "ubuntu/xenial64"
|
7
|
-
|
8
|
-
# Need NFS enabled, and hence a private network for virtualbox
|
9
|
-
# as discussed in this project's patch
|
10
|
-
# https://github.com/reidab/citizenry/commit/590ca245b9a4fc96c55ab7bc3bbafa38583f8cda
|
11
|
-
config.vm.network "private_network", ip: "192.168.50.5"
|
12
|
-
config.vm.synced_folder ".", "/vagrant", type: "nfs"
|
13
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
<%= deb_package_name %>
|
@@ -1,5 +0,0 @@
|
|
1
|
-
export PATH="/var/vcap/packages/<%= name %>/apt/usr/bin:$PATH"
|
2
|
-
export LD_LIBRARY_PATH="/var/vcap/packages/<%= name %>/apt/usr/lib:${LD_LIBRARY_PATH:-}"
|
3
|
-
export INCLUDE_PATH="/var/vcap/packages/<%= name %>/apt/usr/include:${INCLUDE_PATH:-}"
|
4
|
-
export CPATH="$INCLUDE_PATH"
|
5
|
-
export CPPPATH="$INCLUDE_PATH"
|
@@ -1,70 +0,0 @@
|
|
1
|
-
set -e # exit immediately if a simple command exits with a non-zero status
|
2
|
-
set -u # report the usage of uninitialized variables
|
3
|
-
set -o pipefail # return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status
|
4
|
-
|
5
|
-
# Usage: src/common/fetch_debs.sh postgresql [src/apt/postgresql]
|
6
|
-
#
|
7
|
-
# src/common/fetch_debs.sh postgresql
|
8
|
-
# src/common/fetch_debs.sh postgresql src/apt/postgresql
|
9
|
-
#
|
10
|
-
PACKAGE_NAME=$1
|
11
|
-
RELEASE_DIR=${RELEASE_DIR:-/vagrant}
|
12
|
-
if [[ "${2:-X}" == "X" ]]; then
|
13
|
-
PACKAGE_SRC_DIR=$RELEASE_DIR/src/apt/$PACKAGE_NAME
|
14
|
-
else
|
15
|
-
PACKAGE_SRC_DIR=$RELEASE_DIR/$2
|
16
|
-
fi
|
17
|
-
APTFILE=$PACKAGE_SRC_DIR/aptfile
|
18
|
-
APT_CACHE_DIR="$RELEASE_DIR/tmp/apt/cache/$PACKAGE_NAME"
|
19
|
-
APT_STATE_DIR="$RELEASE_DIR/tmp/apt/state"
|
20
|
-
BLOBS_DIR=$RELEASE_DIR/blobs/apt/$PACKAGE_NAME
|
21
|
-
|
22
|
-
function error() {
|
23
|
-
echo " ! $*" >&2
|
24
|
-
exit 1
|
25
|
-
}
|
26
|
-
|
27
|
-
function topic() {
|
28
|
-
echo "-----> $*"
|
29
|
-
}
|
30
|
-
|
31
|
-
function indent() {
|
32
|
-
c='s/^/ /'
|
33
|
-
case $(uname) in
|
34
|
-
Darwin) sed -l "$c";;
|
35
|
-
*) sed -u "$c";;
|
36
|
-
esac
|
37
|
-
}
|
38
|
-
|
39
|
-
topic "Environment information"
|
40
|
-
echo $0 | indent
|
41
|
-
uname -a | indent
|
42
|
-
pwd | indent
|
43
|
-
|
44
|
-
# Invoke apt-get to ensure it exists
|
45
|
-
if [[ "$(which apt-get)X" == "X" ]]; then
|
46
|
-
error "Cannot find apt-get executable. Run this script within a Debian/Ubuntu environment."
|
47
|
-
fi
|
48
|
-
which apt-get | indent
|
49
|
-
|
50
|
-
echo $APTFILE | indent
|
51
|
-
if [[ ! -f $APTFILE ]]; then
|
52
|
-
error "Missing source file $APTFILE"
|
53
|
-
fi
|
54
|
-
|
55
|
-
mkdir -p "$APT_CACHE_DIR/archives/partial"
|
56
|
-
mkdir -p "$APT_STATE_DIR/lists/partial"
|
57
|
-
mkdir -p $BLOBS_DIR
|
58
|
-
|
59
|
-
APT_OPTIONS="-o debug::nolocking=true -o dir::cache=$APT_CACHE_DIR -o dir::state=$APT_STATE_DIR"
|
60
|
-
|
61
|
-
topic "Updating apt caches"
|
62
|
-
apt-get $APT_OPTIONS update | indent
|
63
|
-
|
64
|
-
for PACKAGE in $(cat $APTFILE); do
|
65
|
-
topic "Fetching .debs for $PACKAGE"
|
66
|
-
apt-get $APT_OPTIONS -y -d install $PACKAGE | indent
|
67
|
-
done
|
68
|
-
|
69
|
-
topic "Copying .debs to blobs"
|
70
|
-
cp -a $APT_CACHE_DIR/archives/*.deb $BLOBS_DIR/
|