Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Strider Editor/IDE Settings
# This file is used to promote consistent source code standards
# amongst all Strider-CD contributors.
# More information can be found here: http://editorconfig.org/

# General Settings
root = true

# Settings for all files
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.hbs]
insert_final_newline = false

[*.{diff,md}]
trim_trailing_whitespace = false
27 changes: 27 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script"
},
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [2, 2],
"brace-style": [2, "1tbs"],
"quotes": [2, "single"],
"semi": [2, "always"],
"comma-style": [2, "last"],
"one-var": [2, "never"],
"strict": [2, "global"],
"prefer-template": 2,
"no-console": 0,
"no-use-before-define": [2, "nofunc"],
"no-underscore-dangle": 0,
"no-constant-condition": 0,
"space-before-function-paren": [2, {"anonymous": "always", "named": "never"}],
"func-style": [2, "declaration"]
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
*~
.DS_Store
npm-debug.log
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "4"
- "node"
81 changes: 81 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
'use strict';

// tests if the repository is available / online
//
// optional: check the current version vs. the github version
// to activate the check set versionCheck in line 14 to true


const yaml = require('js-yaml');
const fs = require('fs');
const request = require('request');
const log = require('console-emoji');

const fileName = 'test.yml'; // <= change to plugins.yml before going life
const selector = 'repo';
const versionCheck = true; // <= optional: check for version changes
const vselector = 'tag';
const gitRaw = 'https://raw.githubusercontent.com';
const branch = 'master';

let error = 0;

const doc = yaml.safeLoad(fs.readFileSync(fileName, 'utf8'));
const modules = Object.getOwnPropertyNames(doc);
for (let x = 0, len = modules.length; x < len; x++) {
let link = doc[modules[x]][selector];
let semver = doc[modules[x]][vselector];

// in case you want to check if the other keys
// have values here would be the place to be :)

if (link !== 'undefined') {
request(link, {method: 'HEAD'}, (err, res) => {
if (err) {
throw new Error(err);
}
if (res.statusCode === 200) {
log(modules[x], 'ok');

// check for version changes (optional)
let search = 'github.com/';
let tmp = link.substring(link.indexOf(search) + search.length);

// currently only check if its a github link
let isGitUrl = link.includes(search);

if (versionCheck && isGitUrl) {
if (tmp.lastIndexOf('.git')) {
let part = tmp.substring(0, tmp.length - 4);
let cut = part.indexOf('/');

// Username / Repository maybe useful for later tests ...
let user = part.substr(0, cut);
let repo = part.substr(cut + 1);
let pkgUrl = `${gitRaw}/${user}/${repo}/${branch}/package.json`;

request(pkgUrl, {method: 'GET'}, (err, res, body) => {
if (err) {
throw new Error(err);
}
if (res.statusCode === 200) {
const pkg = JSON.parse(body);
if (semver !== pkg.version) {
log(`Version changed for ${ modules[x] } ${ semver } => ${ pkg.version}`, 'warn');
}
}
});
}
}

} else {
log(modules[x], 'err');
error = 1;
}
}
);
}
}

// return 0 when no dead links found
return error;
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "ecosystem-index",
"version": "2.2.3",
"description": "This repository contains an index strider plugins for consumption by Strider via [strider-ecosystem-client](https://github.com/Strider-CD/ecosystem-client)",
"main": "index.js",
"scripts": {
"test": "npm run lint && node .",
"lint": "eslint index.js",
"start": "node ."
},
"repository": {
"type": "git",
"url": "git+https://github.com/Strider-CD/ecosystem-index.git"
},
"keywords": [
"git",
"strider"
],
"author": "Maik Ellerbrock <opensource@frapsoft.com> (https://github.com/ellerbrock)",
"license": "MIT",
"bugs": {
"url": "https://github.com/Strider-CD/ecosystem-index/issues"
},
"homepage": "https://github.com/Strider-CD/ecosystem-index#readme",
"dependencies": {
"console-emoji": "^0.0.2",
"js-yaml": "^3.7.0",
"request": "^2.79.0"
}
}
8 changes: 0 additions & 8 deletions plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ heroku:
name: Heroku
type: job

hg:
description: basic mercurial provider
tag: 0.2.3
repo: https://github.com/Mixaill/strider-hg
module_name: strider-hg
name: Mercurial
type: provider

metadata:
description: expose job metadata as environment variables
tag: 0.0.3
Expand Down
208 changes: 208 additions & 0 deletions test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
---
aws_codedeploy:
description: integrate AWS CodeDeploy
tag: 0.1.6
repo: https://github.com/flxbe/strider-aws-codedeploy.git
module_name: strider-aws-codedeploy
name: AWS CodeDeploy
type: job

