Skip to content

Commit 8de8af4

Browse files
committed
Remove usage of bosh-agent submodule
Previously the code to assemble the zip file of agent assets relied on files from the `bosh-agent-index` as well as the git version info to checkout the `bosh-agent` submodule of this repo to the correct version, and then built `pipe.exe` and copied `service_wrapper.xml`. This commit changes the CI task's `run.sh` to instead neither rename `bosh-agent.exe`, and `pipe.exe`, nor to update the submodule commit, and instead updates the rake task to fetch these assets directly from the `bosh-agent-index` where the are now being added[1], and the git submodule at srrc/github.com/cloudfoundry/bosh-agent/ has been removed. [1] example: https://github.com/cloudfoundry/bosh-agent-index/blob/master/v2.713.0.meta4
1 parent cd7ec66 commit 8de8af4

File tree

2 files changed

+6
-25
lines changed

2 files changed

+6
-25
lines changed

lib/tasks/package/agent.rake

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ require 'json'
44
require_relative '../../exec_command'
55
require_relative '../../zip_file'
66

7-
def get_agent_version
8-
semver = `git describe --tags`.chomp[1..-1]
9-
go_ver=`go version`.split[2].chomp
10-
git_rev = `git rev-parse --short HEAD`.chomp
11-
timestamp = Time.now.utc.strftime("%Y-%m-%dT%H:%M:%SZ")
12-
13-
"#{semver}-#{git_rev}-#{timestamp}-#{go_ver}"
14-
end
15-
16-
177
namespace :package do
188
desc 'Package BOSH Agent and dependencies into agent.zip'
199
task :agent do
@@ -27,8 +17,6 @@ namespace :package do
2717

2818
deps_dir = File.join(agent_dir_destination,'deps')
2919

30-
stemcell_builder_dir = File.expand_path('../../../../', __FILE__)
31-
3220
FileUtils.mkdir_p(agent_dir_destination)
3321
FileUtils.mkdir_p(deps_dir)
3422

@@ -38,18 +26,12 @@ namespace :package do
3826
FileUtils.cp(Dir.glob(File.join(ci_root_dir, 'windows-bsdtar', 'tar-*.exe')).first, File.join(deps_dir, 'tar.exe'))
3927
FileUtils.cp(File.join(ci_root_dir, 'windows-winsw', 'WinSW.NET461.exe'), File.join(deps_dir, 'job-service-wrapper.exe'))
4028
FileUtils.cp(File.join(ci_root_dir, 'windows-winsw', 'WinSW.NET461.exe'), File.join(agent_dir_destination, 'service_wrapper.exe'))
41-
ENV['GOPATH'] = stemcell_builder_dir
42-
Dir.chdir(File.join(stemcell_builder_dir, 'src', 'github.com', 'cloudfoundry' ,'bosh-agent')) do
43-
ENV['GOOS'] = 'windows'
44-
ENV['GOARCH'] = 'amd64'
45-
46-
FileUtils.cp(File.join(agent_dir_location,'bosh-agent.exe'), agent_dir_destination)
47-
exec_command("go build -o #{File.join(deps_dir,'pipe.exe')} jobsupervisor/pipe/main.go")
48-
exec_command("git rev-parse HEAD > #{File.join(agent_dir_destination,'sha')}")
49-
fixtures = File.join(Dir.pwd, "integration","windows","fixtures")
50-
#all the below files being copied out of bosh-agent should probably be auto-bumped.
51-
FileUtils.cp(File.join(fixtures, 'service_wrapper.xml'), File.join(agent_dir_destination, 'service_wrapper.xml'))
52-
end
29+
30+
FileUtils.cp(Dir.glob(File.join(agent_dir_location, 'bosh-agent*.exe')).first, File.join(agent_dir_destination, 'bosh-agent.exe'))
31+
FileUtils.cp(Dir.glob(File.join(agent_dir_location, 'bosh-agent-pipe*.exe')).first, File.join(deps_dir, 'pipe.exe'))
32+
FileUtils.cp(File.join(agent_dir_location, 'git-sha'), File.join(agent_dir_destination, 'sha'))
33+
FileUtils.cp(File.join(agent_dir_location, 'service_wrapper.xml'), File.join(agent_dir_destination, 'service_wrapper.xml'))
34+
5335
output = File.join(build_dir,"agent.zip")
5436
FileUtils.rm_rf(output)
5537
ZipFile::Generator.new(agent_dir_destination, output).write
Submodule bosh-agent deleted from e12d233

0 commit comments

Comments
 (0)