Skip to content

Commit

Permalink
Merge with EMQ X
Browse files Browse the repository at this point in the history
  • Loading branch information
Feng Lee committed Oct 8, 2017
1 parent 70cadc3 commit 20fe426
Show file tree
Hide file tree
Showing 29 changed files with 231 additions and 212 deletions.
4 changes: 2 additions & 2 deletions .ci/build.sh
Expand Up @@ -12,7 +12,7 @@ mkdir -p /home/ubuntu/package

oslist=(debian7 debian8 debian9 centos6.8 centos7 ubuntu12.04 ubuntu14.04 ubuntu16.04)
for var in ${oslist[@]};do
sudo docker build -t ci-${var} -f ${var}/Dockerfile .
sudo docker build -t emqx_ci-${var} -f ${var}/Dockerfile .
sudo docker rm -f emq-${var}
sudo docker run -itd --net='host' --name emq-${var} -e "ostype=${var}" -e "host=emqtt.io" -e "tag=release" -e "versionid=$1" -e "type=$2" ci-${var}
sudo docker run -itd --net='host' --name emq-${var} -e "ostype=${var}" -e "host=emqtt.io" -e "tag=release" -e "versionid=$1" -e "type=$2" emqx_ci-${var}
done
5 changes: 3 additions & 2 deletions .ci/centos6.8/Dockerfile
Expand Up @@ -7,6 +7,7 @@ RUN wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm
RUN rpm -Uvh /tmp/erlang-solutions-1.0-1.noarch.rpm
RUN yum install -y epel-release
RUN yum install -y esl-erlang-20.0
RUN mkdir -p /rebar && git clone https://github.com/rebar/rebar && cd /rebar && ./bootstrap && cp /rebar/rebar /usr/local/bin/ && rm -rf /rebar
RUN mkdir -p /root/.ssh/

# cleanup
Expand All @@ -16,6 +17,6 @@ RUN yum clean packages \
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /
ADD ./files/emqx_ci.sh /

CMD ["/emq_ci.sh"]
CMD ["/emqx_ci.sh"]
7 changes: 4 additions & 3 deletions .ci/centos7/Dockerfile
@@ -1,12 +1,13 @@
FROM centos:7

RUN yum update -y
RUN yum install -y wget git zip
RUN yum install -y wget git zip which
RUN yum groupinstall -y "Development Tools"
RUN wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm -P /tmp
RUN rpm -Uvh /tmp/erlang-solutions-1.0-1.noarch.rpm
RUN yum install -y epel-release
RUN yum install -y esl-erlang-20.0
RUN mkdir -p /rebar && git clone https://github.com/rebar/rebar && cd /rebar && ./bootstrap && cp /rebar/rebar /usr/local/bin/ && rm -rf /rebar
RUN mkdir -p /root/.ssh/

# cleanup
Expand All @@ -16,6 +17,6 @@ RUN yum clean packages \
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /
ADD ./files/emqx_ci.sh /

CMD ["/emq_ci.sh"]
CMD ["/emqx_ci.sh"]
4 changes: 2 additions & 2 deletions .ci/debian7/Dockerfile
Expand Up @@ -11,6 +11,6 @@ RUN apt-get clean\
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /
ADD ./files/emqx_ci.sh /

CMD ["/emq_ci.sh"]
CMD ["/emqx_ci.sh"]
5 changes: 3 additions & 2 deletions .ci/debian8/Dockerfile
Expand Up @@ -5,6 +5,7 @@ RUN apt-get install -y wget git zip build-essential debhelper
RUN wget http://packages.erlang-solutions.com/site/esl/esl-erlang/FLAVOUR_1_general/esl-erlang_20.0-1~debian~jessie_amd64.deb -O /tmp/erlang.deb
RUN dpkg -i /tmp/erlang.deb || true
RUN apt-get -f install -y
RUN mkdir -p /rebar && git clone https://github.com/rebar/rebar && cd /rebar && ./bootstrap && cp /rebar/rebar /usr/local/bin/ && rm -rf /rebar
RUN mkdir -p /root/.ssh/
# cleanup
RUN apt-get clean\
Expand All @@ -13,6 +14,6 @@ RUN apt-get clean\
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /
ADD ./files/emqx_ci.sh /

