Skip to content

Commit

Permalink
Merge pull request #10 from Sanji-IO/release/mxcloud-1.0
Browse files Browse the repository at this point in the history
Release/mxcloud 1.0
  • Loading branch information
imZack committed Mar 22, 2016
2 parents 43ad89f + 21a41a0 commit 020eda7
Show file tree
Hide file tree
Showing 22 changed files with 999 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .coveragerc to control coverage.py
[run]
branch = True

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

ignore_errors = True

[html]
directory = coverage_html_report
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

# We recommend you to keep these unchanged
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.js,.travis.yml}]
# Change these settings to your own preference
indent_style = space
indent_size = 2

[*.py]
# Change these settings to your own preference
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: python
python:
- "2.7"
install:
- pip install -r requirements.txt
- pip install -r tests/requirements.txt
script: make
after_success:
coveralls
notifications:
slack:
rooms:
- sys:yeTvjm0bw1tX6MBWrfkVL5RG#travis
65 changes: 65 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
NAME = $(shell cat bundle.json | sed -n 's/"name"//p' | tr -d '", :')
VERSION = $(shell cat bundle.json | sed -n 's/"version"//p' | tr -d '", :')

PROJECT = sanji-bundle-$(NAME)

DISTDIR = $(PROJECT)-$(VERSION)
ARCHIVE = $(CURDIR)/$(DISTDIR).tar.gz

SANJI_VER ?= 1.0
INSTALL_DIR = $(DESTDIR)/usr/lib/sanji-$(SANJI_VER)/$(NAME)
STAGING_DIR = $(CURDIR)/staging
PROJECT_STAGING_DIR = $(STAGING_DIR)/$(DISTDIR)

TARGET_FILES = \
LICENSE \
bundle.json \
requirements.txt \
reboot.py
DIST_FILES= \
$(TARGET_FILES) \
README.md \
Makefile \
tests/requirements.txt \
tests/test_reboot.py \
tests/test_e2e/bundle.json \
tests/test_e2e/view_reboot.py
INSTALL_FILES=$(addprefix $(INSTALL_DIR)/,$(TARGET_FILES))
STAGING_FILES=$(addprefix $(PROJECT_STAGING_DIR)/,$(DIST_FILES))


all:

clean:
rm -rf $(DISTDIR)*.tar.gz $(STAGING_DIR)
@rm -rf .coverage
@find ./ -name *.pyc | xargs rm -rf

distclean: clean

pylint:
flake8 -v --exclude=.git,__init__.py .
test:
nosetests --with-coverage --cover-erase --cover-package=$(NAME) -v

dist: $(ARCHIVE)

$(ARCHIVE): distclean $(STAGING_FILES)
@mkdir -p $(STAGING_DIR)
cd $(STAGING_DIR) && \
tar zcf $@ $(DISTDIR)

$(PROJECT_STAGING_DIR)/%: %
@mkdir -p $(dir $@)
@cp -a $< $@

install: $(INSTALL_FILES)

$(INSTALL_DIR)/%: %
@mkdir -p $(dir $@)
@cp -a $< $@

uninstall:
-rm $(addprefix $(INSTALL_DIR)/,$(TARGET_FILES))

.PHONY: clean dist pylint test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sanji-reboot
sanji-reboot [![Build Status](https://travis-ci.org/Sanji-IO/sanji-reboot.svg?branch=develop)](https://travis-ci.org/Sanji-IO/sanji-reboot) [![Coverage Status](https://coveralls.io/repos/Sanji-IO/sanji-reboot/badge.png?branch=develop)](https://coveralls.io/r/Sanji-IO/sanji-reboot?branch=develop)
============

Reboot model.
46 changes: 46 additions & 0 deletions build-deb/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
PROJ_DIR = $(abspath ..)

NAME = $(shell cat $(PROJ_DIR)/bundle.json | sed -n 's/"name"//p' | tr -d '", :')
VERSION = $(shell cat $(PROJ_DIR)/bundle.json | sed -n 's/"version"//p' | tr -d '", :')

PROJECT = sanji-bundle-$(NAME)
DEBVERSION = 1
DIST ?= unstable

STAGING_DIR = $(abspath $(PROJECT)-$(VERSION))
UPSTREAM_ARCHIVE = $(PROJECT)-$(VERSION).tar.gz
UPSTREAM_ORIG_ARCHIVE = $(PROJECT)_$(VERSION).orig.tar.gz

FILES = \
$(STAGING_DIR)/debian/changelog \
$(STAGING_DIR)/debian/compat \
$(STAGING_DIR)/debian/control \
$(STAGING_DIR)/debian/copyright \
$(STAGING_DIR)/debian/docs \
$(STAGING_DIR)/debian/postinst \
$(STAGING_DIR)/debian/README \
$(STAGING_DIR)/debian/rules \
$(STAGING_DIR)/debian/source/format

.PHONY: all build

all: build

build: extract-upstream $(FILES)
cd $(STAGING_DIR) && \
dpkg-buildpackage -us -uc -rfakeroot

$(STAGING_DIR)/debian/%: $(PROJ_DIR)/build-deb/debian/%
mkdir -p $(dir $@)
cp $< $@

extract-upstream:
cp -a $(PROJ_DIR)/$(UPSTREAM_ARCHIVE) $(UPSTREAM_ORIG_ARCHIVE)
tar zxf $(UPSTREAM_ORIG_ARCHIVE)

changelog:
dch -v $(VERSION)-$(DEBVERSION) -D $(DIST) -M -u low \
--release-heuristic log

clean:
rm -rf $(STAGING_DIR) $(PROJECT)-* $(PROJECT)_*
6 changes: 6 additions & 0 deletions build-deb/debian/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The Debian Package reboot
----------------------------

Comments regarding the Package

-- Aeluin Chen <[email protected]> Thu, 10 Sep 2015 14:45:27 +0800
11 changes: 11 additions & 0 deletions build-deb/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sanji-bundle-reboot (0.9.0-1) unstable; urgency=low

* build-deb/ added for building Debian package.

-- Aeluin Chen <[email protected]> Thu, 10 Sep 2015 18:34:48 +0800

sanji-bundle-reboot (0.9.0) unstable; urgency=low

* Initial Release.

-- Aeluin Chen <[email protected]> Thu, 10 Sep 2015 14:45:27 +0800
1 change: 1 addition & 0 deletions build-deb/debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8
18 changes: 18 additions & 0 deletions build-deb/debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Source: sanji-bundle-reboot
Priority: extra
Maintainer: Aeluin Chen <[email protected]>
Build-Depends: debhelper (>= 8.0.0)
Build-Depends-Indep: python (>= 2.7)
Standards-Version: 3.9.3
Section: libs
Homepage: http://www.moxa.com
#Vcs-Git:
#Vcs-Browser: https://github.com/Sanji-IO/sanji-reboot
X-Python-Version: >= 2.5

Package: sanji-bundle-reboot
Section: libs
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, python2.7, python-pip
Description: Handle the reboot request

Loading

0 comments on commit 020eda7

Please sign in to comment.