Skip to content

Commit d653a62

Browse files
committed
Remove vSphere code - this is handled by stembuild
1 parent 4c25692 commit d653a62

28 files changed

+14
-2228
lines changed

.gitignore

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,15 @@
1+
.idea
2+
.vscode
3+
14
# Stemcell Builder
25
packer_cache
36
packer-vmware-iso
4-
vmware_stemcell
5-
vmware_stemcell_no_updates
67
tmp/
8+
hotfixes.log
79
mkmf.log
8-
vsphere/network-interface-settings.xml
910
scripts/win_iso
1011
compiled-agent
1112

1213
# BWATS
1314
bin
1415
pkg
15-
16-
# Ruby
17-
*.rbc
18-
/.config
19-
/coverage/
20-
/InstalledFiles
21-
/pkg/
22-
/spec/reports/
23-
/spec/examples.txt
24-
/test/tmp/
25-
/test/version_tmp/
26-
/tmp/
27-
vendor/cache/ruby/
28-
29-
# Documentation cache and generated files:
30-
/.yardoc/
31-
/_yardoc/
32-
/doc/
33-
/rdoc/
34-
35-
## Environment normalization:
36-
/.bundle/
37-
/vendor/bundle
38-
/lib/bundler/man/
39-
40-
/build
41-
/local-builders
42-
.idea
43-
.vscode

README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
# BOSH Windows Stemcell Builder (DEPRECATED September 2020) [![slack.cloudfoundry.org](https://slack.cloudfoundry.org/badge.svg)](https://slack.cloudfoundry.org)
1+
# BOSH Windows Stemcell Builder [![slack.cloudfoundry.org](https://slack.cloudfoundry.org/badge.svg)](https://slack.cloudfoundry.org)
22

