├── .gitignore ├── LICENSE ├── README.md ├── index.js ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Uber5 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Status 2 | 3 | Works for [us](http://about.uber5.com) in production. 4 | 5 | # How to Use 6 | 7 | In `.gitlab-ci.yml`, probably in a `deploy` stage, install this package and run 8 | a deploy script: 9 | 10 | ``` 11 | deploy: 12 | stage: deploy 13 | image: node:6 14 | only: 15 | - deploy-branch@some-name/my-project 16 | script: 17 | - npm install gitlab2rancher-deploy 18 | - node scripts/deploy.js 19 | ``` 20 | 21 | ... where `scripts/deploy.js` may look like this: 22 | 23 | ``` 24 | const upgrade = require('gitlab2rancher-deploy') 25 | 26 | const serviceUrl = process.env.RANCHER_SERVICE_URL 27 | 28 | upgrade(serviceUrl) 29 | .catch(err => { console.log(err.stack); process.exit(1) }) 30 | ``` 31 | 32 | ... and after defining the service url as a Gitlab variabl, e.g. 33 | 34 | ``` 35 | RANCHER_SERVICE_URL=https://my-rancher.my-host.com/v1/projects/1a5/services/1s29 36 | ``` 37 | 38 | ... and `RANCHER_ACCESS_KEY` and `RANCHER_SECRET_KEY` (under `API` in Rancher): 39 | 40 | At the next push to branch `deploy-branch` of project `some-name/my-project`, 41 | the Rancher service with id `1s29` should be upgraded accordingly. 42 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const request = require('request') 2 | 3 | function getAuthorizationHeader() { 4 | if (!process.env.RANCHER_ACCESS_KEY || !process.env.RANCHER_SECRET_KEY) { 5 | throw new Error('Rancher credentials not available in environment') 6 | } 7 | const credentials = `${ process.env.RANCHER_ACCESS_KEY }:${ process.env.RANCHER_SECRET_KEY }` 8 | const encoded = new Buffer(credentials).toString('base64') 9 | return `Basic ${ encoded }` 10 | } 11 | 12 | function doREST(options) { 13 | return new Promise((resolve, reject) => { 14 | if (typeof options === 'string') options = { url: options }; 15 | const params = Object.assign({}, { 16 | method: 'GET', 17 | headers: { 18 | authorization: getAuthorizationHeader() 19 | } 20 | }, options) 21 | console.log('about to request', params) 22 | request(params, function(err, response, body) { 23 | if (err) return reject(err); 24 | if (response.statusCode >= 300) { 25 | throw new Error(`get, unexpected statusCode ${ response.statusCode }, body=${ body }`) 26 | } 27 | const parsed = JSON.parse(body) 28 | console.log('parsed response', parsed) 29 | return resolve(parsed) 30 | }) 31 | }) 32 | } 33 | 34 | function get(url) { 35 | return doREST(url) 36 | } 37 | 38 | function post(options) { 39 | if (typeof options === 'string') options = { url: options }; 40 | options = Object.assign({}, options, { method: 'POST' }) 41 | return doREST(options) 42 | } 43 | 44 | function waitUntilUpgradeAvailable(serviceUrl) { 45 | return get(serviceUrl) 46 | .then(status => { 47 | if (status.actions.upgrade) { 48 | return status 49 | } else { 50 | return new Promise((resolve) => { 51 | setTimeout(() => resolve(waitUntilUpgradeAvailable(serviceUrl)), 2000) 52 | }) 53 | } 54 | }) 55 | } 56 | 57 | // The optional "startFist" parameter is described here: 58 | // https://rancher.com/docs/rancher/v1.6/en/cattle/upgrading/#in-service-upgrade 59 | // The default value - if not provided - is true. 60 | // You'll only want to set it to false if you are reusing the service IP address in Rancher. 61 | function upgrade(serviceUrl, startFirst) { 62 | return get(serviceUrl) 63 | .then(status => { // finish previous upgrade, if necessary 64 | console.log('launchConfig', status.launchConfig) 65 | if (status.actions.finishupgrade) { 66 | return post({ url: status.actions.finishupgrade }) 67 | .then(r => waitUntilUpgradeAvailable(serviceUrl)) 68 | .then(r => get(serviceUrl)) 69 | } else { 70 | return status 71 | } 72 | }) 73 | .then(status => { 74 | if (!status.actions.upgrade) { 75 | throw new Error(`Upgrade action not available for ${ status.links.self }. Is service active?`) 76 | } 77 | return status 78 | }) 79 | .then(status => post({ 80 | url: status.actions.upgrade, 81 | body: JSON.stringify({ 82 | inServiceStrategy: { 83 | startFirst: (typeof startFirst !== 'undefined') ? startFirst : true, 84 | launchConfig: status.launchConfig 85 | }, 86 | toServiceStrategy: { 87 | } 88 | }) 89 | })) 90 | } 91 | 92 | module.exports = upgrade 93 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gitlab2rancher-deploy", 3 | "version": "0.1.3", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "ajv": { 8 | "version": "6.10.2", 9 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", 10 | "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", 11 | "requires": { 12 | "fast-deep-equal": "^2.0.1", 13 | "fast-json-stable-stringify": "^2.0.0", 14 | "json-schema-traverse": "^0.4.1", 15 | "uri-js": "^4.2.2" 16 | } 17 | }, 18 | "asn1": { 19 | "version": "0.2.4", 20 | "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", 21 | "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", 22 | "requires": { 23 | "safer-buffer": "~2.1.0" 24 | } 25 | }, 26 | "assert-plus": { 27 | "version": "1.0.0", 28 | "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", 29 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 30 | }, 31 | "asynckit": { 32 | "version": "0.4.0", 33 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 34 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 35 | }, 36 | "aws-sign2": { 37 | "version": "0.7.0", 38 | "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", 39 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 40 | }, 41 | "aws4": { 42 | "version": "1.8.0", 43 | "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", 44 | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" 45 | }, 46 | "bcrypt-pbkdf": { 47 | "version": "1.0.2", 48 | "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", 49 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 50 | "requires": { 51 | "tweetnacl": "^0.14.3" 52 | } 53 | }, 54 | "caseless": { 55 | "version": "0.12.0", 56 | "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", 57 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 58 | }, 59 | "combined-stream": { 60 | "version": "1.0.8", 61 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 62 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 63 | "requires": { 64 | "delayed-stream": "~1.0.0" 65 | } 66 | }, 67 | "core-util-is": { 68 | "version": "1.0.2", 69 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 70 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 71 | }, 72 | "dashdash": { 73 | "version": "1.14.1", 74 | "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", 75 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 76 | "requires": { 77 | "assert-plus": "^1.0.0" 78 | } 79 | }, 80 | "delayed-stream": { 81 | "version": "1.0.0", 82 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 83 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 84 | }, 85 | "ecc-jsbn": { 86 | "version": "0.1.2", 87 | "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", 88 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 89 | "requires": { 90 | "jsbn": "~0.1.0", 91 | "safer-buffer": "^2.1.0" 92 | } 93 | }, 94 | "extend": { 95 | "version": "3.0.2", 96 | "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", 97 | "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" 98 | }, 99 | "extsprintf": { 100 | "version": "1.3.0", 101 | "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", 102 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 103 | }, 104 | "fast-deep-equal": { 105 | "version": "2.0.1", 106 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", 107 | "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" 108 | }, 109 | "fast-json-stable-stringify": { 110 | "version": "2.0.0", 111 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", 112 | "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" 113 | }, 114 | "forever-agent": { 115 | "version": "0.6.1", 116 | "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", 117 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 118 | }, 119 | "form-data": { 120 | "version": "2.3.3", 121 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", 122 | "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", 123 | "requires": { 124 | "asynckit": "^0.4.0", 125 | "combined-stream": "^1.0.6", 126 | "mime-types": "^2.1.12" 127 | } 128 | }, 129 | "getpass": { 130 | "version": "0.1.7", 131 | "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", 132 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 133 | "requires": { 134 | "assert-plus": "^1.0.0" 135 | } 136 | }, 137 | "har-schema": { 138 | "version": "2.0.0", 139 | "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", 140 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 141 | }, 142 | "har-validator": { 143 | "version": "5.1.3", 144 | "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", 145 | "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", 146 | "requires": { 147 | "ajv": "^6.5.5", 148 | "har-schema": "^2.0.0" 149 | } 150 | }, 151 | "http-signature": { 152 | "version": "1.2.0", 153 | "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", 154 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 155 | "requires": { 156 | "assert-plus": "^1.0.0", 157 | "jsprim": "^1.2.2", 158 | "sshpk": "^1.7.0" 159 | } 160 | }, 161 | "is-typedarray": { 162 | "version": "1.0.0", 163 | "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", 164 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 165 | }, 166 | "isstream": { 167 | "version": "0.1.2", 168 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 169 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 170 | }, 171 | "jsbn": { 172 | "version": "0.1.1", 173 | "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", 174 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 175 | }, 176 | "json-schema-traverse": { 177 | "version": "0.4.1", 178 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 179 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" 180 | }, 181 | "json-stringify-safe": { 182 | "version": "5.0.1", 183 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 184 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 185 | }, 186 | "jsprim": { 187 | "version": "1.4.2", 188 | "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", 189 | "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", 190 | "requires": { 191 | "assert-plus": "1.0.0", 192 | "extsprintf": "1.3.0", 193 | "json-schema": "0.4.0", 194 | "verror": "1.10.0" 195 | }, 196 | "dependencies": { 197 | "json-schema": { 198 | "version": "0.4.0", 199 | "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", 200 | "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" 201 | } 202 | } 203 | }, 204 | "mime-db": { 205 | "version": "1.40.0", 206 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", 207 | "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" 208 | }, 209 | "mime-types": { 210 | "version": "2.1.24", 211 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", 212 | "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", 213 | "requires": { 214 | "mime-db": "1.40.0" 215 | } 216 | }, 217 | "oauth-sign": { 218 | "version": "0.9.0", 219 | "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", 220 | "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" 221 | }, 222 | "performance-now": { 223 | "version": "2.1.0", 224 | "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", 225 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 226 | }, 227 | "psl": { 228 | "version": "1.3.0", 229 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz", 230 | "integrity": "sha512-avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==" 231 | }, 232 | "punycode": { 233 | "version": "2.1.1", 234 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 235 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 236 | }, 237 | "qs": { 238 | "version": "6.5.2", 239 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", 240 | "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" 241 | }, 242 | "request": { 243 | "version": "2.88.0", 244 | "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", 245 | "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", 246 | "requires": { 247 | "aws-sign2": "~0.7.0", 248 | "aws4": "^1.8.0", 249 | "caseless": "~0.12.0", 250 | "combined-stream": "~1.0.6", 251 | "extend": "~3.0.2", 252 | "forever-agent": "~0.6.1", 253 | "form-data": "~2.3.2", 254 | "har-validator": "~5.1.0", 255 | "http-signature": "~1.2.0", 256 | "is-typedarray": "~1.0.0", 257 | "isstream": "~0.1.2", 258 | "json-stringify-safe": "~5.0.1", 259 | "mime-types": "~2.1.19", 260 | "oauth-sign": "~0.9.0", 261 | "performance-now": "^2.1.0", 262 | "qs": "~6.5.2", 263 | "safe-buffer": "^5.1.2", 264 | "tough-cookie": "~2.4.3", 265 | "tunnel-agent": "^0.6.0", 266 | "uuid": "^3.3.2" 267 | } 268 | }, 269 | "safe-buffer": { 270 | "version": "5.2.0", 271 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", 272 | "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" 273 | }, 274 | "safer-buffer": { 275 | "version": "2.1.2", 276 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 277 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 278 | }, 279 | "sshpk": { 280 | "version": "1.16.1", 281 | "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", 282 | "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", 283 | "requires": { 284 | "asn1": "~0.2.3", 285 | "assert-plus": "^1.0.0", 286 | "bcrypt-pbkdf": "^1.0.0", 287 | "dashdash": "^1.12.0", 288 | "ecc-jsbn": "~0.1.1", 289 | "getpass": "^0.1.1", 290 | "jsbn": "~0.1.0", 291 | "safer-buffer": "^2.0.2", 292 | "tweetnacl": "~0.14.0" 293 | } 294 | }, 295 | "tough-cookie": { 296 | "version": "2.4.3", 297 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", 298 | "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", 299 | "requires": { 300 | "psl": "^1.1.24", 301 | "punycode": "^1.4.1" 302 | }, 303 | "dependencies": { 304 | "punycode": { 305 | "version": "1.4.1", 306 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", 307 | "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" 308 | } 309 | } 310 | }, 311 | "tunnel-agent": { 312 | "version": "0.6.0", 313 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 314 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 315 | "requires": { 316 | "safe-buffer": "^5.0.1" 317 | } 318 | }, 319 | "tweetnacl": { 320 | "version": "0.14.5", 321 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", 322 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 323 | }, 324 | "uri-js": { 325 | "version": "4.2.2", 326 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", 327 | "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", 328 | "requires": { 329 | "punycode": "^2.1.0" 330 | } 331 | }, 332 | "uuid": { 333 | "version": "3.3.2", 334 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", 335 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" 336 | }, 337 | "verror": { 338 | "version": "1.10.0", 339 | "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", 340 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 341 | "requires": { 342 | "assert-plus": "^1.0.0", 343 | "core-util-is": "1.0.2", 344 | "extsprintf": "^1.2.0" 345 | } 346 | } 347 | } 348 | } 349 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gitlab2rancher-deploy", 3 | "version": "0.1.3", 4 | "description": "Upgrade a rancher service from a Gitlab CI script", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [ 10 | "gitlab", 11 | "rancher", 12 | "deploy" 13 | ], 14 | "author": "Chris Oloff (http://about.uber5.com/)", 15 | "license": "MIT", 16 | "dependencies": { 17 | "request": "^2.88.0" 18 | }, 19 | "engine": "node >= 5" 20 | } 21 | --------------------------------------------------------------------------------