{"id":23333931,"url":"https://github.com/schultyy/ci.js","last_synced_at":"2025-04-07T12:13:43.342Z","repository":{"id":7619384,"uuid":"8978391","full_name":"schultyy/ci.js","owner":"schultyy","description":"My custom continuous integration server","archived":false,"fork":false,"pushed_at":"2013-04-10T16:36:16.000Z","size":259,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T23:35:28.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schultyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-23T23:18:21.000Z","updated_at":"2013-05-07T18:40:12.000Z","dependencies_parsed_at":"2022-09-05T04:50:26.625Z","dependency_job_id":null,"html_url":"https://github.com/schultyy/ci.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fci.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fci.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fci.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schultyy%2Fci.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schultyy","download_url":"https://codeload.github.com/schultyy/ci.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648976,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-21T00:32:57.703Z","updated_at":"2025-04-07T12:13:43.322Z","avatar_url":"https://github.com/schultyy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ci.js\nThis is a very very basic continuous integration server written in JavaScript. This runs on node.js.\n\n## How does it work?\nIt comes up with a basic http server that provides a web page where you can see the 10 latest build results. \nIn background, every n minutes a new build starts. After the build finished, a build result log file is written and \ncan be viewed on the web page.\nThe build server gets its work via a task file, which is plain JavaScript.\n\n## Configuration\nYou need to place a file called 'options.json' in the same directory where main.js exists. The options file must contain\nthe following parts:\n```JavaScript\n{\n    \"buildResultsFolder\" : \"/home/foo/bar/BuildResults\",\n    \"port\" : 8080,\n    \"host\" : \"127.0.0.1\",\n    \"buildInterval\" : 15\n}\n```\n\nNote that buildInterval expresses the interval in minutes. The build results folder must exist, ci.js does not create it.\n## Usage\n```Bash\n$ node main.js tasks.js\n```\n\n## Task file\nA task file must export a function that is called getTasks. getTasks returns one task, that calls other tasks via \ncallbacks when it is finished. A task must have a run method. This will be called by ci.js. \n(Disclaimer: I need this to build my .Net software. So the example below contains Windows paths and calls to MSBuild.)\nThis is an example task file:\n```JavaScript\n\nvar child_process = require(\"child_process\");\nvar fs = require(\"fs\");\n\nexports.getTasks = function(options){\n\n    //At the moment, options contains a finshed callback and a logger\n\n    var finishedCallback = options.finished;\n    \n    /*\n        Available methods:\n        error(name, msg)\n        info(name, msg)\n    */\n    var logger = options.logger;\n\n    var checkout = new checkoutTask();\n    var buildTask = new buildTask();\n    \n    checkout.callback = buildTask;\n    \n    //Notify ci.js when build is finished\n    buildTask.callback = {\n        this.run = finishedCallback;\n        this.callback = undefined;\n    };\n    return {\n        name            : \"Your project\",\n        projectPath     : \"C:\\\\Temp\\\\\",\n        tasks           : checkout\n    };\n}\n\nfunction checkoutTask(logger){\n    this.logger = logger;\n    this.callback = undefined;\n    this.run = function(){    \n        console.log(\"checkout\");\n        \n        var workingDirectory = 'C:\\\\temp\\\\';\n\n        var self = this;\n            \n        child_process.exec('\"C:\\\\Program Files (x86)\\\\Git\\\\bin\\\\sh.exe\" --login -i -c \"git clone \u003cyour project\u003e\"', \n        {'cwd' : workingDirectory}, function(error, stdout, stderr){\n            if(stdout){\n                self.logger.info(\"checkout\", stdout);\n            }\n            if(stderr){\n                self.logger.error(\"checkout\", stderr);\n            }\n            if(error){\n                self.logger.error(\"checkout\", error.signal);\n                self.logger.error(\"checkout\", error.code);\n                return;\n            }\n            if(self.callback){\n                self.callback.run();\n            }\n        });\n    };\n}\n\nfunction buildTask(logger){\n    this.callback = undefined;\n    this.logger = logger;\n    this.run = function(){\n    \n        console.log(\"build\");\n    \n        var solutionFile = \"C:\\\\temp\\\\\u003cyour project\u003e\\\\\u003cyour solution\u003e.sln\";\n        \n        var self = this;\n        \n        child_process.exec('cmd.exe /s /c \"C:\\\\Windows\\\\Microsoft.NET\\\\Framework64\\\\v4.0.30319\\\\MSBuild.exe /p:Configuration=Release ' + solutionFile + '\"', \n            function(error, stdout, stderr){\n                if(stdout){\n                    self.logger.info(\"build\", stdout);\n                }\n                if(stderr){\n                    self.logger.error(\"build\", stderr);\n                }\n                if(error){\n                    self.logger.error(\"build\", \"Signal: \" + error.signal + \" / Code: \" + error.code);\n                    return;\n                }\n                \n                if(self.callback){\n                    self.callback.run();\n                }\n        });\n    };\n}\n```\n\n# Dependencies\n* bootstrap\n* JQuery 1.9.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultyy%2Fci.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschultyy%2Fci.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschultyy%2Fci.js/lists"}