forked from conjure-up/conjure-up
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (68 loc) · 2.45 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# Makefile for conjure
#
NAME = conjure-up
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
TOPDIR := $(shell basename `pwd`)
GIT_REV := $(shell git log --oneline -n1| cut -d" " -f1)
VERSION := 2.3-alpha1
CHANNEL := edge
.PHONY: sysdeps
sysdeps:
@sudo apt-get update
@sudo apt-get -qqyf install jq python3-yaml bsdtar bridge-utils software-properties-common snapcraft python3-dev tox shellcheck build-essential
travis-sysdeps:
@sudo add-apt-repository -y ppa:ubuntu-lxc/lxd-stable
@sudo apt-get update -q
@sudo apt-get -y install jq bsdtar python3-dev make snapd python-tox lxd lxd-client redis-server
@sudo snap install juju --classic --edge
.PHONY: install
install: snap
@sudo snap install $(NAME)_$(VERSION)_amd64.snap --classic --dangerous
release: update-version clean test snap
@snapcraft push $(NAME)_$(VERSION)_amd64.snap --release $(CHANNEL)
gen-changelog:
if [ ! -f `which github_changelog_generator` ]; then echo "Need to install changelog generator: gem install github_changelog_generator, also generate a token https://git.io/vS1eF" && exit 1; fi
@github_changelog_generator
update-version:
@sed -i -r "s/(^__version__\s=\s)(.*)/\1\"$(VERSION)\"/" conjureup/__init__.py
@sed -i -r "s/(^version:\s)(.*)/\1$(VERSION)/" snap/snapcraft.yaml
snap: sysdeps update-version clean test
@snapcraft
@echo
@echo "Build complete, now run snapcraft push $(NAME)_$(VERSION)_amd64.snap --release $(CHANNEL)"
@echo "Or install with sudo snap install $(NAME)_$(VERSION)_amd64.snap --classic --dangerous"
@echo
clean:
@snapcraft clean
@rm -rf *egg*
@rm -rf site.py
@rm -rf easy-install*
@rm -rf docs/_build/*
@rm -rf mockcfgpath
@rm -rf ../conjure-up_*.deb ../cloud-*.deb ../conjure-up_*.tar.gz ../conjure-up_*.dsc ../conjure-up_*.changes \
../conjure-up_*.build ../conjure-up-*.deb ../conjure-up_*.upload
@rm -rf cover
@rm -rf .coverage
@rm -rf .tox
@rm -rf conjure-up
@rm -rf dist
@rm -rf conjure-dev
@find conjureup/ -name \*.pyc -delete
@find test/ -name \*.pyc -delete
@find . -name __pycache__ -delete
@rm -rf *.snap
.PHONY: test
test: auto-format
@tox -e py35,flake,isort
@shellcheck snap/wrappers/*
git_rev:
@echo $(GIT_REV)
dev: clean
tox -e conjure-dev
@echo "Run 'source conjure-dev/bin/activate' to enter the dev venv"
# Fix some of the python formatting preferred by pylint
auto-format:
@tox -e isort -- isort -rc -m 3 conjureup test tools
@tox -e isort -- autopep8 --in-place --recursive conjureup test tools
all: release