diff --git a/sample/src/build.sh b/sample/src/build.sh index 02fdb686..920b8674 100755 --- a/sample/src/build.sh +++ b/sample/src/build.sh @@ -36,4 +36,7 @@ pip install --no-binary :all: --download vendor -r requirements.txt zip -r "${RESOURCES_DIR}/app.zip" * cd "${BUILDPACK_DIR}" -zip -r "${RESOURCES_DIR}/buildpack.zip" * +zip -r "${RESOURCES_DIR}/buildpack.zip" bin/detect bin/compile bin/release + +cd "${BUILDPACK_DIR}" +zip -r "${RESOURCES_DIR}/decorator.zip" bin/detect bin/compile bin/decorate diff --git a/sample/src/buildpack/bin/decorate b/sample/src/buildpack/bin/decorate new file mode 100755 index 00000000..863b3e2b --- /dev/null +++ b/sample/src/buildpack/bin/decorate @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# bin/decorate + +# tile-generator +# +# Copyright (c) 2015-Present Pivotal Software, Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +exit 1 diff --git a/sample/tile.yml b/sample/tile.yml index d7ccc914..93e0a21a 100644 --- a/sample/tile.yml +++ b/sample/tile.yml @@ -162,6 +162,10 @@ packages: buildpack_order: 99 # 99 (or higher) means go to the end of the list path: resources/buildpack.zip +- name: noop-decorator # A decorator buildpack + type: decorator + path: resources/decorator.zip + - name: app3 type: docker-app image: guidowb/sample-cf-app # Start command must be specified in the Dockerfile (CMD) diff --git a/tile_generator/config.py b/tile_generator/config.py index 78144883..0eb40398 100644 --- a/tile_generator/config.py +++ b/tile_generator/config.py @@ -145,7 +145,7 @@ def normalize_jobs(self): for job in release.get('jobs', []): job['type'] = job.get('type', job['name']) job['template'] = job.get('template', job['type']) - + def release_for_package(self, package): release_name = package['name'] if package.get('is_bosh_release', False) else self['name'] release = self.release_by_name(release_name) @@ -233,23 +233,25 @@ def add_dependencies(self): 'name': 'docker-boshrelease', 'path': 'https://bosh.io/d/github.com/cf-platform-eng/docker-boshrelease' + version_param, }] - # if requires_meta_buildpack: - # self['releases'] += [{ - # 'name': 'meta-buildpack', - # 'path': 'github://cf-platform-eng/meta-buildpack/meta-buildpack.tgz', - # 'jobs': [ - # { - # 'name': 'deploy-all', - # 'type': 'deploy-all', - # 'is_errand': True - # }, - # { - # 'name': 'delete-all', - # 'type': 'delete-all', - # 'is_errand': True - # } - # ] - # }] + if requires_meta_buildpack: + self['releases'] += [{ + 'name': 'meta-buildpack', + 'path': 'github://cf-platform-eng/meta-buildpack/meta-buildpack.tgz', + 'jobs': [ + { + 'name': 'deploy-meta-buildpack', + 'type': 'deploy-all', + 'lifecycle': 'errand', + 'post_deploy': True + }, + { + 'name': 'delete-meta-buildpack', + 'type': 'delete-all', + 'lifecycle': 'errand', + 'pre_delete': True + } + ] + }] def save_history(self): with open(HISTORY_FILE, 'wb') as history_file: