bosh-gen 0.24.0 → 0.90.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -362
  3. data/bosh-gen.gemspec +2 -1
  4. data/lib/bosh/gen/cli.rb +0 -8
  5. data/lib/bosh/gen/generators/errand_generator/templates/jobs/%job_name%/templates/bin/run.tt +2 -1
  6. data/lib/bosh/gen/generators/job_generator.rb +0 -5
  7. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/monit.tt +2 -2
  8. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/spec.tt +24 -0
  9. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/bin/ctl.tt +1 -1
  10. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/helpers/ctl_setup.sh +0 -26
  11. data/lib/bosh/gen/generators/new_release_generator.rb +7 -8
  12. data/lib/bosh/gen/generators/new_release_generator/templates/README.md.tt +13 -63
  13. data/lib/bosh/gen/generators/new_release_generator/templates/jobs/{just_install_packages → %project_name%}/monit.tt +0 -0
  14. data/lib/bosh/gen/generators/new_release_generator/templates/jobs/{just_install_packages → %project_name%}/spec.tt +1 -1
  15. data/lib/bosh/gen/generators/new_release_generator/templates/jobs/{just_install_packages → %project_name%}/templates/ignoreme +0 -0
  16. data/lib/bosh/gen/generators/new_release_generator/templates/manifests/%project_name%.yml.tt +38 -0
  17. data/lib/bosh/gen/generators/new_release_generator/templates/manifests/operators/dev.yml.tt +6 -0
  18. data/lib/bosh/gen/version.rb +1 -1
  19. metadata +28 -191
  20. data/.travis.yml +0 -13
  21. data/lib/bosh/cli/commands/share_release.rb +0 -80
  22. data/lib/bosh/gen/generators/bosh_cli_plugin_generator.rb +0 -33
  23. data/lib/bosh/gen/generators/bosh_cli_plugin_generator/templates/lib/bosh/cli/commands/%underscore_plugin_name%.rb.tt +0 -9
  24. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/monit.tt +0 -13
  25. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/%job_name%_rack_ctl.tt +0 -59
  26. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_db_utils.sh.erb +0 -54
  27. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_nginx.sh.erb +0 -17
  28. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_redis_utils.sh.erb +0 -18
  29. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_setup.sh.erb +0 -48
  30. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_start.sh.erb +0 -57
  31. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/ctl_utils.sh +0 -147
  32. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/monit_debugger +0 -13
  33. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/nginx_ctl.tt +0 -40
  34. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/bin/rails_ctl_setup.sh.erb +0 -39
  35. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/database.yml.erb +0 -17
  36. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/mime.types +0 -73
  37. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/nginx.conf.erb +0 -150
  38. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/nginx_proxy.conf +0 -11
  39. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_nginx_rack/templates/config/redis.yml.erb +0 -6
  40. data/lib/bosh/gen/generators/job_generator/templates/jobs/%job_name%_simple/templates/data/properties.sh.erb +0 -10
  41. data/lib/bosh/gen/generators/new_release_generator/templates/templates/deployment.yml.tt +0 -31
  42. data/lib/bosh/gen/generators/new_release_generator/templates/templates/infrastructure-aws-ec2.yml.tt +0 -33
  43. data/lib/bosh/gen/generators/new_release_generator/templates/templates/infrastructure-warden.yml.tt +0 -37
  44. data/lib/bosh/gen/generators/new_release_generator/templates/templates/jobs.yml.tt +0 -21
  45. data/lib/bosh/gen/generators/new_release_generator/templates/templates/make_manifest.tt +0 -83
  46. data/lib/bosh/gen/generators/new_release_generator/templates/templates/stub.yml.tt +0 -14
  47. data/lib/bosh/gen/models.rb +0 -9
  48. data/lib/bosh/gen/models/bosh_config.rb +0 -15
  49. data/lib/bosh/gen/models/deployment_manifest.rb +0 -107
  50. data/lib/bosh/gen/models/release_detection.rb +0 -35
  51. data/lib/bosh/gen/utils/file_with_progress_bar.rb +0 -62
  52. data/spec/fixtures/bosh_config/multiple_boshes.yml +0 -34
  53. data/spec/fixtures/deployment_manifests/2_jobs_1_ip_8196_disk.yml +0 -67
  54. data/spec/fixtures/deployment_manifests/2_jobs_1_ip_8196_disk_with_numeric.yml +0 -67
  55. data/spec/fixtures/deployment_manifests/2_jobs_2_ips_no_disk.yml +0 -67
  56. data/spec/fixtures/releases/bosh-sample-release/.gitignore +0 -9
  57. data/spec/fixtures/releases/bosh-sample-release/LICENSE +0 -8094
  58. data/spec/fixtures/releases/bosh-sample-release/NOTICE +0 -12
  59. data/spec/fixtures/releases/bosh-sample-release/README +0 -53
  60. data/spec/fixtures/releases/bosh-sample-release/config/final.yml +0 -9
  61. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/monit +0 -5
  62. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/spec +0 -17
  63. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/my.bootstrap.erb +0 -6
  64. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/my.cnf.erb +0 -46
  65. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/my.shutdown.erb +0 -5
  66. data/spec/fixtures/releases/bosh-sample-release/jobs/mysql/templates/mysql_ctl.erb +0 -56
  67. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/monit +0 -5
  68. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/spec +0 -10
  69. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/templates/mime.types +0 -73
  70. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/templates/nginx.conf.erb +0 -65
  71. data/spec/fixtures/releases/bosh-sample-release/jobs/nginx/templates/nginx_ctl +0 -28
  72. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/monit +0 -5
  73. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/spec +0 -12
  74. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/httpd.conf.erb +0 -422
  75. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/php.ini.erb +0 -1918
  76. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/wordpress_ctl +0 -39
  77. data/spec/fixtures/releases/bosh-sample-release/jobs/wordpress/templates/wp-config.php.erb +0 -90
  78. data/spec/fixtures/releases/bosh-sample-release/packages/apache2/packaging +0 -15
  79. data/spec/fixtures/releases/bosh-sample-release/packages/apache2/spec +0 -5
  80. data/spec/fixtures/releases/bosh-sample-release/packages/mysql/packaging +0 -14
  81. data/spec/fixtures/releases/bosh-sample-release/packages/mysql/spec +0 -5
  82. data/spec/fixtures/releases/bosh-sample-release/packages/mysqlclient/packaging +0 -12
  83. data/spec/fixtures/releases/bosh-sample-release/packages/mysqlclient/spec +0 -4
  84. data/spec/fixtures/releases/bosh-sample-release/packages/nginx/packaging +0 -23
  85. data/spec/fixtures/releases/bosh-sample-release/packages/nginx/spec +0 -6
  86. data/spec/fixtures/releases/bosh-sample-release/packages/php5/packaging +0 -24
  87. data/spec/fixtures/releases/bosh-sample-release/packages/php5/spec +0 -7
  88. data/spec/fixtures/releases/bosh-sample-release/packages/wordpress/packaging +0 -14
  89. data/spec/fixtures/releases/bosh-sample-release/packages/wordpress/spec +0 -5
  90. data/spec/fixtures/releases/s3test-boshrelease/.gitignore +0 -18
  91. data/spec/fixtures/releases/s3test-boshrelease/README.md +0 -51
  92. data/spec/fixtures/releases/s3test-boshrelease/Rakefile +0 -15
  93. data/spec/fixtures/releases/s3test-boshrelease/config/blobs.yml +0 -1
  94. data/spec/fixtures/releases/s3test-boshrelease/config/final.yml +0 -5
  95. data/spec/fixtures/releases/s3test-boshrelease/jobs/.gitkeep +0 -0
  96. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/monit +0 -5
  97. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/spec +0 -13
  98. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/bin/monit_debugger +0 -13
  99. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/bin/s3test_ctl +0 -36
  100. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/config/.gitkeep +0 -0
  101. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/config/s3test.conf.erb +0 -5
  102. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/data/properties.sh.erb +0 -10
  103. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/helpers/ctl_setup.sh +0 -81
  104. data/spec/fixtures/releases/s3test-boshrelease/jobs/s3test/templates/helpers/ctl_utils.sh +0 -156
  105. data/spec/fixtures/releases/s3test-boshrelease/packages/.gitkeep +0 -0
  106. data/spec/fixtures/releases/s3test-boshrelease/src/.gitkeep +0 -0
  107. data/spec/fixtures/releases/s3test-boshrelease/templates/deployment.yml +0 -35
  108. data/spec/fixtures/releases/s3test-boshrelease/templates/infrastructure-aws-ec2.yml +0 -40
  109. data/spec/fixtures/releases/s3test-boshrelease/templates/infrastructure-warden.yml +0 -107
  110. data/spec/fixtures/releases/s3test-boshrelease/templates/jobs.yml +0 -34
  111. data/spec/fixtures/releases/s3test-boshrelease/templates/make_manifest +0 -54
  112. data/spec/fixtures/releases/s3test-boshrelease/templates/stub.yml +0 -13
  113. data/spec/fixtures/releases/some_dev_releases/config/dev.yml +0 -3
  114. data/spec/fixtures/releases/some_dev_releases/dev_releases/index.yml +0 -6
  115. data/spec/fixtures/releases/some_dev_releases/dev_releases/myrelease-1.yml +0 -11
  116. data/spec/fixtures/releases/some_dev_releases/dev_releases/myrelease-10.yml +0 -13
  117. data/spec/fixtures/releases/some_dev_releases/dev_releases/myrelease-2.yml +0 -13
  118. data/spec/generators/job_generator_spec.rb +0 -56
  119. data/spec/generators/new_release_generator_spec.rb +0 -93
  120. data/spec/models/bosh_config_spec.rb +0 -11
  121. data/spec/models/deployment_manifest_spec.rb +0 -40
  122. data/spec/models/release_detection_spec.rb +0 -23
  123. data/spec/spec_helper.rb +0 -30
  124. data/spec/support/generator_spec_helper.rb +0 -155
