Skip to content

Commit

Permalink
Ensure that the chef/bldr image is present before running tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Nov 13, 2015
1 parent 1456921 commit 7baefdb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
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

1 comment on commit 7baefdb

@chef-delivery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delivery Status:

Verify Build Acceptance
Unit Unit Provision
Lint Lint Deploy
Syntax Syntax Smoke
Quality Functional
Security
Publish

Please sign in to comment.