Skip to content
Snippets Groups Projects
Commit 5344bcf7 authored by Toni Haapanen's avatar Toni Haapanen Committed by Kalle Vuorjoki
Browse files

Issue #3469365 by tonihoo: Add Gitlab CI

parent f8844d5b
No related branches found
No related tags found
1 merge request!2Issue 3469365: Add template file
Pipeline #260068 passed with warnings
logstream
addmore
################
# GitLabCI template for Drupal projects.
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification.
# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your
# pipelines automatically. However, you can modify this template if you have additional needs for your project.
# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/
################
# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/
# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- "/includes/include.drupalci.main.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
################
# Pipeline configuration variables are defined with default values and descriptions in the file
# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
# Uncomment the lines below if you want to override any of the variables. The following is just an example.
################
# variables:
# SKIP_ESLINT: '1'
# OPT_IN_TEST_NEXT_MAJOR: '1'
# _CURL_TEMPLATES_REF: 'main'
......@@ -41,17 +41,17 @@
const element = once("builder", "#builder-output", context);
if (element.length) {
fetch(endpoint).then(response => {
fetch(endpoint).then((response) => {
const reader = response.body.getReader();
// Clear previous output.
element[0].textContent = "";
return readStream(reader, chunk => {
return readStream(reader, (chunk) => {
element[0].textContent += chunk;
});
});
}
}
},
};
})(once, Drupal, drupalSettings);
......@@ -11,7 +11,7 @@
* @return {Element}
*/
function htmlToElement(html) {
var template = document.createElement('template');
const template = document.createElement("template");
html = html.trim(); // Never return a text node of whitespace as the result
template.innerHTML = html;
return template.content.firstChild;
......@@ -27,30 +27,34 @@
*/
Drupal.behaviors.oeBuilderToolbar = {
attach(context) {
once("builder", "[data-toolbar-builder]", context).forEach(el => {
once("builder", "[data-toolbar-builder]", context).forEach((el) => {
const url = el.href;
el.addEventListener('click', event => {
el.addEventListener("click", (event) => {
event.preventDefault();
const progressIndicator = htmlToElement(Drupal.theme.ajaxProgressIndicatorFullscreen());
const progressIndicator = htmlToElement(
Drupal.theme.ajaxProgressIndicatorFullscreen(),
);
document.body.after(progressIndicator);
fetch(url, {
method: 'POST',
method: "POST",
headers: {
'Content-Type': 'application/json'
"Content-Type": "application/json",
},
}).then(() => {
console.log("Build started");
})
.then(() => {
console.log("Build started");
// Redirect to logs
window.location.href = url;
}).catch(() => {
progressIndicator.remove();
});
})
})
}
// Redirect to logs
window.location.href = url;
})
.catch(() => {
progressIndicator.remove();
});
});
});
},
};
})(once, Drupal);
......@@ -17,7 +17,7 @@ class BuildLogStream implements BuildLogStreamInterface {
protected $response;
/**
* Construct the BulidLogStream object.
* Construct the BuildLogStream object.
*
* @param \Psr\Http\Message\ResponseInterface|null $response
* Response from build daemon log request.
......
......@@ -63,7 +63,7 @@ class BuildSettingsForm extends ConfigFormBase {
'#title' => $this->t('Stage name'),
];
// Retrive previously saved value.
// Retrieve previously saved value.
if (array_key_exists($i, $saved_stages)) {
$form['stages_fieldset']['stage'][$i]['#default_value'] = $saved_stages[$i];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment