Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Rename projectriff/buildpack to projectriff/builder #8

Merged
merged 1 commit into from
Nov 8, 2018
Merged
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
2 changes: 1 addition & 1 deletion .travis/create-builder.sh
Original file line number Diff line number Diff line change
@@ -5,4 +5,4 @@ set -o nounset
set -o pipefail


pack create-builder -b builder-riff.toml projectriff/buildpack:latest
pack create-builder -b builder-riff.toml projectriff/builder:latest
4 changes: 2 additions & 2 deletions .travis/push-buildtemplate-to-gcs.sh
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ set -o pipefail
version=`cat VERSION`
gcloud auth activate-service-account --key-file <(echo $GCLOUD_CLIENT_SECRET | base64 --decode)

docker push projectriff/buildpack:${version}-ci-${TRAVIS_COMMIT}
sed "s|projectriff/buildpack:latest|projectriff/buildpack:${version}-ci-${TRAVIS_COMMIT}|" riff-cnb-buildtemplate.yaml > riff-cnb-buildtemplate-${version}-ci-${TRAVIS_COMMIT}.yaml
docker push projectriff/builder:${version}-ci-${TRAVIS_COMMIT}
sed "s|projectriff/builder:latest|projectriff/builder:${version}-ci-${TRAVIS_COMMIT}|" riff-cnb-buildtemplate.yaml > riff-cnb-buildtemplate-${version}-ci-${TRAVIS_COMMIT}.yaml

gsutil cp -a public-read riff-cnb-buildtemplate-${version}-ci-${TRAVIS_COMMIT}.yaml gs://projectriff/riff-buildtemplate/
gsutil cp -a public-read riff-cnb-buildtemplate.yaml gs://projectriff/riff-buildtemplate/
7 changes: 3 additions & 4 deletions .travis/push-to-dockerhub.sh
Original file line number Diff line number Diff line change
@@ -5,9 +5,8 @@ set -o nounset
set -o pipefail

version=`cat VERSION`
docker tag projectriff/buildpack:latest projectriff/buildpack:${version}
docker tag projectriff/buildpack:latest projectriff/buildpack:${version}-ci-${TRAVIS_COMMIT}
docker tag projectriff/builder:latest projectriff/builder:${version}
docker tag projectriff/builder:latest projectriff/builder:${version}-ci-${TRAVIS_COMMIT}

docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"
docker push projectriff/buildpack:${version}
docker push projectriff/buildpack:${version}-ci-${TRAVIS_COMMIT}
docker push projectriff/builder
28 changes: 10 additions & 18 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,58 +1,50 @@
= riff Buildpack Group

This repository hosts the files necessary to create the buildpack builder used when
riff builds functions from source with the `riff function create <buildpack> <fn-name>`
riff builds functions from source with the `riff function create <fn-name>`
command.

== Relation to the https://github.com/projectriff/riff-buildpack[projectriff/riff-buildpack] Repository
In the v3 buildpack ecosystem, a distinction needs to be made between a _buildpack_
and a _builder_.

The latter is what is actually involved when running `riff function create` with the
`java` buildpack approach. A _builder_ is the composition of several _buildpacks_ using groups.
buildpack approach. A _builder_ is the composition of several _buildpacks_ using groups.
It takes the form of a docker image. In the case of riff, its official location is
https://hub.docker.com/r/projectriff/buildpack/[projectriff/buildpack].
https://hub.docker.com/r/projectriff/builder/[projectriff/builder].
The purpose of this repository is to allow the creation of that builder.

The former, a _buildpack_, is a more fine grained unit of logic that can be composed and
collaborate with other buildpacks. The https://github.com/projectriff/riff-buildpack[projectriff/riff-buildpack]
repository hosts one of them, responsible for applying the riff-specific logic on top of
the more general java building logic. As more languages become supported by riff,
that buildpack will evolve to collaborate with other buildpacks (_e.g._ `node`), while this
the more general _java_ or _node_ building logic. As more languages become supported by riff,
that buildpack will evolve to collaborate with other buildpacks (_e.g._ `python`), while this
repository's `builder-riff.toml` file will enhance its group(s) to reference _e.g._ the generic
`node` buildpack.
`python` buildpack.

== Building
=== Prerequisites
To build the `projectriff/buildpack` builder you'll need
To build the `projectriff/builder` builder you'll need

* Go 1.11+
* a running local docker daemon
* the https://github.com/buildpack/pack[`pack`] command line tool. At the time of writing,
a version built from `master` is required (to support references to remote buildpacks in `builder-riff.toml`):
+
[source,bash]
----
git clone https://github.com/buildpack/pack
cd pack
GO111MODULE=on go install ./cmd/pack
----
* the https://github.com/buildpack/pack[`pack`] command line tool, https://github.com/buildpack/pack/releases[version] `>= 0.0.5`.

=== Creating the Builder
Then, building the builder is as simple as
[source,bash]
----
git clone https://github.com/projectriff/riff-buildpack-group
cd riff-buildpack-group
pack create-builder -b builder-riff.toml projectriff/buildpack
pack create-builder -b builder-riff.toml projectriff/builder
----

=== Using the Builder Locally
Lastly, to use the builder created above, just refer to the `pack build` reference:
[source, bash]
----
cd where-your-function-is
pack build --builder projectriff/buildpack --no-pull -p . your-org/my-function
pack build --builder projectriff/builder --no-pull -p . your-org/my-function
----

You should get something similar to
6 changes: 3 additions & 3 deletions riff-cnb-buildtemplate.yaml
Original file line number Diff line number Diff line change
@@ -44,11 +44,11 @@ spec:
mountPath: /cache
imagePullPolicy: Always
- name: write-riff-toml
image: projectriff/buildpack:latest
image: projectriff/builder:latest
command: ["/bin/bash", "-c", "printf \"artifact = '${FUNCTION_ARTIFACT}'\\nhandler = '${FUNCTION_HANDLER}'\\noverride = '${FUNCTION_LANGUAGE}'\\n\" > app/riff.toml"]
imagePullPolicy: Always
- name: detect
image: projectriff/buildpack:latest
image: projectriff/builder:latest
command: ["/lifecycle/detector"]
imagePullPolicy: Always
- name: analyze
@@ -60,7 +60,7 @@ spec:
value: ${USE_CRED_HELPERS}
imagePullPolicy: Always
- name: build
image: projectriff/buildpack:latest
image: projectriff/builder:latest
command: ["/lifecycle/builder"]
volumeMounts:
- name: app-cache