Skip to content

Update README.md #1167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,4 @@ The project backlog is on [Pivotal Tracker](https://www.pivotaltracker.com/proje
[Phalcon]:http://phalconphp.com/en/
[composer]:https://github.com/dmikusa-pivotal/cf-ex-composer
[Proxy Support]:http://docs.cloudfoundry.org/buildpacks/proxy-usage.html
test
10 changes: 2 additions & 8 deletions scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,8 @@ function buildpack::package() {
--stack "${stack}" \
"${cached_flag}" > /dev/null

# This is set by the ruby-written buildpack-packager
local output
if [[ "${cached}" == "true" ]]; then
output="${ROOTDIR}/php_buildpack-cached-${stack}-v${version}.zip"
else
output="${ROOTDIR}/php_buildpack-${stack}-v${version}.zip"
fi
printf "%s" "${output}"
# this is the default output location of the package.sh script
echo "${ROOTDIR}/build/buildpack.zip"
}

main "${@:-}"
40 changes: 34 additions & 6 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ readonly ROOTDIR
source "${ROOTDIR}/scripts/.util/print.sh"

function main() {
local stack cached
local stack cached version
stack="any"
cached="false"
version=""
output="${ROOTDIR}/build/buildpack.zip"

while [[ "${#}" != 0 ]]; do
case "${1}" in
Expand All @@ -25,6 +27,11 @@ function main() {
shift 2
;;

--version)
version="${2}"
shift 2
;;

--cached)
cached="true"
shift 1
Expand All @@ -35,6 +42,11 @@ function main() {
shift 1
;;

--output)
output="${2}"
shift 2
;;

--help|-h)
shift 1
usage
Expand All @@ -51,7 +63,7 @@ function main() {
esac
done

package::buildpack "${cached}" "${stack}"
package::buildpack "${version}" "${cached}" "${stack}" "${output}"
}


Expand All @@ -64,14 +76,21 @@ OPTIONS
--cached packages the buildpack as a cached buildpack
--uncached packages the buildpack as an uncached buildpack (default)
--stack the stack to package the buildpack for (default: any)
--version <version> -v <version> specifies the version number to use when packaging the buildpack
USAGE
}

function package::buildpack() {
local cached stack
cached="${1}"
stack="${2}"

local version cached stack output
version="${1}"
cached="${2}"
stack="${3}"
output="${4}"

if [[ -n "${version}" ]]; then
echo "writing version to VERSION file: ${version}"
echo "${version}" > "${ROOTDIR}/VERSION"
fi

local stack_flag
stack_flag="--any-stack"
Expand Down Expand Up @@ -102,6 +121,15 @@ EOF
popd &> /dev/null

rm -f "${ROOTDIR}/Dockerfile"

file="$(ls "${ROOTDIR}" | grep -i 'php.*zip' )"
if [[ -z "${file}" ]]; then
util::print::error "failed to find zip file in ${ROOTDIR}"
fi

mkdir -p "$(dirname "${output}")"
echo "Moving ${file} to ${output}"
mv "${file}" "${output}"
}

main "${@:-}"
Loading