bitbucket:
description: bitbucket git provider
tag: 1.4.3
repo: https://github.com/Strider-CD/strider-bitbucket
module_name: strider-bitbucket
name: Bitbucket
type: provider

bower:
description: Bower install and caching plugin
tag: 0.1.6
repo: https://github.com/Strider-CD/strider-bower
module_name: strider-bower
name: Bower
type: job

custom:
description: custom scripts
tag: 1.0.0
repo: https://github.com/Strider-CD/strider-custom
module_name: strider-custom
name: Custom
type: job

docker_build:
description: build Docker images
tag: 1.2.0
repo: https://github.com/Strider-CD/strider-docker-build
module_name: strider-docker-build
name: Docker Build
type: job

docker:
description: run jobs inside Docker
tag: 1.5.2
repo: https://github.com/Strider-CD/strider-docker-runner
module_name: strider-docker-runner
name: Docker Runner
type: runner

dot-net:
description: run .NET builds
tag: 0.4.0
repo: https://github.com/Strider-CD/strider-dot-net
module_name: strider-dot-net
name: .NET
type: job

emailnotifier:
description: send email notifications
tag: 1.0.0
repo: https://github.com/Strider-CD/strider-email-notifier
module_name: strider-email-notifier
name: Email Notifier
type: job

env:
description: set custom environment variables
tag: 0.5.1
repo: https://github.com/Strider-CD/strider-env
module_name: strider-env
name: Environment Variables
type: job

git:
description: basic git provider
tag: 0.2.6
repo: https://github.com/Strider-CD/strider-git
module_name: strider-git
name: Git
type: provider

xxx:
description: xxx git provider
tag: 2.3.3
repo: https://github.com/Strider-CD/strider-xxx
module_name: strider-xxx
name: xxx
type: provider

gitlab:
description: gitlab git provider
tag: 1.2.6
repo: https://github.com/Strider-CD/strider-gitlab
module_name: strider-gitlab
name: Gitlab
type: provider

heroku:
description: heroku deployment
tag: 0.1.2
repo: https://github.com/Strider-CD/strider-heroku
module_name: strider-heroku
name: Heroku
type: job

metadata:
description: expose job metadata as environment variables
tag: 0.0.3
repo: https://github.com/Strider-CD/strider-metadata
module_name: strider-metadata
name: Metadata
type: job

node:
description: run node.js tests
tag: 1.0.2
repo: https://github.com/Strider-CD/strider-node
module_name: strider-node
name: Node
type: job

python:
description: run python tests
tag: 0.2.3
repo: https://github.com/Strider-CD/strider-python
module_name: strider-python
name: Python
type: job

ruby:
description: run ruby tests
tag: 0.0.5
repo: https://github.com/Strider-CD/strider-ruby
module_name: strider-ruby
name: Ruby
type: job

sauce:
description: selenium tests in the cloud
tag: 0.6.3
repo: https://github.com/Strider-CD/strider-sauce
module_name: strider-sauce
name: Sauce Labs
type: job

xxx-runner:
description: in-process job runner
tag: 1.0.1
repo: https://github.com/Strider-CD/strider-xxx-runner
module_name: strider-xxx-runner
name: xxx Runner
type: runner

slack:
description: Slack notifications
tag: 2.0.1
repo: https://github.com/Strider-CD/strider-slack
module_name: strider-slack
name: Slack
type: job

ssh_deploy:
description: ssh deployment
tag: 1.0.0
repo: https://github.com/Strider-CD/strider-ssh-deploy
module_name: strider-ssh-deploy
name: SSH Deploy
type: job

status-report:
description: summary data api
tag: 0.0.2
repo: https://github.com/Strider-CD/strider-status-report
module_name: strider-status-report
name: Status Report
type: job

webhooks:
description: fire build status webhooks
tag: 0.1.4
repo: https://github.com/Strider-CD/strider-webhooks
module_name: strider-webhooks
name: Web Hooks
type: job

buildbadge:
description: build status badges
tag: 0.1.0
repo: https://github.com/Strider-CD/strider-build-badge
module_name: strider-build-badge
name: Build Badge
type: basic

artifact-repository:
description: save and expose artifacts built by strider
tag: 1.0.0
repo: https://github.com/tbouron/strider-artifact-repository
module_name: strider-artifact-repository
name: Artifact Repository
type: job

foodcritic:
description: Check your Chef cookbooks for common problems
tag: 1.0.1
repo: https://github.com/logankoester/strider-foodcritic
module_name: strider-foodcritic
name: Foodcritic
type: job
Loading