Code Monkey home page Code Monkey logo

gulp-octo's Introduction

⛔️ DEPRECATED This project is no longer maintained, consider using https://github.com/OctopusDeploy/api-client.ts instead

A Gulp wrapper for octopack library to push projects to Octopus Deploy

Install

Install with npm

npm install --save-dev @octopusdeploy/gulp-octo

API

octo.pack(type, options)

type

Optional parameter to define the package type. Valid values are targz, tar or zip. If not provided this defaults to targz.

options.id

Defines the Id component of the created package. By default it will extract the name out of package.json if present.

options.version

Defines the version component of the created package. By default it will extract the version out of package.json if present.

octo.push(options)

options.host

Required property that points to the Octopus Server instance the package should be pushed to. Note that this is not the full path of the package upload url, but just the root url of the server instance. The approprate path will be appended within in the push module.

options.replace

Flag to force overwrite of existing package if one already exists with the same ID and version.

options.apiKey

Key linked to account with BuiltInFeedPush permissions. If options.replace is set to true and a package with the same ID and version already exists then the BuiltInFeedAdminister permission is required.

Usage Examples

Simple Pack

In this example, the default options are used to create a package and save to the bin directory.

var gulp = require('gulp');
var octopack = require('@octopusdeploy/gulp-octo').pack;

// Simple package into bin directory
gulp.task('pack', function() {
    gulp.src(['**/*', '!src/**/*', '!bin/**/*','!./gulpfile.js'])
        .pipe(octopack())
		.pipe(gulp.dest('./bin'));
});

Simple Push

In this example, the default options are used to push a package that is generated from some other process. This example provide the minimum configuration options required to perform the push.

var gulp = require('gulp');
var octopush = require('@octopusdeploy/gulp-octo').push;

// Simple publish with existing package
gulp.task('publish', function() {
    gulp.src('./bin/myproject.1.1.0.tar')
        .pipe(octopush({host: 'http://octopus-server/', apiKey: 'API-XXXXXXXXX'}));
});

Pack & Push

In this example, the project files are first packaged up into a .tar.gz file which is then piped directly to the push module.

var octo = require('@octopusdeploy/gulp-octo');

gulp.task('publish', function() {
	return gulp.src(['**/*', '!src/**/*', '!./gulpfile.js'])
			.pipe(octo.pack('tar.gz'))
			.pipe(octo.push({host: 'http://octopus-server/', apiKey: 'API-XXXXXXXXX'}));
});

Tests

npm test

License

(MIT License)

Copyright (c) 2015 Octopus Deploy [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

gulp-octo's People

Contributors

johnsimons avatar kria avatar micsco avatar paulstovell avatar shaunmarx avatar zentron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulp-octo's Issues

Package is always written to current working directory

Somebody on StackOverflow had a problem when trying to do what the documentation calls a simple pack.

Basically no matter what is put in gulp.dest() the created package is always written to the current working directory.

I looked at the code and came up with the following explanation:

It's a bug in gulp-octo. In this line they set the path of the generated archive. Unfortunately they just use the filename of the archive instead of a full path (which is what they're supposed to do), so the file is always written relative to the current working directory.

nupkg Support

when packing using nupkg I get the following error despite the document stating support for this format:

[11:19:26] Error: Currently unable to support .nupkg file. Please use .tar.gz or .zip at formatError (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\gulp\bin\gulp.js:169:10) at Gulp.<anonymous> (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\gulp\bin\gulp.js:195:15) at emitOne (events.js:96:13) at Gulp.emit (events.js:188:7) at Gulp.Orchestrator._emitTaskDone (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\orchestrator\index.js:264:8) at D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\orchestrator\index.js:275:23 at finish (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\orchestrator\lib\runTask.js:21:8) at module.exports (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\orchestrator\lib\runTask.js:36:10) at Gulp.Orchestrator._runTask (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\orchestrator\index.js:273:3) at Gulp.Orchestrator._runStep (D:\Desktop\Development Area\ProtoTypes\OctopackApp\octofxjs\node_modules\orchestrator\index.js:214:10)

this is using Gulp
gulp.task('publish', ['bump', 'build'], function () { return gulp.src(['**/*', '!bin{,/**}', '!src{,/**}', '!gulpfile.js']) .pipe(octo.pack('nupkg')) .pipe(octo.push({apiKey: 'API-##removed##', host: '##removed##'})); });

