Name: buildpack-base
Owner: Particle
Description: Base image for Particle buildpacks
Created: 2015-08-14 18:43:06.0
Updated: 2016-11-29 22:43:10.0
Pushed: 2018-03-10 14:46:08.0
Size: 27
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
[](https://imagelayers.io/?images=particle/buildpack-base:latest 'Get your own badge on imagelayers.io')
Buildpacks inherit and extend other images to separate common flow and logic in OOP manner. This image provides main flow/protocol and some helper functions that can be used by other images by inheriting it.
| | |—| | Particle firmware | | HAL / Legacy | | Base (you are here) |
cker-compose build
Image entrypoint is /bin/run. It will:
/bin/build
script) particle/buildpack-base
.
foo /foo
When running container use -v
argument to specify local dirs which will be mapped to those volumes.
/input
- should contain all project files/output
- after build will contain logs and build artifacts/cache
- temp directory to store intermediate files/log
- directory containing run logs/ssh
- directory containing SSH keys (will be copied to ~/.ssh
)Outputed firmware binary should be named firmware.bin
unless compile produces more binaries and their filenames have to be preserved.
stderr
file paths should start with $WORKSPACE_DIR/
(this should be the root of a project).
find-and-replace-in
function can be used to replace whatever root dir is.
clone-repo REPO_URL CLONE_DIR
Will clone REPO_URL
to CLONE_DIR
if it doesn't exist.
REPO_URL
can target tags or branches by using hash notation i.e.: https://github.com/particle-iot/core-common-lib.git#compile-server2
copy-if-exists FROM TO
If FROM
file exists copy it to TO
.
copy-to-output GLOB
Copy all files matching GLOB
to output dir.
find-and-replace-in FROM TO FILE
Replaces all occurrences of FROM
to TO
in FILE
.
log-size ELF_FILE
Logs arm-none-eabi-size
of ELF_FILE
to memory-use.log
file in output dir.
INPUT_FROM_STDIN
Setting it to true
will wait on STDIN
for a tar gzipped file which will be extracted into /input
.
ARCHIVE_OUTPUT
Setting it to true
will tar gzip /output
directory into /output.tar.gz
archive inside of container.
Both variables are used when buildpack is run by Dray.
Buildpacks can define tests by overriding /test
directory with BATS tests. The tests should:
/input
with test data/bin/run
/output
and assert when incorrectBefore each BATS file, the /input
, /workspace
and /output
will be cleared.
BATS can use different languages to do the actual tests (i.e. run mocha
).
Running tests itself is done by running container without mounted volumes and overriding CMD
:
cker run --rm \
rticle/buildpack-foo \
in/run-tests
Use following .travis.yml
:
: required
ices:
docker
all:
docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD
re_script:
docker build -t $DOCKER_IMAGE_NAME .
pt:
docker run --rm $DOCKER_IMAGE_NAME /bin/run-tests
r_success:
if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_IMAGE_NAME:latest $DOCKER_IMAGE_NAME:$TRAVIS_TAG; fi && docker push $DOCKER_IMAGE_NAME
DOCKER_IMAGE_NAME=particle/foo