1 | # meshblu-connector-deployer
|
2 | [![Build Status](https://travis-ci.org/octoblu/meshblu-connector-packager.svg?branch=master)](https://travis-ci.org/octoblu/meshblu-connector-packager)
|
3 | [![Code Climate](https://codeclimate.com/github/octoblu/meshblu-connector-packager/badges/gpa.svg)](https://codeclimate.com/github/octoblu/meshblu-connector-packager)
|
4 | [![Test Coverage](https://codeclimate.com/github/octoblu/meshblu-connector-packager/badges/coverage.svg)](https://codeclimate.com/github/octoblu/meshblu-connector-packager)
|
5 | [![npm version](https://badge.fury.io/js/.svg)](http://badge.fury.io/js/)
|
6 | [![Gitter](https://badges.gitter.im/octoblu/help.svg)](https://gitter.im/octoblu/help)
|
7 |
|
8 |
|
9 | ### Manual Usage:
|
10 |
|
11 | ```bash
|
12 | npm install --global meshblu-connector-packager
|
13 | cd /path/to/meshblu-connector-{connector-name}
|
14 | meshblu-connector-packager
|
15 | ```
|
16 |
|
17 | ### Installation
|
18 |
|
19 | ```bash
|
20 | cd /path/to/meshblu-connector-{connector-name}
|
21 | npm install --save-dev meshblu-connector-packager
|
22 | ```
|
23 |
|
24 | Add the following to your package.json
|
25 |
|
26 | ```json
|
27 | {
|
28 | "scripts": {
|
29 | "package": "meshblu-connector-packager"
|
30 | },
|
31 | "meshbluConnector": {
|
32 | "connectorAssemblerVersion": "latest",
|
33 | "dependencyManagerVersion": "latest",
|
34 | "ignitionVersion": "v1.0.6",
|
35 | "githubSlug": "octoblu/meshblu-connector-{connector-name}",
|
36 | "schemasUrl": "https://raw.githubusercontent.com/octoblu/meshblu-connector-{connector-name}/{schema-tag}/schemas.json"
|
37 | }
|
38 | }
|
39 | ```
|
40 |
|
41 | ### Example Travis Usage
|
42 |
|
43 | ```yml
|
44 | language: cpp
|
45 | os:
|
46 | - linux
|
47 | - osx
|
48 | addons:
|
49 | apt:
|
50 | sources:
|
51 | - ubuntu-toolchain-r-test
|
52 | packages:
|
53 | - g++-4.8
|
54 | - g++-4.8-multilib
|
55 | - gcc-multilib
|
56 | - build-essential
|
57 | env:
|
58 | matrix:
|
59 | - PACKAGER_NODE_VERSION="5.5" PACKAGER_ARCH="amd64" MAIN_BUILD="true"
|
60 | - PACKAGER_NODE_VERSION="5.5" PACKAGER_ARCH="386"
|
61 | matrix:
|
62 | exclude:
|
63 | - os: osx
|
64 | env: PACKAGER_NODE_VERSION="5.5" PACKAGER_ARCH="386"
|
65 | branches:
|
66 | only:
|
67 | - "/^v[0-9]/"
|
68 | before_install:
|
69 | - PACKAGER_URL="https://meshblu-connector.octoblu.com/tools/packager/latest"
|
70 | - curl -fsS "${PACKAGER_URL}/travis_install_node.sh" -o /tmp/travis_install_node.sh
|
71 | - chmod +x /tmp/travis_install_node.sh
|
72 | - ". /tmp/travis_install_node.sh"
|
73 | - if [ "$TRAVIS_OS_NAME" == "linux" -a "$MAIN_BUILD" == "true" ]; then export NPM_PUBLISH="true"; fi
|
74 | install:
|
75 | - npm install --build-from-source
|
76 | script:
|
77 | - npm test
|
78 | before_deploy:
|
79 | - npm run package
|
80 | deploy:
|
81 | - provider: releases
|
82 | api_key:
|
83 | secure: "secure-api-key"
|
84 | file_glob: true
|
85 | file:
|
86 | - "deploy/*"
|
87 | skip_cleanup: true
|
88 | on:
|
89 | tags: true
|
90 | - provider: npm
|
91 | email: serveradmin@octoblu.com
|
92 | api_key:
|
93 | secure: "secure-api-key"
|
94 | on:
|
95 | tags: true
|
96 | condition: "$NPM_PUBLISH = true"
|
97 | ```
|
98 |
|
99 | *Don't forget to encrypt and add your NPM Key and Github Oauth Token*
|
100 |
|
101 |
|
102 | ### Example Appveyor Usage:
|
103 |
|
104 | ```yml
|
105 | environment:
|
106 | nodejs_version: 5.5.0
|
107 | platform:
|
108 | - x64
|
109 | - x86
|
110 | shallow_clone: true
|
111 | skip_non_tags: true
|
112 | install:
|
113 | - ps: Install-Product node $env:nodejs_version $env:Platform
|
114 | - node --version
|
115 | - npm --version
|
116 | - node -e "console.log(process.arch);"
|
117 | - FOR /F "delims=" %%a IN ('node -e "console.log(require('./package.json').version)"') DO SET PACKAGE_VERSION=%%~a
|
118 | - SET PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH%
|
119 | - SET GYP_MSVS_VERSION=2013
|
120 | - if "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
|
121 | - if "%PLATFORM%" == "x86" SET PATH=C:\python27;%PATH%
|
122 | - npm install
|
123 | - ps: >-
|
124 | if($env:platform -eq "x86") {
|
125 | $env:PACKAGER_ARCH="386"
|
126 | } else {
|
127 | $env:PACKAGER_ARCH="amd64"
|
128 | }
|
129 | - npm run package
|
130 | - ps: $root = Resolve-Path deploy; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName Connector }
|
131 | build: off
|
132 | test: off
|
133 | deploy:
|
134 | - provider: GitHub
|
135 | description: 'Meshblu Connector Bundles'
|
136 | auth_token:
|
137 | secure: "secure-api-key"
|
138 | artifact: Connector
|
139 | draft: false
|
140 | prerelease: false
|
141 | on:
|
142 | branch: master
|
143 | appveyor_repo_tag: true
|
144 | ```
|