forked from ILIAS-eLearning/ILIAS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into _9/UI/DataTable-Mobile
- Loading branch information
Showing
1,256 changed files
with
54,555 additions
and
61,809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,59 @@ | ||
{ | ||
"extends": "airbnb-base", | ||
"parserOptions": { | ||
"ecmaVersion": 6 | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"extends": "airbnb-base" | ||
} | ||
// allow certain globals to be used without declaration. | ||
"globals": { | ||
// globals from the browser environment. | ||
"document": "readonly", | ||
"window": "readonly", | ||
"il": "writable", | ||
// globals from the mocha testing framework. | ||
"beforeEach": "readonly", | ||
"afterEach": "readonly", | ||
"describe": "readonly", | ||
"before": "readonly", | ||
"after": "readonly", | ||
"it": "readonly" | ||
}, | ||
// minified and bundled scripts are exempt from the | ||
// code-style. | ||
"ignorePatterns": [ | ||
"**/dist/*", | ||
"*.min.js" | ||
], | ||
"rules": { | ||
// allow function hoisting as javascript code is | ||
// compiled before execution. | ||
"no-use-before-define": [ | ||
"error", | ||
"nofunc" | ||
], | ||
// enforce camelcase for classes as well. | ||
"camelcase": [ | ||
"error", | ||
{ | ||
"properties": "always", | ||
"ignoreDestructuring": false, | ||
"ignoreGlobals": false | ||
} | ||
], | ||
// allow anonymous functions for iife's and mocha.js. | ||
"func-names": [ | ||
"warn", | ||
"never" | ||
], | ||
// allow unresolved imports due to module-bundling | ||
// and third-party libraries. | ||
"import/no-unresolved": 0, | ||
// allow import of devDependencies in test files. | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build and deploy style files | ||
on: | ||
push: | ||
branches: | ||
- "trunk" | ||
|
||
jobs: | ||
style-to-repo: | ||
if: | | ||
github.event.pull_request.merged == true || | ||
github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
all: ${{ steps.changes.outputs.all }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: build and deploy | ||
run: CI/Style-To-Repo/build-and-deploy.sh | ||
env: | ||
STYLE_REPO_PUSH_SECRET: ${{ secrets.STYLE_REPO_PUSH_SECRET }} | ||
STYLE_REPO_USER_NAME: ${{ vars.STYLE_REPO_USER_NAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"require": [ | ||
"@babel/register" | ||
], | ||
"spec": [ | ||
"tests" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
* @author Thibeau Fuhrer <[email protected]> | ||
*/ | ||
|
||
/** | ||
* @type {string} | ||
*/ | ||
const copyright = '/**\n' | ||
+ ' * This file is part of ILIAS, a powerful learning management system\n' | ||
+ ' * published by ILIAS open source e-Learning e.V.\n' | ||
+ ' *\n' | ||
+ ' * ILIAS is licensed with the GPL-3.0,\n' | ||
+ ' * see https://www.gnu.org/licenses/gpl-3.0.en.html\n' | ||
+ ' * You should have received a copy of said license along with the\n' | ||
+ ' * source code, too.\n' | ||
+ ' *\n' | ||
+ " * If this is not the case or you just want to try ILIAS, you'll find\n" | ||
+ ' * us at:\n' | ||
+ ' * https://www.ilias.de\n' | ||
+ ' * https://github.com/ILIAS-eLearning\n' | ||
+ ' */'; | ||
|
||
export default copyright; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* This file is part of ILIAS, a powerful learning management system | ||
* published by ILIAS open source e-Learning e.V. | ||
* | ||
* ILIAS is licensed with the GPL-3.0, | ||
* see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
* You should have received a copy of said license along with the | ||
* source code, too. | ||
* | ||
* If this is not the case or you just want to try ILIAS, you'll find | ||
* us at: | ||
* https://www.ilias.de | ||
* https://github.com/ILIAS-eLearning | ||
* | ||
* @author Thibeau Fuhrer <[email protected]> | ||
*/ | ||
|
||
/** | ||
* Function used by '@rollup/plugin-terser' to preserve only comments which | ||
* contain a string indicating a copyright notice. | ||
* | ||
* Additionally, it only keeps ILIAS copyright notices if they are at the beginning | ||
* of a file, so that the license is not duplicated in the bundled file (this works | ||
* due to plugins being ran after the bundle is created). | ||
* | ||
* @param {Object} node | ||
* @param {number} line | ||
* @param {string} value | ||
* @return {boolean} | ||
*/ | ||
export default function preserveCopyright(node, { line, value }) { | ||
const copyrightRegex = /(copyright|license|@preserve|@license|@cc_on)/i; | ||
const iliasRegex = /(ilias)/i; | ||
|
||
if (!copyrightRegex.test(value)) { | ||
return false; | ||
} | ||
|
||
// keeps comments which are at the begining of a file. | ||
if (iliasRegex.test(value)) { | ||
return (line === 0 || line === 1); | ||
} | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Style to Repo | ||
|
||
These scripts ensure that all style-relevant files are copied to a separate repository. | ||
With each push/merge to the original repository, a commit is created when changes are | ||
made to the style files, which is then pushed into the style repository. | ||
This commit contains the original commit message, the commit hash and a URL to the corresponding commit. | ||
|
||
## Steps to do | ||
|
||
Please change the placeholder values of the variables in deploy.sh. | ||
|
||
STYLE_REPO="https://github.com/foo/style_test.git" | ||
STYLE_REPO_NAME_SHORT="foo/style_test.git" | ||
|
||
### Add a token for an user with admin access to style repository | ||
|
||
- open settings for the user on github | ||
- click 'Developer settings/Personal access tokens/Tokens (classic)' | ||
- click 'Generate new token (classic)' | ||
- add a note for the token | ||
- check repo | ||
- click 'Generate token' | ||
- copy the generated token for the next step | ||
|
||
### Add a secret to the original repository on github | ||
|
||
- open 'Settings' for the repo on github | ||
- select 'Secrets/Actions' from left menu | ||
- click on 'New repository secret' | ||
- the name must be 'STYLE_REPO_NAME_SHORT' | ||
- the secret is the token from the step before | ||
- add the username of the user as variable "STYLE_REPO_USER_NAME" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
# This file is part of ILIAS, a powerful learning management system | ||
# published by ILIAS open source e-Learning e.V. | ||
# | ||
# ILIAS is licensed with the GPL-3.0, | ||
# see https://www.gnu.org/licenses/gpl-3.0.en.html | ||
# You should have received a copy of said license along with the | ||
# source code, too. | ||
# | ||
# If this is not the case or you just want to try ILIAS, you'll find | ||
# us at: | ||
# https://www.ilias.de | ||
# https://github.com/ILIAS-eLearning | ||
# | ||
# Build and deploy style specific files. | ||
|
||
if [ -z ${STYLE_REPO_PUSH_SECRET} ] | ||
then | ||
echo "Please ensure you follow the steps in the 'README.md' and you deposit a 'STYLE_REPO_PUSH_SECRET" | ||
exit | ||
fi | ||
|
||
if [ -z ${STYLE_REPO_USER_NAME} ] | ||
then | ||
echo "Please ensure you follow the steps in the 'README.md' and you deposit a 'STYLE_REPO_USER_NAME" | ||
exit | ||
fi | ||
|
||
MSG=$(git show-branch --no-name HEAD) | ||
HASH=$(git rev-parse HEAD) | ||
URL="https://github.com/ILIAS-eLearning/ILIAS/commit/${HASH}" | ||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
source "./CI/Style-To-Repo/build.sh" | ||
source "./CI/Style-To-Repo/deploy.sh" | ||
source "./CI/Style-To-Repo/cleanup.sh" | ||
|
||
NOW=$(date +'%d.%m.%Y %I:%M:%S') | ||
echo "[${NOW}] Build style folder." | ||
build | ||
|
||
NOW=$(date +'%d.%m.%Y %I:%M:%S') | ||
echo "[${NOW}] Deploy style folder." | ||
deploy "${MSG}" "${HASH}" "${URL}" "${BRANCH}" "${STYLE_REPO_PUSH_SECRET}" "${STYLE_REPO_USER_NAME}" | ||
|
||
NOW=$(date +'%d.%m.%Y %I:%M:%S') | ||
echo "[${NOW}] Cleanup build and deploy artifacts." | ||
removeBuildArtifacts | ||
removeDeployArtifacts | ||
|
||
NOW=$(date +'%d.%m.%Y %I:%M:%S') | ||
echo "[${NOW}] Done" |
Oops, something went wrong.