├── .gitignore ├── .travis.yml ├── static └── icon.png ├── config ├── config.js └── config.html ├── webapp.js ├── .editorconfig ├── README.md ├── .eslintrc ├── worker.js ├── package.json └── lib ├── push.js └── build.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | node_modules/ 3 | *~ 4 | *# 5 | .#* 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "4" 4 | - "node" 5 | -------------------------------------------------------------------------------- /static/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Strider-CD/strider-docker-build/HEAD/static/icon.png -------------------------------------------------------------------------------- /config/config.js: -------------------------------------------------------------------------------- 1 | app.controller('DockerBuildController', ['$scope', function ($scope) { 2 | $scope.$watch('configs[branch.name].docker_build.config', function (value) { 3 | $scope.config = value; 4 | }); 5 | $scope.saving = false; 6 | $scope.save = function () { 7 | $scope.saving = true; 8 | $scope.pluginConfig('docker_build', $scope.config, function () { 9 | $scope.saving = false; 10 | }); 11 | }; 12 | }]); 13 | -------------------------------------------------------------------------------- /webapp.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | // an object that defines the schema for configuration 5 | config: { 6 | runtime: { 7 | type: String, 8 | enum: ['0.6', '0.8', '0.10', '0.11', 'stable', 'latest', 'whatever'], 9 | default: 'whatever' 10 | }, 11 | caching: { 12 | type: String, 13 | enum: ['strict', 'loose', 'none'], 14 | default: 'none' 15 | }, 16 | test: {type: String, default: 'npm test'}, 17 | globals: [{ 18 | type: String 19 | }] 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Strider Editor/IDE Settings 2 | # This file is used to promote consistent source code standards 3 | # amongst all Strider-CD contributors. 4 | # More information can be found here: http://editorconfig.org/ 5 | 6 | # General Settings 7 | root = true 8 | 9 | # Settings for all files 10 | [*] 11 | indent_style = space 12 | indent_size = 2 13 | end_of_line = lf 14 | charset = utf-8 15 | trim_trailing_whitespace = true 16 | insert_final_newline = true 17 | 18 | [*.hbs] 19 | insert_final_newline = false 20 | 21 | [*.{diff,md}] 22 | trim_trailing_whitespace = false 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Strider Docker Build 2 | 3 | Build Docker images with Strider. Uses the standard DOCKER_HOST environment variable. You can also use DOCKER_IP and DOCKER_PORT. 4 | 5 | ## Screenshots 6 | 7 |  8 | 9 |  10 | 11 | 12 | ## Rationale 13 | 14 | You may be producing docker images that are highly custom to your situation. 15 | 16 | You may see no value in uploading these images to the official registry. 17 | 18 | You may need your images to build quickly and cannot wait for the registry to process your automated build. 19 | 20 | You may depend on this image for other projects tested in Strider via [strider-docker-runner](https://github.com/Strider-CD/strider-docker-runner) 21 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parserOptions": { 3 | "ecmaVersion": 6, 4 | "sourceType": "script" 5 | }, 6 | "env": { 7 | "node": true, 8 | "es6": true 9 | }, 10 | "extends": "eslint:recommended", 11 | "rules": { 12 | "indent": [2, 2], 13 | "brace-style": [2, "1tbs"], 14 | "quotes": [2, "single"], 15 | "semi": [2, "always"], 16 | "comma-style": [2, "last"], 17 | "one-var": [2, "never"], 18 | "strict": [2, "global"], 19 | "prefer-template": 2, 20 | "no-console": 0, 21 | "no-use-before-define": [2, "nofunc"], 22 | "no-underscore-dangle": 0, 23 | "no-constant-condition": 0, 24 | "space-before-function-paren": [2, {"anonymous": "always", "named": "never"}], 25 | "func-style": [2, "declaration"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /worker.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const build = require('./lib/build'); 4 | 5 | // Export. 6 | module.exports = { 7 | // Initialize the plugin for a job 8 | // config: taken from DB config extended by flat file config 9 | // job & repo: see strider-runner-core 10 | // cb(err, initialized plugin) 11 | init: function (configuration, job, context, cb) { 12 | 13 | // Get the config (if any.) 14 | var config = configuration || {}; 15 | 16 | // The options to pass to the callback. 17 | var options = {}; 18 | 19 | // Add the build instructions here. 20 | options[config.buildPhase] = build(config); 21 | 22 | // Register the plugin and it's options. 23 | cb(null, options); 24 | }, 25 | 26 | // If provided, autodetect is run if the project has *no* plugin 27 | // configuration at all. 28 | autodetect: { 29 | filename: 'Dockerfile', 30 | exists: true, 31 | language: 'docker', 32 | framework: null 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "strider-docker-build", 3 | "version": "1.1.4", 4 | "description": "Build Docker images in Strider", 5 | "main": "worker.js", 6 | "scripts": { 7 | "lint": "eslint *.js lib", 8 | "test": "npm run lint" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/Strider-CD/strider-docker-build.git" 13 | }, 14 | "keywords": [ 15 | "strider", 16 | "docker" 17 | ], 18 | "engines": { 19 | "node": ">=4.2" 20 | }, 21 | "author": "Keyvan Fatehi", 22 | "license": "MIT", 23 | "strider": { 24 | "id": "docker_build", 25 | "type": "job", 26 | "title": "Docker Build", 27 | "webapp": "webapp.js", 28 | "worker": "worker.js", 29 | "icon": "icon.png", 30 | "config": { 31 | "controller": "DockerBuildController" 32 | } 33 | }, 34 | "dependencies": { 35 | "debug": "^2.2.0", 36 | "dockerode": "^2.0.6", 37 | "json-stream": "^0.2.1", 38 | "tar-fs": "^1.4.1" 39 | }, 40 | "devDependencies": { 41 | "eslint": "^3.2.2" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /config/config.html: -------------------------------------------------------------------------------- 1 |