-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from devicehive/development
Support of DeviceType in subscription DeviceType API integration tests Documentation improvements
- Loading branch information
Showing
31 changed files
with
1,175 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
FROM node:8.7.0-alpine | ||
FROM node:9.4.0-alpine | ||
ENV WORK_DIR=/usr/src/app/ | ||
RUN mkdir -p ${WORK_DIR} \ | ||
&& cd ${WORK_DIR} | ||
|
||
WORKDIR ${WORK_DIR} | ||
|
||
RUN apk add --no-cache --virtual .gyp \ | ||
python \ | ||
make \ | ||
g++ | ||
|
||
COPY . ${WORK_DIR} | ||
|
||
RUN npm install \ | ||
&& apk del .gyp | ||
|
||
RUN npm install pm2 -g | ||
RUN apk add --no-cache --virtual .gyp \ | ||
python make g++ \ | ||
&& npm install \ | ||
&& apk del .gyp \ | ||
&& npm install pm2 -g \ | ||
&& npm cache clean --force | ||
|
||
EXPOSE 1883 | ||
CMD ["pm2-docker", "src/broker.js"] | ||
CMD ["pm2-docker", "src/broker.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
properties([ | ||
buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '7', numToKeepStr: '7')) | ||
]) | ||
|
||
def publish_branches = ["development", "master"] | ||
|
||
stage('Build and publish Docker image in CI repository') { | ||
node('docker') { | ||
checkout scm | ||
echo 'Building image ...' | ||
def mqtt = docker.build('devicehiveci/devicehive-mqtt:${BRANCH_NAME}', '--pull -f Dockerfile .') | ||
|
||
echo 'Pushing image to CI repository ...' | ||
docker.withRegistry('https://registry.hub.docker.com', 'devicehiveci_dockerhub'){ | ||
mqtt.push() | ||
} | ||
} | ||
} | ||
|
||
if (publish_branches.contains(env.BRANCH_NAME)) { | ||
stage('Publish image in main repository') { | ||
node('docker') { | ||
// Builds from 'master' branch will have 'latest' tag | ||
def IMAGE_TAG = (env.BRANCH_NAME == 'master') ? 'latest' : env.BRANCH_NAME | ||
|
||
docker.withRegistry('https://registry.hub.docker.com', 'devicehiveci_dockerhub'){ | ||
sh """ | ||
docker tag devicehiveci/devicehive-mqtt:${BRANCH_NAME} registry.hub.docker.com/devicehive/devicehive-mqtt:${IMAGE_TAG} | ||
docker push registry.hub.docker.com/devicehive/devicehive-mqtt:${IMAGE_TAG} | ||
""" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const path = require(`path`); | ||
const configurator = require(`json-evn-configurator`); | ||
|
||
|
||
module.exports = { | ||
broker: configurator(path.join(__dirname, `../src/config.json`), `BROKER`) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.