Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

Proposal: Artifact Plugin #529

Closed kfatehi closed 9 years ago

kfatehi commented 10 years ago

this issue stubs an idea i would like to pursue later--feedback welcome.

drone.io has this concept of an artifact which is any derivative file/archive/etc created during CI. you can create artifacts by giving writing some filepaths in a textarea (very janky and unintuitive, we aim to do much better). these paths are then saved and made available for download in the web interface.

in strider i would like this feature, primarily for hosting documentation generated during the test process. e.g. api docs a la supersamples

one key requirement to keep in mind as we continue developing plugins is that the plugin should be designed in such a way that it works both inside of a docker runner or not... however we should not compromise ease of use in striving to attain this goal.

more to come later once i need this feature more badly

kfatehi commented 10 years ago

Right now I'm doing "artifacty" stuff in Cleanup phase:

if [[ -f docs/coverage/lcov.info ]]; then
    codeclimate < docs/coverage/lcov.info
else
    echo "No coverage info to send"
fi

I wonder if there's a better place to put this and similar "custom steps" like generating artifacts sort of would be. The word artifact seems purposely generic to the point where maybe if we add an additional scripted step (or a way to add n number scripted steps) would be the right move to solving this. If we do this approach then we don't need an artifact plugin, per se. Although I can still see such a plugin as providing a very simple API to push to and pull from (and host static html/js such as documentation sites from)

kfatehi commented 10 years ago

If you look at this https://strider.knban.com/strider-cd/strider/job/53fc59077f9310ba1600051e you'll see a test has failed and has dumped some important files out for us (specifically, a screenshot) -- but without a way to harvest artifacts, we are unable to examine these.

jaredly commented 10 years ago

yeah, seems like a good idea. What do you propose be the configuration?

One possibility is to specify the paths of artifacts in config, and then have a widget on the build page with links to the artifacts letting you to DL them.

tbouron commented 9 years ago

Hi there.

I discovered Strider only recently and I had to need to save artifacts (which in my case was the final zip generated by a grunt process) onto a MongoDB (because running on heroku) and expose them. So I created a job plugin that:

Now, I didn't get everything sorted like how to generate proper logs for the web console, how to get the the API URLs working without the anon (I'm using app.anon.get() for now) etc. If you could give me a hand on that, I'll appreciate it.

I'll commit the first version tomorrow, the time to clean and tide up a bit the code. Hope it will meet you requirements.

tbouron commented 9 years ago

Forgot to ask but is there a way to hook the job UI to add another action icon, right beside the others (test, test and deploy, configuration) ?

kfatehi commented 9 years ago

Nice! Looking forward to reading the code. On Sat, Nov 29, 2014 at 12:43 AM Thomas Bouron notifications@github.com wrote:

Forgot to ask but is there a way to hook the job UI to add another action icon, right beside the others (test, test and deploy, configuration) ?

— Reply to this email directly or view it on GitHub https://github.com/Strider-CD/strider/issues/529#issuecomment-64934926.

kfatehi commented 9 years ago

There's a way, I just don't know it yet. @knownasilya or @jaredly may know. On Sat, Nov 29, 2014 at 1:39 AM Keyvan Fatehi keyvanfatehi@gmail.com wrote:

Nice! Looking forward to reading the code. On Sat, Nov 29, 2014 at 12:43 AM Thomas Bouron notifications@github.com wrote:

Forgot to ask but is there a way to hook the job UI to add another action icon, right beside the others (test, test and deploy, configuration) ?

— Reply to this email directly or view it on GitHub https://github.com/Strider-CD/strider/issues/529#issuecomment-64934926.

knownasilya commented 9 years ago

From working with the code around those areas, it seems like that's pretty hard-coded at the moment. So no there is no way as of yet.

It would require some UI work as well, since we don't want a dozen icons going from left to right, would be a mess. We need an actions dropdown or something. Maybe a primary and secondary actions.

tbouron commented 9 years ago

Well, a dropdown for secondary actions could be a good solution in my opinion.

Anyway, here is the plugin: https://github.com/tbouron/strider-artifact-repository. As I said, there is clearly room for improvements and it's not tested yet (as in unit tests). So comments and pull requests are more than welcome here :)

tbouron commented 9 years ago

I just updated the plugin which now support the deletion of old artifacts (base on the configuration) and the display of log and error directly into the UI shell. The exposed API URLs are now protected and accessible only for logged users.

It remains none tested but I'm on it from now on.

tbouron commented 9 years ago

Hi!

I just published the version 1.0.0 of the artifact-repository plugin. It's available now through npm: https://www.npmjs.com/package/strider-artifact-repository

Is there any else I can do to make the plugin available for all strider user?

Cheers!

kfatehi commented 9 years ago

@tbouron I see you have tagged the version correctly (1.0.0) in your git repository. The next step is to get it to show up in the Plugin Management interface so everyone with Strider 1.6.x+ can see it and download/update easily. In order for this to work you need to create an entry in https://github.com/Strider-CD/ecosystem-index/blob/master/plugins.yml like so, just PR and we'll merge it.

artifact-repository:
  description: Save and exposes artifacts built by strider CI
  tag: 1.0.0
  repo: https://github.com/tbouron/strider-artifact-repository
  module_name: strider-artifact-repository
  type: job

Also let me know if you're interested in joining @Strider-CD/owners and transferring the repo here.

kfatehi commented 9 years ago

I just documented how to add a plugin to the index, in case you want to take a look: https://github.com/Strider-CD/ecosystem-index#anatomy-of-plugin-entry

tbouron commented 9 years ago

@keyvanfatehi Great! I submitted my PR few minutes ago (already accepted). About joining @Strider-CD/owners and transferring the repo there, is it easier for you if I do so?

kfatehi commented 9 years ago

@tbouron it's entirely up to you. it's not really necessary since we don't use NPM for plugins anymore (we use the plugin index so that we can always fork plugins and redirect downloads/updates to our fork in the event that the plugin author abandons it), but we extend an invite to folks who write good plugins in case they want to organize/maintain their plugin repo(s) here. let me know anytime :)

tbouron commented 9 years ago

Thanks for the invite, I appreciate it. That might be a good option indeed. I'll think about it and let you know :)