Skip to content

Commit

Permalink
add dockerbuild_binary to build only the serviced binary & add clean_…
Browse files Browse the repository at this point in the history
…templates to clean staged templates
  • Loading branch information
daniel-garcia committed Mar 9, 2014
1 parent 9441e4d commit 3bd2050
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ go:
pkgs:
cd pkg && make rpm && make deb

dockerbuild_binary: docker_ok
docker build -t zenoss/serviced-build build
docker run -rm \
-v `pwd`:/go/src/github.com/zenoss/serviced \
zenoss/serviced-build /bin/bash -c "cd /go/src/github.com/zenoss/serviced/pkg/ && make clean && mkdir -p /go/src/github.com/zenoss/serviced/pkg/build/tmp"
echo "Using dock-in-docker cache dir $(dockercache)"
mkdir -p $(dockercache)
time docker run -rm \
-privileged \
-v $(dockercache):/var/lib/docker \
-v `pwd`:/go/src/github.com/zenoss/serviced \
-v `pwd`/pkg/build/tmp:/tmp \
-e BUILD_NUMBER=$(BUILD_NUMBER) -t \
zenoss/serviced-build /bin/bash \
-c '/usr/local/bin/wrapdocker && make build_binary'


dockerbuild: docker_ok
docker build -t zenoss/serviced-build build
Expand Down
9 changes: 8 additions & 1 deletion pkg/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
##############################################################################
#############################################################################
#
# Copyright (C) Zenoss, Inc. 2013, all rights reserved.
#
Expand Down Expand Up @@ -38,6 +38,10 @@ clean:
rm -f $(NAME)*.rpm
rm -rf pkgroot
rm -rf build
# we need to perform a clean here

clean_templates:
find templates -type f ! -name 'README.txt' -exec rm {} + # remove everything under templates except README.txt

# Make root dir for packaging
pkgroot:
Expand Down Expand Up @@ -70,6 +74,9 @@ stage: build pkgroot
mkdir -p pkgroot$(INSTALL_DIR)/isvcs
cp ../isvcs/resources pkgroot$(INSTALL_DIR)/isvcs -R
cp ../isvcs/images pkgroot$(INSTALL_DIR)/ -R
# stage any templates that are present
mkdir -p pkgroot$(INSTALL_DIR)/templates
rsync -a --exclude=README.txt templates/ pkgroot$(INSTALL_DIR)/templates/

# add serviced to the path via symlink
mkdir -p pkgroot/usr/bin/ && rm -f pkgroot/usr/bin/serviced && ln -s $(INSTALL_DIR)/bin/serviced pkgroot/usr/bin/serviced
Expand Down

0 comments on commit 3bd2050

Please sign in to comment.