@ckeditor/ckeditor5-dev-ci 38.3.1 → 38.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/allocate-swap-memory.sh +21 -0
- package/bin/circle-workflow-notifier.js +0 -0
- package/bin/install-latest-chrome.sh +13 -0
- package/bin/notify-circle-status.js +0 -0
- package/bin/notify-travis-status.js +0 -0
- package/lib/data/bots.json +2 -1
- package/lib/format-message.js +21 -16
- package/package.json +4 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
|
+
# For licensing, see LICENSE.md.
|
|
5
|
+
|
|
6
|
+
echo "Allocating swap memory to prevent running out of RAM."
|
|
7
|
+
|
|
8
|
+
# Remove existing swap so that allocating new swap does not throw.
|
|
9
|
+
sudo swapoff -a
|
|
10
|
+
|
|
11
|
+
# Create a 4 gigabyte swapfile.
|
|
12
|
+
sudo fallocate -l 4G /swapfile
|
|
13
|
+
|
|
14
|
+
# Secure the swapfile by restricting access to root.
|
|
15
|
+
sudo chmod 600 /swapfile
|
|
16
|
+
|
|
17
|
+
# Mark the file as a swap space.
|
|
18
|
+
sudo mkswap /swapfile
|
|
19
|
+
|
|
20
|
+
# Enable the swap.
|
|
21
|
+
sudo swapon /swapfile
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
|
+
# For licensing, see LICENSE.md.
|
|
5
|
+
|
|
6
|
+
echo "Installing the latest Chrome."
|
|
7
|
+
|
|
8
|
+
sudo apt-get update
|
|
9
|
+
sudo apt-get install lsb-release libappindicator3-1
|
|
10
|
+
curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
|
|
11
|
+
sudo dpkg -i google-chrome.deb
|
|
12
|
+
sudo sed -i 's|HERE/chrome"|HERE/chrome" --no-sandbox|g' /opt/google/chrome/google-chrome
|
|
13
|
+
rm google-chrome.deb
|
|
File without changes
|
|
File without changes
|
package/lib/data/bots.json
CHANGED
package/lib/format-message.js
CHANGED
|
@@ -8,26 +8,26 @@
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
const fetch = require( 'node-fetch' );
|
|
11
|
-
|
|
12
11
|
const bots = require( './data/bots.json' );
|
|
13
12
|
const members = require( './data/members.json' );
|
|
14
13
|
|
|
15
14
|
const REPOSITORY_REGEXP = /github\.com\/([^/]+)\/([^/]+)/;
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* @param {
|
|
19
|
-
* @param {String}
|
|
20
|
-
* @param {String}
|
|
21
|
-
* @param {String}
|
|
22
|
-
* @param {String}
|
|
23
|
-
* @param {String}
|
|
24
|
-
* @param {String}
|
|
25
|
-
* @param {String}
|
|
26
|
-
* @param {String}
|
|
27
|
-
* @param {String}
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {Number}
|
|
30
|
-
* @param {
|
|
17
|
+
* @param {Object} options
|
|
18
|
+
* @param {String} options.slackMessageUsername
|
|
19
|
+
* @param {String} options.iconUrl
|
|
20
|
+
* @param {String} options.repositoryOwner
|
|
21
|
+
* @param {String} options.repositoryName
|
|
22
|
+
* @param {String} options.branch
|
|
23
|
+
* @param {String} options.buildTitle
|
|
24
|
+
* @param {String} options.buildUrl
|
|
25
|
+
* @param {String} options.buildId
|
|
26
|
+
* @param {String} options.githubToken
|
|
27
|
+
* @param {String} options.triggeringCommitUrl
|
|
28
|
+
* @param {Number} options.startTime
|
|
29
|
+
* @param {Number} options.endTime
|
|
30
|
+
* @param {Boolean} options.shouldHideAuthor
|
|
31
31
|
*/
|
|
32
32
|
module.exports = async function formatMessage( options ) {
|
|
33
33
|
const commitDetails = await getCommitDetails( options.triggeringCommitUrl, options.githubToken );
|
|
@@ -76,17 +76,22 @@ module.exports = async function formatMessage( options ) {
|
|
|
76
76
|
*/
|
|
77
77
|
function getNotifierMessage( options ) {
|
|
78
78
|
const slackAccount = members[ options.githubAccount ] || null;
|
|
79
|
+
const botActionMessage = '_Automated stuff happened on one of the branches. Got time to have a look at it, anyone?_';
|
|
79
80
|
|
|
80
81
|
if ( options.shouldHideAuthor ) {
|
|
81
82
|
return '_The author of the commit was hidden. <https://github.com/ckeditor/ckeditor5/issues/9252|Read more about why.>_';
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
if ( bots.includes( options.githubAccount ) ) {
|
|
85
|
-
return
|
|
86
|
+
return botActionMessage;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
// If the author of the commit could not be obtained, let's ping the entire team.
|
|
89
90
|
if ( !slackAccount ) {
|
|
91
|
+
if ( bots.includes( options.commitAuthor ) ) {
|
|
92
|
+
return botActionMessage;
|
|
93
|
+
}
|
|
94
|
+
|
|
90
95
|
return `<!channel> (${ options.commitAuthor }), could you take a look?`;
|
|
91
96
|
}
|
|
92
97
|
|
|
@@ -142,7 +147,7 @@ function getExecutionTime( startTime, endTime ) {
|
|
|
142
147
|
*/
|
|
143
148
|
function getFormattedMessage( commitMessage, triggeringCommitUrl ) {
|
|
144
149
|
if ( !commitMessage ) {
|
|
145
|
-
return '
|
|
150
|
+
return '_Unavailable._';
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
const [ , repoOwner, repoName ] = triggeringCommitUrl.match( REPOSITORY_REGEXP );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-dev-ci",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.4.0",
|
|
4
4
|
"description": "Utils used on various Continuous Integration services.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"dependencies": {
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"bin": {
|
|
20
20
|
"ckeditor5-dev-ci-notify-travis-status": "bin/notify-travis-status.js",
|
|
21
21
|
"ckeditor5-dev-ci-notify-circle-status": "bin/notify-circle-status.js",
|
|
22
|
-
"ckeditor5-dev-ci-circle-workflow-notifier": "bin/circle-workflow-notifier.js"
|
|
22
|
+
"ckeditor5-dev-ci-circle-workflow-notifier": "bin/circle-workflow-notifier.js",
|
|
23
|
+
"ckeditor5-dev-ci-allocate-swap-memory": "bin/allocate-swap-memory.sh",
|
|
24
|
+
"ckeditor5-dev-ci-install-latest-chrome": "bin/install-latest-chrome.sh"
|
|
23
25
|
},
|
|
24
26
|
"author": "CKSource (http://cksource.com/)",
|
|
25
27
|
"license": "GPL-2.0-or-later",
|