~jjo/charms/precise/jenkins/no-ppa-for-non_local

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: yolanda.robla at canonical
  • Date: 2013-11-22 16:07:36 UTC
  • Revision ID: yolanda.robla@canonical.com-20131122160736-w5vq0d3wdlggigy2
add makefile to grab plugins from branch, and .deb package from given url

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PWD := $(shell pwd)
 
2
CP := /bin/cp
 
3
SOURCEDEPS_DIR ?= $(shell dirname $(PWD))/.sourcecode
 
4
HOOKS_DIR := $(PWD)/hooks
 
5
CHARM_DIR := $(PWD)
 
6
FILES_DIR := $(PWD)/files
 
7
 
 
8
build: installdeps proof
 
9
 
 
10
revision:
 
11
        @test -f revision || echo 0 > revision
 
12
 
 
13
proof: revision
 
14
        @echo Proofing charm...
 
15
        $(charm proof $(PWD) || [ $$? -eq 100 ]) && echo OK
 
16
        @test `cat revision` = 0 && rm revision
 
17
 
 
18
installdeps: clean
 
19
        @mkdir -p $(FILES_DIR)
 
20
ifneq ($(JENKINS_SOURCEDEPS_BRANCH), '')
 
21
        @echo Updating plugin dependencies from branch...
 
22
        @mkdir -p $(SOURCEDEPS_DIR)
 
23
        @$(RM) -rf $(SOURCEDEPS_DIR)/jenkins/*
 
24
        @bzr branch $(JENKINS_SOURCEDEPS_BRANCH) $(SOURCEDEPS_DIR)/jenkins/
 
25
 
 
26
        @$(CP) -R $(SOURCEDEPS_DIR)/jenkins/plugins $(FILES_DIR)/
 
27
endif
 
28
 
 
29
ifneq ($(JENKINS_PACKAGE_URL), '')
 
30
        @echo Downloading jenkins package...
 
31
        wget $(JENKINS_PACKAGE_URL) -O $(FILES_DIR)/jenkins.deb
 
32
endif
 
33
 
 
34
clean:
 
35
        @$(RM) -rf $(FILES_DIR)/*
 
36
        @$(RM) -rf $(SOURCEDEPS_DIR)/*
 
37
 
 
38
lint:
 
39
        @flake8 --exclude hooks/charmhelpers,hooks/lib/ hooks
 
40
 
 
41
sync:
 
42
        @charm-helper-sync -c charm-helpers.yaml
 
43
 
 
44
.PHONY: revision proof installdeps