CMD ["/emq_ci.sh"]
CMD ["/emqx_ci.sh"]
8 changes: 4 additions & 4 deletions .ci/docker_ci.sh
Expand Up @@ -5,15 +5,15 @@
# Example:
# ./docker_ci.sh 2.2-beta.1

package=emqttd-docker-v$1
package=emqx-docker-v$1

git clone https://github.com/emqtt/emq-docker
git clone -b X https://github.com/emqtt/emq-docker emqx-docker

cd emq-docker
cd emqx-docker

sudo docker build -t ${package} .

sudo docker save ${package} > ${package}
sudo docker save ${package} > ${package}

zip -r ${package}.zip ${package}

Expand Down
18 changes: 0 additions & 18 deletions .ci/files/emq_ci.sh

This file was deleted.

18 changes: 18 additions & 0 deletions .ci/files/emqx_ci.sh
@@ -0,0 +1,18 @@
#!/bin/bash

chmod 600 /root/.ssh/config
rm -rf /emqx_temp && mkdir /emqx_temp && cd /emqx_temp
git clone -b ${tag} https://github.com/emqtt/emq-relx.git emqx-rel
version=`cd emqx-rel && git describe --abbrev=0 --tags`
pkg=emqx-${ostype}-${version}.zip
echo "building $pkg..."
cd emqx-rel && make && cd _rel && zip -rq $pkg emqx && scp $pkg root@${host}:/root/releases/${versionid}-${type} && cd /emq_temp

