Add travis-ci build

This commit is contained in:
David PHAM-VAN 2018-11-04 10:08:14 -05:00
parent 5ab63d15f8
commit 8e7c4138f9
6 changed files with 89 additions and 3 deletions

1
.gitignore vendored
View File

@ -39,3 +39,4 @@ luac.out
*.x86_64
*.hex
sdk

39
.travis.yml Normal file
View File

@ -0,0 +1,39 @@
sudo: false
language: c
compiler: gcc
notifications:
email: false
env:
global:
- PACKAGE=luci-app-netmap
matrix:
- SDK_URL=https://downloads.openwrt.org/releases/18.06.1/targets/x86/generic/openwrt-sdk-18.06.1-x86-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz
install:
- mkdir sdk
- curl -L $SDK_URL | tar xJ --strip-components=1 -C sdk
- mkdir -p sdk/package/$PACKAGE
- ln -sf ../../../Makefile sdk/package/$PACKAGE/
- ln -sf ../../../src sdk/package/$PACKAGE/
- echo "CONFIG_HAVE_DOT_CONFIG=y" > sdk/.config
script:
- cd sdk
- make V=s package/luci-app-netmap/compile
- find . -name *.ipk -exec mv {} $TRAVIS_BUILD_DIR \;
- cd $TRAVIS_BUILD_DIR/
before_deploy:
git fetch --tags
deploy:
provider: releases
api_key:
secure: PYrA5xw/z2GqDipXml/WrGEZFNnr5lBjbmDx9sNGgBvIChah5K5q5hC6ZJ7ZsSVwXVKWiXFul5EaGjDFB/Eh5wB33Mb5/ENMztDcWVnik7LS5c4Rp/vDUh274qdE/S3+GgqsuFsS8SP+rh+w6+jozNR6xOBMq9xXUJsF/N5lNp8LZwapeDZOaEl3RB/yGv5DAfsVtCJzsp9OUa0MuxXZdmRfyrulxT4eP5hFTuciQ4je1y2hVRp0UszH8lWz7AhlAyAoxKmBdcr1jCM88SiJJcC303HA2DK1U2/p5ejj5tHymcFG8CViveoGxvNbW9zahBrD2Ig0dJL4f7dBQKluEruex3iZJtkDkoFB7XhTevh2DLmFa0D+d+/19qzLKnL0W4EKWqBCgTabv/wlM8RmvLPK4Ql7/3bNeLFbn2Oc9iW/JEkTCSJWLhcq/AGlCgYrMgYaMM9daeAi96DpW/tuCUsbSfKi+p/xniyWqfV0s09NRMSOAK9WY+GllbKL9XgvVaKqUbHTsKK9EmmtTaWb4JS6NSzUM1pYQnjh5/g/TiEP5kFVo6dbFi6o9c20XMiXFkcddXuyJmsPlCyWwfb38PgaSFkxEe8tL+bMQJK8tSJKJtny4wjetCgQemtyd61vpifpBpCP9dNcL1ydURiBrhUOlaY+6fN9xTx6q1bNQUQ=
skip_cleanup: true
file_glob: true
file: $TRAVIS_BUILD_DIR/luci-app-netmap*.ipk
on:
tags: true

View File

@ -15,7 +15,6 @@ define Package/luci-app-netmap
URL:=https://github.com/DavBfr/luci-app-netmap
MAINTAINER:=David PHAM-VAN <dev.nfet.net@gmail.com>
SUBMENU:=3. Applications
#DEPENDS:=+openvpn-openssl +openssl-util
TITLE:=Network Map
PKGARCH:=all
PKG_LICENSE:=APACHE_2
@ -44,8 +43,8 @@ define Package/luci-app-netmap/install
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/map
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./index.htm $(1)/usr/lib/lua/luci/view/map/
$(INSTALL_BIN) ./map.lua $(1)/usr/lib/lua/luci/controller/
$(INSTALL_BIN) ./src/index.htm $(1)/usr/lib/lua/luci/view/map/
$(INSTALL_BIN) ./src/map.lua $(1)/usr/lib/lua/luci/controller/
endef
define Package/luci-app-netmap/postinst

47
src/map.htm Normal file
View File

@ -0,0 +1,47 @@
<%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
<div class="errorbox"><%=pcdata(msg)%></div>
<%- end end -%>
<%-+cbi/apply_xhr-%>
<div class="cbi-map" id="cbi-<%=self.config%>">
<% if self.title and #self.title > 0 then %><h2 name="content"><%=self.title%></h2><% end %>
<% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
<%- if firstmap and applymap then cbi_apply_xhr(self.config, parsechain, redirect) end -%>
<% if self.tabbed then %>
<ul class="cbi-tabmenu map">
<%- self.selected_tab = luci.http.formvalue("tab.m-" .. self.config) %>
<% for i, section in ipairs(self.children) do %>
<%- if not self.selected_tab then self.selected_tab = section.sectiontype end %>
<li id="tab.m-<%=self.config%>.<%=section.section or section.sectiontype%>" class="cbi-tab<%=(section.sectiontype == self.selected_tab) and '' or '-disabled'%>">
<a onclick="this.blur(); return cbi_t_switch('m-<%=self.config%>', '<%=section.section or section.sectiontype%>')" href="<%=REQUEST_URI%>?tab.m-<%=self.config%>=<%=section.section or section.sectiontype%>"><%=section.title or section.section or section.sectiontype %></a>
<% if section.sectiontype == self.selected_tab then %><input type="hidden" id="tab.m-<%=self.config%>" name="tab.m-<%=self.config%>" value="<%=section.section or section.sectiontype%>" /><% end %>
</li>
<% end %>
</ul>
<br />
<% for i, section in ipairs(self.children) do %>
<div class="cbi-tabcontainer" id="container.m-<%=self.config%>.<%=section.section or section.sectiontype%>"<% if section.sectiontype ~= self.selected_tab then %> style="display:none"<% end %>>
<% section:render() %>
</div>
<script type="text/javascript">cbi_t_add('m-<%=self.config%>', '<%=section.section or section.sectiontype%>')</script>
<% end %>
<% if not self.save then -%>
<div class="cbi-section-error">
<% for _, section in ipairs(self.children) do %>
<% if section.error and section.error[section.section] then -%>
<ul><li>
<%:One or more invalid/required values on tab%>:&nbsp;<%=section.title or section.section or section.sectiontype%>
</li></ul>
<%- end %>
<% end %>
</div>
<%- end %>
<% else %>
<%- self:render_children() %>
<% end %>
<br />
</div>