This is using the demo app: octofxjs

The uploaded file isn't a valid NuGet package

Hello guys,

I'm trying use gulp-octo to pack and push my node.js site to octopus but with error:
I'm also following this docs:
http://docs.octopusdeploy.com/pages/viewpage.action?pageId=3049551

"The uploaded file isn't a valid NuGet package. (400)"

I have also a log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'publish' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prepublish', 'publish', 'postpublish' ]
5 info prepublish [email protected]
6 info publish [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec publish script
9 verbose stack Error: [email protected] publish: node ./node_modules/gulp/bin/gulp.js publish
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:818:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd C:\Users\rafaelpa\Desktop\octofxjs
12 error Windows_NT 10.0.10240
13 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "publish"
14 error node v4.2.2
15 error npm v2.14.7
16 error code ELIFECYCLE
17 error [email protected] publish: node ./node_modules/gulp/bin/gulp.js publish
17 error Exit status 1
18 error Failed at the [email protected] publish script 'node ./node_modules/gulp/bin/gulp.js publish'.
18 error This is most likely a problem with the octofxjs package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node ./node_modules/gulp/bin/gulp.js publish
18 error You can get their info via:
18 error npm owner ls octofxjs
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

Is expected that gulp-octo wrapper my files as a Nuget package ?
Thanks

Add to npm

Is there any chance you could do an npm publish so it is available via npm as it doesnt seem to be there currently.

You probably want to change the name to just gulp-octo not @octopusdeploy/gulp-octo as its pretty verbose when including it and does not really follow the normal npm convention.

== Update ==

Sorry turns out it is on there but its with the fully qualified name including scope, which I would still say is a little ghastly and could be shortened to just be available without the explicit scoping.

subfolder path bug?

I'm having an issue getting pack to work when gulp.src is a subfolder instead of the project root.

The relevant bits of my app structure look like this:

  • /root
    • /package
      • /fonts
      • /js
      • index.html
    • /src
      • /app
        • /stuff1
        • /stuff2
      • /fonts
      • index.html
    • gulpfile.js

For development purposes, I work on the files in the src folder. My gulp file minifies, concats, cache-busts, etc., everything in src and puts it all into the package folder, with the above structure. This is all pretty standard stuff, and the contents of the /package folder are what I want to pack and publish.

However, when this task runs (with root as the cwd):

gulp.src('./package/**/*')
.pipe(octo.pack())
.pipe(octo.push(...));

I get:

...
Packed 'my-project.1.0.13.zip' with 49 files
D:\git\root\node_modules@octopusdeploy\octopackjs\lib\pack.js:26
throw err;
^

Error: ENOENT: no such file or directory, stat 'D:\git\root\fonts'

This is very true. There is no such file or directory. But I haven't asked octo to do anything with such a directory. I've tried several variations on the glob, all with no results. It seems like pack has a path bug somewhere.

Can't properly link in folders content in pack()

When trying to pass in the content of a folder using Gulp's classical SRC syntax :

return gulp.src("./bin/**", {"base": "./bin/"})
    .pipe(octo.pack('zip'))

enven providing a "base" and/or "cwd" to it, gulp-octo will always use the root of the project as the basedir, therefore, if ./bin/assets exists, it will look for ./assets/ and output an error.

Npm audit reports Prototype Pollution vulnerability

The vulnerability is introduced because of dependency on @octopusdeploy/[email protected] which in turn depends on [email protected]

partial output of npm audit:

Patched in      >=4.17.5
Dependency of   @octopusdeploy/gulp-octo [dev]
Path            @octopusdeploy/gulp-octo > @octopusdeploy/octopackjs >
                  zip-stream > archiver-utils > lodash

Snyk report:
https://snyk.io/test/npm/@octopusdeploy/gulp-octo

As snyk suggests, the remedy would be to upgrade @octopusdeploy/octopackjs dependency to version 0.1.0.

ArgumentException String is not a valid semantic version

Hello,
I'm getting this error wher trying to install gulp-octo. Am I missing something?

npm install @octopusdeploy/gulp-octo
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "@octopusdeploy/gulp-octo"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code E500

npm ERR! ArgumentException String is not a valid semantic version.: @octopusdeploy/gulp-octo
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.