Skip to content
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

Ensure that the chef/bldr image is present before running tasks. #66

Merged
merged 1 commit into from
Nov 13, 2015
Merged
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
2 changes: 1 addition & 1 deletion .delivery/cookbooks/bldr/recipes/functional.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
workspace = node['delivery']['workspace']['repo']

execute 'make clean all' do
execute 'make clean all force=true' do
cwd workspace
end

Expand Down
2 changes: 1 addition & 1 deletion .delivery/cookbooks/bldr/recipes/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

workspace = node['delivery']['workspace']['repo']

execute 'make clean container' do
execute 'make clean container force=true' do
cwd workspace
end

Expand Down
2 changes: 1 addition & 1 deletion .delivery/cookbooks/bldr/recipes/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

workspace = node['delivery']['workspace']['repo']

execute 'make clean container' do
execute 'make clean container force=true' do
cwd workspace
end

Expand Down
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ifneq (${docker_https_proxy},)
endif

run := docker-compose run --rm $(run_args)
image := chef/bldr
VOLUMES := installed cache_pkgs cache_src cache_keys cargo
CLEAN_VOLUMES := clean-installed clean-cache_pkgs clean-cache_src clean-cache_keys clean-cargo
NO_CACHE := false
Expand All @@ -20,10 +21,10 @@ NO_CACHE := false

all: container packages

packages:
packages: container
$(run) package sh -c 'cd /src/packages && make world'

clean-packages:
clean-packages: container
$(run) package sh -c 'rm -rf /opt/bldr/cache/pkgs/* /opt/bldr/pkgs/*'

volumes: $(VOLUMES)
Expand All @@ -37,42 +38,42 @@ $(CLEAN_VOLUMES):
docker-compose rm -f `echo $@ | sed 's/^clean-//'`

container:
docker build $(build_args) -t chef/bldr --no-cache=${NO_CACHE} .
if [ -n "${force}" -o -z "`docker images -q $(image)`" ]; then docker build $(build_args) -t $(image) --no-cache=${NO_CACHE} .; fi

test:
test: container
$(run) package cargo test

unit:
unit: container
$(run) package cargo test --lib

functional:
functional: container
$(run) package cargo test --test functional

cargo-clean:
cargo-clean: container
$(run) package cargo clean

docs:
docs: container
$(run) package sh -c 'set -ex; \
cargo doc; \
rustdoc --crate-name bldr README.md -o ./target/doc/bldr; \
docco -e .sh -o target/doc/bldr/bldr-build packages/bldr-build; \
cp -r images ./target/doc/bldr; \
echo "<meta http-equiv=refresh content=0;url=bldr/index.html>" > target/doc/index.html;'

doc-serve:
doc-serve: container
@echo "==> View the docs at:\n\n http://`\
echo ${DOCKER_HOST} | sed -e 's|^tcp://||' -e 's|:[0-9]\{1,\}$$||'`:9633/\n\n"
$(run) -p 9633:9633 package sh -c 'set -e; cd ./target/doc; python -m SimpleHTTPServer 9633;'

shell:
shell: container
$(run) bldr bash

pkg-shell:
pkg-shell: container
$(run) package bash

bldr-base: packages

base-shell:
base-shell: container
$(run) base

clean:
Expand Down