Skip to content

Commit 62932dd

Browse files
committed
Merge branch '3.x'
2 parents 7590656 + 4b83972 commit 62932dd

5 files changed

Lines changed: 77 additions & 11 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ eval "$(rbenv init -)"
2424

2525
pushd java-buildpack
2626
bundle install --quiet
27-
bundle exec rake versions:json
27+
bundle exec rake versions:markdown
2828
popd
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ inputs:
2424
- name: java-buildpack
2525

2626
run:
27-
path: java-buildpack/ci/versions-json.sh
27+
path: java-buildpack/ci/versions-markdown.sh

ci/versions-pivotal-network.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
# Cloud Foundry Java Buildpack
3+
# Copyright 2013-2017 the original author or authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
export LANG=en_US.UTF-8
20+
export LANGUAGE=en_US.UTF-8
21+
export LC_ALL=en_US.UTF-8
22+
23+
eval "$(rbenv init -)"
24+
25+
pushd java-buildpack
26+
bundle install --quiet
27+
bundle exec rake versions:pivotal_network
28+
popd

ci/versions-pivotal-network.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Cloud Foundry Java Buildpack
2+
# Copyright 2013-2017 the original author or authors.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
---
16+
platform: linux
17+
18+
image_resource:
19+
type: docker-image
20+
source:
21+
repository: cfje/java-buildpack
22+
23+
inputs:
24+
- name: java-buildpack
25+
26+
run:
27+
path: java-buildpack/ci/versions-pivotal-network.sh

rakelib/versions_task.rb

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
require 'java_buildpack/repository/version_resolver'
2020
require 'java_buildpack/util/configuration_utils'
2121
require 'java_buildpack/util/cache/download_cache'
22-
require 'json'
2322
require 'rake/tasklib'
2423
require 'rakelib/package'
2524
require 'terminal-table'
@@ -36,7 +35,8 @@ def initialize
3635
version_task
3736

3837
namespace 'versions' do
39-
version_json_task
38+
version_markdown_task
39+
version_pivotal_network_task
4040
version_yaml_task
4141
end
4242
end
@@ -210,20 +210,31 @@ def version(configuration, index)
210210
def version_task
211211
desc 'Display the versions of buildpack dependencies in human readable form'
212212
task versions: [] do
213-
v = versions
213+
v = versions
214214

215215
rows = v['dependencies']
216-
.sort_by { |dependency| dependency['name'].downcase }
217-
.map { |dependency| [dependency['name'], dependency['version']] }
216+
.sort_by { |dependency| dependency['name'].downcase }
217+
.map { |dependency| [dependency['name'], dependency['version']] }
218218

219219
puts Terminal::Table.new title: "Java Buildpack #{v['buildpack']}", rows: rows
220220
end
221221
end
222222

223-
def version_json_task
224-
desc 'Display the versions of buildpack dependencies in JSON form'
225-
task json: [] do
226-
puts JSON.pretty_generate(versions)
223+
def version_markdown_task
224+
desc 'Display the versions of buildpack dependencies in Markdown form'
225+
task markdown: [] do
226+
versions['dependencies']
227+
.sort_by { |dependency| dependency['name'].downcase }
228+
.each { |dependency| puts "| #{dependency['name']} | `#{dependency['version']}` |" }
229+
end
230+
end
231+
232+
def version_pivotal_network_task
233+
desc 'Display the versions of buildpack dependencies in Pivotal Network form'
234+
task pivotal_network: [] do
235+
versions['dependencies']
236+
.sort_by { |dependency| dependency['name'].downcase }
237+
.each { |dependency| puts "#{dependency['name']} #{dependency['version']}" }
227238
end
228239
end
229240

0 commit comments

Comments
 (0)