3-
BOSH Windows Stemcell Builder will be deprecated by September 2020. The recommended approach for creating local BOSH Windows stemcells which can be deployed on [Cloud Foundry BOSH](https://bosh.io), is [`stembuild`](https://github.com/cloudfoundry/stembuild).
3+
This repository contains Rake tasks for creating BOSH Windows stemcells for AWS, Azure, GCP, and Openstack
44

5-
[Documentation on how to use `stembuild` can be found here.](https://bosh.io/docs/windows-stemcell-create/)
6-
7-
---
5+
The recommended approach for creating BOSH Windows stemcells for vSphere which can be deployed on [Cloud Foundry BOSH](https://bosh.io), is [`stembuild`](https://github.com/cloudfoundry/stembuild).
86

9-
This repo contains a set of scripts for automating the process of building BOSH Windows Stemcells.
7+
[Documentation on how to use `stembuild` can be found here.](https://bosh.io/docs/windows-stemcell-create/)
108

119
#### Contributing
1210
Please submit PR's to the `develop` branch
1311

1412
#### Dependencies
1513

16-
* [Ruby](https://www.ruby-lang.org/en/downloads/) Latest 2.3.x version
17-
* [Golang](https://golang.org/dl/) Latest 1.12.x compiler
18-
* [Packer](https://www.packer.io/downloads.html) for concourse automation
14+
* [Ruby](https://www.ruby-lang.org/en/downloads/) - see `.ruby-version`
15+
* [Golang](https://golang.org/dl/) - latest
16+
* [Packer](https://www.packer.io/downloads.html) - for image creation
1917
* [Win32-OpenSSH](https://github.com/PowerShell/Win32-OpenSSH) Release [v0.0.18.0](https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v0.0.18.0) is tested.
2018

2119
#### Install
@@ -30,10 +28,6 @@ bundle install
3028
rake build:aws # Build AWS Stemcell
3129
rake build:azure # Build Azure Stemcell
3230
rake build:gcp # Build GCP Stemcell
33-
rake build:vsphere # Build VSphere Stemcell
34-
rake build:vsphere_add_updates # Apply Windows Updates for VMX
35-
36-
rake package:vsphere_ova[ova_file_name,output_directory,version,updates_path] # Package VSphere OVA files into Stemcells
3731
3832
rake publish:staging:azure # Stage an image to the Azure marketplace
3933
rake publish:production:azure # Publish an image to the Azure marketplace
@@ -42,13 +36,9 @@ rake publish:finalize:azure #
4236
rake publish:gcp # Publish an image to GCP
4337
```
4438

45-
In Concourse see [Greenhouse CI](https://github.com/cloudfoundry/greenhouse-ci/tree/master/bosh-windows-stemcell-builder) for required environment variables for these tasks. For example, for `rake build:vsphere` refer to this [task.yml](https://github.com/cloudfoundry/greenhouse-ci/blob/master/bosh-windows-stemcell-builder/create-vsphere-stemcell-from-vmx/task.yml).
46-
47-
Instructions for building a manual stemcell for vSphere can be found in the [wiki](https://github.com/cloudfoundry/bosh-windows-stemcell-builder/wiki/Creating-a-vSphere-Windows-Stemcell).
48-
4939
#### Running the tests
5040
```
51-
bundler exec rspec
41+
bundle exec rspec
5242
```
5343

5444
Acceptance testing for stemcells should be done with [bosh-windows-acceptance-tests](https://github.com/cloudfoundry/bosh-windows-acceptance-tests)

Rakefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@ require_relative 'lib/stemcell/builder'
33
import 'lib/tasks/build/aws.rake'
44
import 'lib/tasks/build/azure.rake'
55
import 'lib/tasks/build/gcp.rake'
6-
import 'lib/tasks/build/vsphere.rake'
76

87
import 'lib/tasks/label/aws.rake'
98
import 'lib/tasks/label/gcp.rake'
109

11-
import 'lib/tasks/package/vsphere_ova.rake'
12-
1310
import 'lib/tasks/publish/azure.rake'
1411
import 'lib/tasks/publish/gcp.rake'
1512

create-manual-vsphere-2016-stemcells.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

create-manual-vsphere-stemcells.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/packer/config.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
require_relative 'config/aws'
44
require_relative 'config/azure'
55
require_relative 'config/gcp'
6-
require_relative 'config/vsphere'

lib/packer/config/templates/provision_windows2019.json.erb

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -261,24 +261,6 @@
261261
"Set-InternetExplorerRegistries"
262262
]
263263
},
264-
<% if iaas == "vsphere" %>
265-
{
266-
"type": "powershell",
267-
"inline": [
268-
"$ErrorActionPreference = \"Stop\";",
269-
"trap { $host.SetShouldExit(1) }",
270-
"Optimize-Disk"
271-
]
272-
},
273-
{
274-
"type": "powershell",
275-
"inline": [
276-
"$ErrorActionPreference = \"Stop\";",
277-
"trap { $host.SetShouldExit(1) }",
278-
"Compress-Disk"
279-
]
280-
}
281-
<% else %>
282264
{
283265
"type": "powershell",
284266
"inline": [
@@ -287,5 +269,4 @@
287269
"Invoke-Sysprep -IaaS <%= iaas %>"
288270
]
289271
}
290-
<% end %>
291272
]

lib/packer/config/vsphere.rb

Lines changed: 0 additions & 112 deletions
This file was deleted.

lib/s3.rb

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -55,79 +55,6 @@ def rationalize(bucket, key)
5555
end
5656
end
5757

58-
class Vmx
59-
def initialize(
60-
input_bucket:, output_bucket:,vmx_cache_dir:, endpoint: "")
61-
@client = S3::Client.new(endpoint: endpoint)
62-
@input_bucket = input_bucket
63-
@output_bucket = output_bucket
64-
@vmx_cache_dir = vmx_cache_dir
65-
end
66-
67-
def fetch(version)
68-
version = version.scan(/(\d+)\./).flatten.first
69-
70-
Dir.foreach(@vmx_cache_dir) do |path|
71-
if /^\d+$/.match(path)
72-
if path < version
73-
puts "Deleting old cache dir #{File.join(@vmx_cache_dir, path)}"
74-
FileUtils.rm_rf(File.join(@vmx_cache_dir, path))
75-
end
76-
elsif (vmx_version = /vmx-v([\d]+).tgz/.match(path))
77-
if vmx_version[1] < version
78-
puts "Deleting old cache file #{File.join(@vmx_cache_dir, path)}"
79-
FileUtils.rm(File.join(@vmx_cache_dir, path))
80-
end
81-
end
82-
end
83-
84-
vmx_tarball = File.join(@vmx_cache_dir,"vmx-v#{version}.tgz")
85-
puts "Checking for #{vmx_tarball}"
86-
if !File.exist?(vmx_tarball)
87-
@client.get(@input_bucket,"vmx-v#{version}.tgz",vmx_tarball)
88-
else
89-
puts "VMX file #{vmx_tarball} found in cache."
90-
end
91-
92-
# Find the vmx directory matching version, untar if not cached
93-
vmx_dir=File.join(@vmx_cache_dir,version)
94-
puts "Checking for #{vmx_dir}"
95-
if !Dir.exist?(vmx_dir)
96-
FileUtils.mkdir_p(vmx_dir)
97-
exec_command("tar -xzvf #{vmx_tarball} -C #{vmx_dir}")
98-
else
99-
puts "VMX dir #{vmx_dir} found in cache."
100-
end
101-
102-
find_vmx_file(vmx_dir)
103-
end
104-
105-
def put(vmx_dir, version)
106-
version = version.scan(/(\d+)\./).flatten.first
107-
version = (version.to_i + 1).to_s
108-
vmx_tarball = File.join(@vmx_cache_dir,"vmx-v#{version}.tgz")
109-
Dir.chdir(vmx_dir) do
110-
exec_command("tar -czvf #{vmx_tarball} *")
111-
end
112-
@client.put(@output_bucket, "vmx-v#{version}.tgz", vmx_tarball)
113-
end
114-
115-
private
116-
117-
def find_vmx_file(dir)
118-
pattern = File.join(dir, "*.vmx").gsub('\\', '/')
119-
files = Dir.glob(pattern)
120-
if files.length == 0
121-
raise "No vmx files in directory: #{dir}"
122-
end
123-
if files.length > 1
124-
raise "Too many vmx files in directory: #{files}"
125-
end
126-
127-
files[0]
128-
end
129-
end
130-
13158
def self.test_upload_permissions(bucket, endpoint="")
13259
puts "Testing upload permissions for #{bucket}"
13360
tempfile = Tempfile.new("stemcell-permissions-tempfile")

lib/stemcell/builder.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require_relative 'builder/aws'
33
require_relative 'builder/azure'
44
require_relative 'builder/gcp'
5-
require_relative 'builder/vsphere'
65
require_relative '../packer/config'
76
require_relative '../packer/runner'
87
require_relative 'manifest'

0 commit comments

Comments
 (0)