git clone -b X https://github.com/emqtt/emq-package.git emqx-package
cd emqx-package
make
name=`basename package/*`
name2=${name/emqx-${versionid}/emqx-${ostype}-${version}}
name3=${name2/emqx_${versionid}/emqx-${ostype}-${version}}
mv package/${name} package/${name3}
scp package/* root@${host}:/root/releases/${versionid}-${type}
8 changes: 4 additions & 4 deletions .ci/mac_ci.sh
Expand Up @@ -5,9 +5,9 @@
# Example:
# ./mac_ci.sh 2.2-beta.1

git clone -b release https://github.com/emqtt/emq-relx.git
version=`cd emq-relx && git describe --abbrev=0 --tags`
pkg=emqttd-macosx-${version}.zip
git clone -b release https://github.com/emqtt/emq-relx.git emqx-rel
version=`cd emqx-rel && git describe --abbrev=0 --tags`
pkg=emqx-macosx-${version}.zip
echo "building $pkg..."
cd emq-relx && make && cd _rel && zip -rq $pkg emqttd
cd emqx-rel && make && cd _rel && zip -rq $pkg emqx
scp _rel/$pkg root@emqtt.io:/root/releases/$1
5 changes: 2 additions & 3 deletions .ci/ubuntu12.04/Dockerfile
Expand Up @@ -13,7 +13,6 @@ RUN apt-get clean\
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /

CMD ["/emq_ci.sh"]
ADD ./files/emqx_ci.sh /

CMD ["/emqx_ci.sh"]
4 changes: 2 additions & 2 deletions .ci/ubuntu14.04/Dockerfile
Expand Up @@ -16,6 +16,6 @@ RUN apt-get clean\
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /
ADD ./files/emqx_ci.sh /

CMD ["/emq_ci.sh"]
CMD ["/emqx_ci.sh"]
4 changes: 2 additions & 2 deletions .ci/ubuntu16.04/Dockerfile
Expand Up @@ -15,6 +15,6 @@ RUN apt-get clean\
ADD ./files/id_rsa /root/.ssh/
ADD ./files/id_rsa.pub /root/.ssh/
ADD ./files/config /root/.ssh/
ADD ./files/emq_ci.sh /
ADD ./files/emqx_ci.sh /

CMD ["/emq_ci.sh"]
CMD ["/emqx_ci.sh"]
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -17,3 +17,6 @@ rel/
log/
ct/logs/*
.DS_Store
.idea/
*.d
*.iml
85 changes: 47 additions & 38 deletions Makefile
@@ -1,61 +1,70 @@
PROJECT = emq-relx
PROJECT_DESCRIPTION = Release Project for the EMQ Broker
PROJECT_VERSION = 2.3
PROJECT = emqx-rel
PROJECT_DESCRIPTION = Release Project for EMQ X Broker
PROJECT_VERSION = 2.4

NO_AUTOPATCH = gen_rpc cuttlefish emqx_elixir_plugin
## Fix 'rebar command not found'
DEPS = goldrush
dep_goldrush = git https://github.com/basho/goldrush 0.1.9

DEPS += emqttd emq_modules emq_dashboard emq_retainer emq_recon emq_reloader \
emq_auth_clientid emq_auth_username emq_auth_ldap emq_auth_http \
emq_auth_mysql emq_auth_pgsql emq_auth_redis emq_auth_mongo \
emq_sn emq_coap emq_stomp emq_plugin_template emq_web_hook \
emq_lua_hook emq_auth_jwt emq_lwm2m
DEPS += emqx emqx_modules emqx_management emqx_dashboard emqx_retainer \
emqx_auth_clientid emqx_auth_username emqx_auth_ldap emqx_auth_http \
emqx_auth_mysql emqx_auth_pgsql emqx_auth_redis emqx_auth_mongo \
emqx_auth_jwt emqx_statsd emqx_delayed_publish emqx_recon emqx_reloader \
emqx_web_hook emqx_lua_hook emqx_sn emqx_coap emqx_stomp emqx_lwm2m \
emqx_plugin_template

# emq deps
dep_emqttd = git https://github.com/emqtt/emqttd develop
dep_emq_modules = git https://github.com/emqtt/emq-modules develop
dep_emq_dashboard = git https://github.com/emqtt/emq-dashboard develop
dep_emq_retainer = git https://github.com/emqtt/emq-retainer develop
dep_emq_recon = git https://github.com/emqtt/emq-recon develop
dep_emq_reloader = git https://github.com/emqtt/emq-reloader develop
# emqx modules
dep_emqx = git https://github.com/emqtt/emqttd X

# emq auth/acl plugins
dep_emq_auth_clientid = git https://github.com/emqtt/emq-auth-clientid develop
dep_emq_auth_username = git https://github.com/emqtt/emq-auth-username develop
dep_emq_auth_ldap = git https://github.com/emqtt/emq-auth-ldap develop
dep_emq_auth_http = git https://github.com/emqtt/emq-auth-http develop
dep_emq_auth_mysql = git https://github.com/emqtt/emq-auth-mysql develop
dep_emq_auth_pgsql = git https://github.com/emqtt/emq-auth-pgsql develop
dep_emq_auth_redis = git https://github.com/emqtt/emq-auth-redis develop
dep_emq_auth_mongo = git https://github.com/emqtt/emq-auth-mongo develop
dep_emq_auth_jwt = git https://github.com/emqtt/emq-auth-jwt develop
dep_emqx_modules = git https://github.com/emqtt/emq-modules X
dep_emqx_management = git https://github.com/emqtt/emq-management X
dep_emqx_dashboard = git https://github.com/emqtt/emq-dashboard X
dep_emqx_retainer = git https://github.com/emqtt/emq-retainer X
dep_emqx_recon = git https://github.com/emqtt/emq-recon X
dep_emqx_reloader = git https://github.com/emqtt/emq-reloader X
dep_emqx_statsd = git https://github.com/emqtt/emqx-statsd X
dep_emqx_delayed_publish = git https://github.com/emqtt/emqx-delayed-publish X
# emqx auth/acl plugins
dep_emqx_auth_clientid = git https://github.com/emqtt/emq-auth-clientid X
dep_emqx_auth_username = git https://github.com/emqtt/emq-auth-username X
dep_emqx_auth_ldap = git https://github.com/emqtt/emq-auth-ldap X
dep_emqx_auth_http = git https://github.com/emqtt/emq-auth-http X
dep_emqx_auth_mysql = git https://github.com/emqtt/emq-auth-mysql X
dep_emqx_auth_pgsql = git https://github.com/emqtt/emq-auth-pgsql X
dep_emqx_auth_redis = git https://github.com/emqtt/emq-auth-redis X
dep_emqx_auth_mongo = git https://github.com/emqtt/emq-auth-mongo X
dep_emqx_auth_jwt = git https://github.com/emqtt/emq-auth-jwt X

# mqtt-sn, coap and stomp
dep_emq_sn = git https://github.com/emqtt/emq-sn develop
dep_emq_coap = git https://github.com/emqtt/emq-coap develop
dep_emq_stomp = git https://github.com/emqtt/emq-stomp develop
dep_emq_lwm2m = git https://github.com/emqtt/emq-lwm2m develop
# emqx mqtt-sn, coap and stomp
dep_emqx_sn = git https://github.com/emqtt/emq-sn X
dep_emqx_coap = git https://github.com/emqtt/emq-coap X
dep_emqx_stomp = git https://github.com/emqtt/emq-stomp X
dep_emqx_lwm2m = git https://github.com/emqtt/emq-lwm2m X

# plugin template
dep_emq_plugin_template = git https://github.com/emqtt/emq-plugin-template develop
# emqx plugin template
dep_emqx_plugin_template = git https://github.com/emqtt/emq-plugin-template X

# web_hook lua_hook
dep_emq_web_hook = git https://github.com/emqtt/emq-web-hook develop
dep_emq_lua_hook = git https://github.com/emqtt/emq-lua-hook develop
#dep_emq_elixir_plugin = git https://github.com/emqtt/emq-elixir-plugin develop
dep_emqx_web_hook = git https://github.com/emqtt/emq-web-hook X
dep_emqx_lua_hook = git https://github.com/emqtt/emq-lua-hook X
#dep_emqx_elixir_plugin = git https://github.com/emqtt/emq-elixir-plugin X

# COVER = true
BUILD_DEPS = cuttlefish
dep_cuttlefish = git https://github.com/emqtt/cuttlefish

NO_AUTOPATCH = emq_elixir_plugin
# COVER = true

include erlang.mk

# Compile options
ERLC_OPTS += +warn_export_all +warn_missing_spec +warn_untyped_record

plugins:
@rm -rf rel
@mkdir -p rel/conf/plugins/ rel/schema/
@for conf in $(DEPS_DIR)/*/etc/*.conf* ; do \
if [ "emq.conf" = "$${conf##*/}" ] ; then \
if [ "emqx.conf" = "$${conf##*/}" ] ; then \
cp $${conf} rel/conf/ ; \
elif [ "acl.conf" = "$${conf##*/}" ] ; then \
cp $${conf} rel/conf/ ; \
Expand Down
24 changes: 12 additions & 12 deletions README.md
@@ -1,25 +1,25 @@
emq-relx
emqx-rel
========

The Release Project for the *EMQ* Broker.
The Release Project for EMQ X Broker.

NOTICE: Requires Erlang/OTP R19.3+ to build since EMQ 2.2-rc.2.

Build on Linux/Unix/Mac
-----------------------

```
git clone https://github.com/emqtt/emq-relx.git
cd emq-relx && make
cd _rel/emqttd && ./bin/emqttd console
git clone -b X https://github.com/emqtt/emq-relx.git emqx-rel
cd emqx-rel && make
cd _rel/emqx && ./bin/emqx console
```

Build Docker Image
------------------

```
git clone https://github.com/emqtt/emq_docker.git
cd emq_docker && docker build -t emq:latest .
git clone -b X https://github.com/emqtt/emq_docker.git emqx_docker
cd emqx_docker && docker build -t emqx:latest .
```

Build on Windows
Expand All @@ -31,14 +31,14 @@ Install Erlang/OTP-R18.3 and MSYS2-x86_64 for erlang.mk:
https://erlang.mk/guide/installation.html#_on_windows
```

Clone and build the EMQ broker with erlang.mk:
Clone and build the EMQ X Broker with erlang.mk:

```
git clone https://github.com/emqtt/emq-relx.git
cd emq-relx
git clone -b X https://github.com/emqtt/emq-relx.git emqx-rel
cd emqx-rel
make
cd _rel\emqttd
bin\emqttd console
cd _rel\emqx
bin\emqx console
```

License
Expand Down
11 changes: 0 additions & 11 deletions bin/emqenv

This file was deleted.

0 comments on commit 20fe426

Please sign in to comment.