@@ -1,21 +0,0 @@
1
- ---
2
- update:
3
- canaries: 1
4
- max_in_flight: 50
5
- canary_watch_time: 1000-30000
6
- update_watch_time: 1000-30000
7
- serial: false
8
-
9
- instance_groups:
10
- - name: just_install_packages
11
- jobs:
12
- - name: just_install_packages
13
- release: <%= project_name_hyphenated %>
14
- instances: 1
15
- persistent_disk: 0
16
- resource_pool: small_z1
17
- networks: (( param "Please configure the networks for this job" ))
18
-
19
- networks: (( param "Please configure the global network definitions for this Deployment" ))
20
-
21
- properties: {}
@@ -1,83 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- template_prefix="<%= project_name %>"
6
- STEMCELL_OS=${STEMCELL_OS:-ubuntu}
7
-
8
- infrastructure=$1
9
-
10
- fail() {
11
- echo >&2 $*
12
- }
13
-
14
- if [[ "$infrastructure" != "aws-ec2" && "$infrastructure" != "warden" ]] ; then
15
- fail "usage: ./make_manifest <aws-ec2|warden>"
16
- exit 1
17
- fi
18
-
19
- case "${infrastructure}/${STEMCELL_OS}" in
20
- (warden/*) STEMCELL_URL="https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent" ;;
21
- (aws-ec2/ubuntu) STEMCELL_URL="https://bosh.io/d/stemcells/bosh-aws-xen-ubuntu-trusty-go_agent" ;;
22
- (aws-ec2/centos) STEMCELL_URL="https://bosh.io/d/stemcells/bosh-aws-xen-centos-7-go_agent" ;;
23
- (*)
24
- fail "Invalid infrastructure or OS specified."
25
- exit 1
26
- ;;
27
- esac
28
-
29
- shift
30
-
31
- BOSH_STATUS=$(bosh status)
32
- DIRECTOR_UUID=$(echo "$BOSH_STATUS" | grep UUID | awk '{print $2}')
33
- DIRECTOR_CPI=$(echo "$BOSH_STATUS" | grep CPI | awk '{print $2}' | sed -e 's/_cpi//')
34
- DIRECTOR_NAME=$(echo "$BOSH_STATUS" | grep Name | sed 's/.*Name *//')
35
- NAME=$template_prefix-$infrastructure
36
-
37
- if [[ $DIRECTOR_CPI = "warden" && ${infrastructure} != "warden" ]]; then
38
- fail "Not targeting bosh-lite with warden CPI. Please make sure you have run 'bosh target' and are targeting a BOSH lite before running this script."
39
- exit 1
40
- fi
41
-
42
- if [[ $infrastructure = "aws-ec2" && ${DIRECTOR_CPI} != "aws" ]]; then
43
- fail "Not targeting an AWS BOSH. Please make sure you have run 'bosh target' and are targeting an AWS BOSH before running this script."
44
- exit 1
45
- fi
46
-
47
- function latest_uploaded_stemcell {
48
- echo $(bosh stemcells | grep bosh | grep $STEMCELL_OS | awk -F'|' '{ print $2, $3 }' | sort -nr -k2 | head -n1 | awk '{ print $1 }')
49
- }
50
-
51
- STEMCELL=${STEMCELL:-$(latest_uploaded_stemcell)}
52
- if [[ -z ${STEMCELL} ]]; then
53
- echo
54
- echo "Uploading latest $DIRECTOR_CPI/$STEMCELL_OS stemcell..."
55
- echo " (from ${STEMCELL_URL})"
56
- bosh upload stemcell $STEMCELL_URL
57
- fi
58
- STEMCELL=${STEMCELL:-$(latest_uploaded_stemcell)}
59
-
60
- templates=$(dirname $0)
61
- release=$templates/..
62
- tmpdir=$release/tmp
63
-
64
- mkdir -p $tmpdir
65
- cp $templates/stub.yml $tmpdir/stub-with-uuid.yml
66
- echo $DIRECTOR_NAME $DIRECTOR_CPI $DIRECTOR_UUID $STEMCELL
67
- perl -pi -e "s/PLACEHOLDER-DIRECTOR-UUID/$DIRECTOR_UUID/g" $tmpdir/stub-with-uuid.yml
68
- perl -pi -e "s/NAME/$NAME/g" $tmpdir/stub-with-uuid.yml
69
- perl -pi -e "s/STEMCELL/$STEMCELL/g" $tmpdir/stub-with-uuid.yml
70
-
71
- if ! [ -x "$(command -v spruce)" ]; then
72
- echo 'spruce is not installed. Please download at https://github.com/geofffranks/spruce/releases' >&2
73
- fi
74
-
75
- spruce merge --prune meta \
76
- $templates/deployment.yml \
77
- $templates/jobs.yml \
78
- $templates/infrastructure-${infrastructure}.yml \
79
- $tmpdir/stub-with-uuid.yml \
80
- $* > $tmpdir/$NAME-manifest.yml
81
-
82
- bosh deployment $tmpdir/$NAME-manifest.yml
83
- bosh status
@@ -1,14 +0,0 @@
1
- ---
2
- meta:
3
- environment: NAME
4
- dns_root: microbosh
5
- security_groups:
6
- - <%= project_name_underscored %>
7
- stemcell:
8
- name: STEMCELL
9
-
10
- director_uuid: PLACEHOLDER-DIRECTOR-UUID
11
-
12
- releases:
13
- - name: <%= project_name_hyphenated %>
14
- version: latest
@@ -1,9 +0,0 @@
1
- module Bosh
2
- module Gen
3
- module Models
4
- end
5
- end
6
- end
7
- require "bosh/gen/models/bosh_config"
8
- require "bosh/gen/models/deployment_manifest"
9
- require "bosh/gen/models/release_detection"
@@ -1,15 +0,0 @@
1
- require "yaml"
2
- module Bosh::Gen::Models
3
- # Read-only interface to local ~/.bosh_config
4
- # file
5
- class BoshConfig
6
- def initialize(config_file="~/.bosh_config")
7
- @config_file = File.expand_path(config_file)
8
- @config = YAML.load_file(@config_file)
9
- end
10
-
11
- def target_uuid
12
- @config["target_uuid"]
13
- end
14
- end
15
- end
@@ -1,107 +0,0 @@
1
- require "yaml"
2
-
3
- module Bosh::Gen::Models
4
- class DeploymentManifest
5
- attr_reader :manifest
6
-
7
- def initialize(name, director_uuid, release_properties, cloud_properties, properties)
8
- @manifest = {}
9
- @cloud_properties = cloud_properties
10
- @release_properties = release_properties
11
- @properties = properties
12
- @security_groups = ["default"]
13
- @stemcell_version = "latest"
14
- @stemcell = { "name" => "bosh-stemcell", "version" => @stemcell_version }
15
- @persistent_disk = cloud_properties.delete("persistent_disk").to_i
16
- @static_ips = cloud_properties.delete("static_ips") || []
17
-
18
- # Ignore current release version and set to 'latest'
19
- # This is much more helpful in early development days
20
- # of a release
21
- release_properties["version"] = 'latest'
22
-
23
- manifest["name"] = name
24
- manifest["director_uuid"] = director_uuid
25
- manifest["release"] = release_properties.dup
26
- manifest["compilation"] = {
27
- "workers" => 10,
28
- "network" => "default",
29
- "reuse_compilation_vms" => true,
30
- "cloud_properties" => cloud_properties.dup
31
- }
32
- manifest["update"] = {
33
- "canaries" => 1,
34
- "canary_watch_time" => 30000,
35
- "update_watch_time" => 30000,
36
- "max_in_flight" => 4,
37
- "max_errors" => 1
38
- }
39
- manifest["networks"] = [
40
- {
41
- "name" => "default",
42
- "type" => "dynamic",
43
- "cloud_properties" => { "security_groups" => @security_groups.dup }
44
- },
45
- {
46
- "name" => "vip_network",
47
- "type" => "vip",
48
- "cloud_properties" => { "security_groups" => @security_groups.dup }
49
- }
50
- ]
51
- manifest["resource_pools"] = [
52
- {
53
- "name" => "common",
54
- "network" => "default",
55
- "stemcell" => @stemcell,
56
- "cloud_properties" => cloud_properties.dup
57
- }
58
- ]
59
- manifest["resource_pools"].first["persistent_disk"] = @persistent_disk if @persistent_disk > 0
60
- manifest["jobs"] = []
61
- manifest["properties"] = @properties
62
- end
63
-
64
- # Each item of +jobs+ is a hash.
65
- # The minimum hash is:
66
- # { "name" => "jobname" }
67
- # This is the equivalent to:
68
- # { "name" => "jobname", "template" => "jobname", "instances" => 1}
69
- def jobs=(jobs)
70
- total_instances = 0
71
- static_ips = @static_ips.dup
72
- manifest["jobs"] = []
73
- jobs.each do |job|
74
- job_instances = job["instances"] || 1
75
- manifest_job = {
76
- "name" => job["name"],
77
- "templates" => [
78
- { "name" => job["template"] || job["name"],
79
- "release" => @release_properties["name"]
80
- }
81
- ],
82
- "instances" => job_instances,
83
- "resource_pool" => "common",
84
- "networks" => [
85
- {
86
- "name" => "default",
87
- "default" => %w[dns gateway]
88
- }
89
- ]
90
- }
91
- if static_ips.length > 0
92
- job_ips, static_ips = static_ips[0..job_instances-1], static_ips[job_instances..-1]
93
- manifest_job["networks"] << {
94
- "name" => "vip_network",
95
- "static_ips" => job_ips
96
- }
97
- end
98
- manifest_job["persistent_disk"] = @persistent_disk if @persistent_disk > 0
99
- manifest["jobs"] << manifest_job
100
- end
101
- end
102
-
103
- def to_yaml
104
- manifest.to_yaml
105
- end
106
- end
107
- end
@@ -1,35 +0,0 @@
1
- require "yaml"
2
-
3
- module Bosh::Gen::Models
4
- class ReleaseDetection
5
- attr_reader :release_path
6
- attr_reader :latest_dev_release
7
-
8
- def initialize(release_path)
9
- @release_path = release_path
10
-
11
- @dev_config = YAML.load_file(File.join(release_path, "config", "dev.yml"))
12
- @latest_dev_release_filename = File.expand_path(@dev_config["latest_release_filename"], release_path) # absolute or relative
13
- @latest_dev_release = YAML.load_file(@latest_dev_release_filename)
14
- end
15
-
16
- def latest_dev_release_name
17
- @latest_dev_release["name"]
18
- end
19
-
20
- def latest_dev_release_version
21
- @latest_dev_release["version"]
22
- end
23
-
24
- def latest_dev_release_job_names
25
- @latest_dev_release["jobs"].map {|job| job["name"]}
26
- end
27
-
28
- def latest_dev_release_properties
29
- {
30
- "name" => latest_dev_release_name,
31
- "version" => latest_dev_release_version
32
- }
33
- end
34
- end
35
- end
@@ -1,62 +0,0 @@
1
- require "progressbar"
2
- # f = FileWithProgressBar.open(file, 'r')
3
- # f.out = $stdout
4
- #
5
- # Then pass f like any File object that invokes f.read
6
- #
7
- # To upload with Fog:
8
- # d = Storage[:aws].directories.create(key: 'drnic-test-upload')
9
- # d.files.create(key: 'test.tgz', body: f)
10
- # redis-2.8.12.: 100% |oooooooooooooo| 1.2MB 243.4KB/s Time: 00:00:04
11
- class FileWithProgressBar < ::File
12
-
13
- def out=(out)
14
- @out = out
15
- end
16
-
17
- def progress_bar
18
- return @progress_bar if @progress_bar
19
- @out ||= StringIO.new
20
- @progress_bar = ProgressBar.new(file_name, size, @out)
21
- @progress_bar.file_transfer_mode
22
- @progress_bar
23
- end
24
-
25
- def file_name
26
- File.basename(self.path)
27
- end
28
-
29
- def stop_progress_bar
30
- progress_bar.halt unless progress_bar.finished?
31
- end
32
-
33
- def size
34
- @size || File.size(self.path)
35
- end
36
-
37
- def size=(size)
38
- @size=size
39
- end
40
-
41
- def read(*args)
42
- result = super(*args)
43
-
44
- if result && result.size > 0
45
- progress_bar.inc(result.size)
46
- else
47
- progress_bar.finish
48
- end
49
-
50
- result
51
- end
52
-
53
- def write(*args)
54
- count = super(*args)
55
- if count
56
- progress_bar.inc(count)
57
- else
58
- progress_bar.finish
59
- end
60
- count
61
- end
62
- end
@@ -1,34 +0,0 @@
1
- ---
2
- target: http://23.23.128.40:25555
3
- target_name: microbosh-aws-us-east-1
4
- target_version: 0.5.1 (release:ffd6af9a bosh:8b7af232)
5
- target_uuid: f734ed1f-6892-4d96-9123-018c830a8543
6
- aliases:
7
- target:
8
- 47ee0fca-68fc-4183-a9ed-863eaa619ff7: http://ec2-23-23-248-166.compute-1.amazonaws.com:25555
9
- c897319f-9b4b-41ae-9ed7-7de00b4d770b: http://ec2-23-21-73-121.compute-1.amazonaws.com:25555
10
- ad88170e-85ee-4d11-bc80-34e7e15df15d: http://ec2-23-21-73-121.compute-1.amazonaws.com:25555
11
- 979e4c3f-e74e-4c6d-ae21-45398473b70c: http://23.21.73.121:25555
12
- 1e753059-a2c8-4363-847f-cc31ca0f67e0: http://ec2-23-21-73-121.compute-1.amazonaws.com:25555
13
- f734ed1f-6892-4d96-9123-018c830a8543: http://23.23.128.42:25555
14
- auth:
15
- http://ec2-23-23-248-166.compute-1.amazonaws.com:25555:
16
- username: admin
17
- password: admin
18
- http://ec2-23-21-73-121.compute-1.amazonaws.com:25555:
19
- username: admin
20
- password: foobar
21
- http://50.19.186.130:25555:
22
- username: admin
23
- password: admin
24
- http://23.21.73.121:25555:
25
- username: admin
26
- password: ooooooo
27
- http://23.23.128.42:25555:
28
- username: admin
29
- password: hahahah
30
- deployment:
31
- http://ec2-23-23-248-166.compute-1.amazonaws.com:25555: /Users/drnic/.bosh_deployments/wordpress/wordpress-aws.yml
32
- http://ec2-23-21-73-121.compute-1.amazonaws.com:25555: /Users/drnic/Sites/boshdeployments/rackapp/manifest.yml
33
- http://23.21.73.121:25555: /Users/drnic/Sites/boshdeployments/rackapp/manifest.yml
34
- http://23.23.128.40:25555: /Users/drnic/Sites/boshdeployments/riak-cluster/manifest.yml
@@ -1,67 +0,0 @@
1
- ---
2
- name: myproj
3
- director_uuid: UUID
4
- release:
5
- name: myrelease
6
- version: latest
7
- compilation:
8
- workers: 10
9
- network: default
10
- reuse_compilation_vms: true
11
- cloud_properties:
12
- instance_type: m3.medium
13
- update:
14
- canaries: 1
15
- canary_watch_time: 30000
16
- update_watch_time: 30000
17
- max_in_flight: 4
18
- max_errors: 1
19
- networks:
20
- - name: default
21
- type: dynamic
22
- cloud_properties:
23
- security_groups:
24
- - default
25
- - name: vip_network
26
- type: vip
27
- cloud_properties:
28
- security_groups:
29
- - default
30
- resource_pools:
31
- - name: common
32
- network: default
33
- stemcell:
34
- name: bosh-stemcell
35
- version: latest
36
- cloud_properties:
37
- instance_type: m3.medium
38
- persistent_disk: 8196
39
- jobs:
40
- - name: job-with-ips
41
- templates:
42
- - name: job-with-ips
43
- release: myrelease
44
- instances: 1
45
- resource_pool: common
46
- networks:
47
- - name: default
48
- default:
49
- - dns
50
- - gateway
51
- - name: vip_network
52
- static_ips:
53
- - 1.2.3.4
54
- persistent_disk: 8196
55
- - name: misc
56
- templates:
57
- - name: misc
58
- release: myrelease
59
- instances: 1
60
- resource_pool: common
61
- networks:
62
- - name: default
63
- default:
64
- - dns
65
- - gateway
66
- persistent_disk: 8196
67
- properties: {}