Gitlab EE including NodeJS and a framework for incorporating Git server hooks written in NodeJS.
87
Gitlab Enterprise Edition including the NodeJS runtime and a framework for incorporating Git server hooks written in NodeJS. To include additional hooks simply add a JavaScript module, known as a performer, to the application/main/performers directory. Of course, it would also be preferred if you added a corresponding test to the application/test/performers directory :-)
The following section describes the contract that all performers must adhere to.
const simpleGit = require('simple-git');
const yaml = require('yaml');
const git = simpleGit();
module.exports.perform = (refname, oldrev, newrev) => {
return git.catFile(['blob', `${newrev}:.gitlab-ci.yml`]).then((contents) => {
const gitlabCiFile = yaml.parse(contents);
for (const [key] of Object.entries(gitlabCiFile)) {
if (gitlabCiFile[key]['tags'] && gitlabCiFile[key]['tags'].includes('production')) {
if (!gitlabCiFile[key]['only'] ||
gitlabCiFile[key]['only'].length > 1 ||
gitlabCiFile[key]['only'][0] !== 'production') {
throw new Error('GL-HOOK-ERR: Only the production branch can target the production Gitlab runner.');
}
}
}
return true;
});
};
Content type
Image
Digest
Size
944.3 MB
Last updated
about 6 years ago
docker pull salte/gitlab-ee:13.2.1-ee.0