@eeacms/volto-tabs-block 2.2.0 → 3.0.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/README.md CHANGED
@@ -61,78 +61,7 @@ Demo GIF
61
61
 
62
62
  ## Release
63
63
 
64
- ### Automatic release using Jenkins
65
-
66
- * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
67
- * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
68
- * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
69
- * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
70
- * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
71
- * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
72
- * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
73
- * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
74
-
75
- ### Manual release from the develop branch ( beta release )
76
-
77
- #### Installation and configuration of release-it
78
-
79
- You need to first install the [release-it](https://github.com/release-it/release-it) client.
80
-
81
- ```
82
- npm install -g release-it
83
- ```
84
-
85
- Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
86
-
87
- Release-it is a tool that automates 4 important steps in the release process:
88
-
89
- 1. Version increase in `package.json` ( increased from the current version in `package.json`)
90
- 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
91
- 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
92
- 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
93
-
94
- To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
95
-
96
- ```
97
- export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
98
- ```
99
-
100
- To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
101
-
102
- ```
103
- echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
104
- ```
105
-
106
- #### Using release-it tool
107
-
108
- There are 3 yarn scripts that can be run to do the release
109
-
110
- ##### yarn release-beta
111
-
112
- Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
113
-
114
- ```
115
- ? Select increment (next version):
116
- ❯ prepatch (0.1.1-beta.0)
117
- preminor (0.2.0-beta.0)
118
- premajor (1.0.0-beta.0)
119
- Other, please specify...
120
- ```
121
-
122
- ##### yarn release-major-beta
123
-
124
- Same as `yarn release-beta`, but with premajor version pre-selected.
125
-
126
- ##### yarn release
127
-
128
- Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
129
-
130
- #### Important notes
131
-
132
- > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
133
-
134
- > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
135
-
64
+ See [RELEASE.md](https://github.com/eea/volto-tabs-block/blob/master/RELEASE.md).
136
65
 
137
66
  ## How to contribute
138
67
 
package/RELEASE.md ADDED
@@ -0,0 +1,74 @@
1
+ ## Release
2
+
3
+ ### Automatic release using Jenkins
4
+
5
+ * The automatic release is started by creating a [Pull Request](../../compare/master...develop) from `develop` to `master`. The pull request status checks correlated to the branch and PR Jenkins jobs need to be processed successfully. 1 review from a github user with rights is mandatory.
6
+ * It runs on every commit on `master` branch, which is protected from direct commits, only allowing pull request merge commits.
7
+ * The automatic release is done by [Jenkins](https://ci.eionet.europa.eu). The status of the release job can be seen both in the Readme.md badges and the green check/red cross/yellow circle near the last commit information. If you click on the icon, you will have the list of checks that were run. The `continuous-integration/jenkins/branch` link goes to the Jenkins job execution webpage.
8
+ * Automated release scripts are located in the `eeacms/gitflow` docker image, specifically [js-release.sh](https://github.com/eea/eea.docker.gitflow/blob/master/src/js-release.sh) script. It uses the `release-it` tool.
9
+ * As long as a PR request is open from develop to master, the PR Jenkins job will automatically re-create the CHANGELOG.md and package.json files to be production-ready.
10
+ * The version format must be MAJOR.MINOR.PATCH. By default, next release is set to next minor version (with patch 0).
11
+ * You can manually change the version in `package.json`. The new version must not be already present in the tags/releases of the repository, otherwise it will be automatically increased by the script. Any changes to the version will trigger a `CHANGELOG.md` re-generation.
12
+ * Automated commits and commits with [JENKINS] or [YARN] in the commit log are excluded from `CHANGELOG.md` file.
13
+
14
+ ### Manual release from the develop branch ( beta release )
15
+
16
+ #### Installation and configuration of release-it
17
+
18
+ You need to first install the [release-it](https://github.com/release-it/release-it) client.
19
+
20
+ ```
21
+ npm install -g release-it
22
+ ```
23
+
24
+ Release-it uses the configuration written in the [`.release-it.json`](./.release-it.json) file located in the root of the repository.
25
+
26
+ Release-it is a tool that automates 4 important steps in the release process:
27
+
28
+ 1. Version increase in `package.json` ( increased from the current version in `package.json`)
29
+ 2. `CHANGELOG.md` automatic generation from commit messages ( grouped by releases )
30
+ 3. GitHub release on the commit with the changelog and package.json modification on the develop branch
31
+ 4. NPM release ( by default it's disabled, but can be enabled in the configuration file )
32
+
33
+ To configure the authentification, you need to export GITHUB_TOKEN for [GitHub](https://github.com/settings/tokens)
34
+
35
+ ```
36
+ export GITHUB_TOKEN=XXX-XXXXXXXXXXXXXXXXXXXXXX
37
+ ```
38
+
39
+ To configure npm, you can use the `npm login` command or use a configuration file with a TOKEN :
40
+
41
+ ```
42
+ echo "//registry.npmjs.org/:_authToken=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" > .npmrc
43
+ ```
44
+
45
+ #### Using release-it tool
46
+
47
+ There are 3 yarn scripts that can be run to do the release
48
+
49
+ ##### yarn release-beta
50
+
51
+ Automatically calculates and presents 3 beta versions - patch, minor and major for you to choose ( or Other for manual input).
52
+
53
+ ```
54
+ ? Select increment (next version):
55
+ ❯ prepatch (0.1.1-beta.0)
56
+ preminor (0.2.0-beta.0)
57
+ premajor (1.0.0-beta.0)
58
+ Other, please specify...
59
+ ```
60
+
61
+ ##### yarn release-major-beta
62
+
63
+ Same as `yarn release-beta`, but with premajor version pre-selected.
64
+
65
+ ##### yarn release
66
+
67
+ Generic command, does not automatically add the `beta` to version, but you can still manually write it if you choose Other.
68
+
69
+ #### Important notes
70
+
71
+ > Do not use release-it tool on master branch, the commit on CHANGELOG.md file and the version increase in the package.json file can't be done without a PULL REQUEST.
72
+
73
+ > Do not keep Pull Requests from develop to master branches open when you are doing beta releases from the develop branch. As long as a PR to master is open, an automatic script will run on every commit and will update both the version and the changelog to a production-ready state - ( MAJOR.MINOR.PATCH mandatory format for version).
74
+
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  module.exports = function (api) {
2
2
  api.cache(true);
3
- const presets = ['razzle/babel'];
3
+ const presets = ['razzle'];
4
4
  const plugins = [
5
5
  [
6
6
  'react-intl', // React Intl extractor, required for the whole i18n infrastructure to work
@@ -0,0 +1,26 @@
1
+ const { defineConfig } = require('cypress');
2
+
3
+ module.exports = defineConfig({
4
+ viewportWidth: 1280,
5
+ defaultCommandTimeout: 8888,
6
+ chromeWebSecurity: false,
7
+ reporter: 'junit',
8
+ video: true,
9
+ retries: {
10
+ runMode: 8,
11
+ openMode: 0,
12
+ },
13
+ reporterOptions: {
14
+ mochaFile: 'cypress/reports/cypress-[hash].xml',
15
+ jenkinsMode: true,
16
+ toConsole: true,
17
+ },
18
+ e2e: {
19
+ setupNodeEvents(on, config) {
20
+ // e2e testing node events setup code
21
+ require('@cypress/code-coverage/task')(on, config);
22
+ return config;
23
+ },
24
+ baseUrl: 'http://localhost:3000',
25
+ },
26
+ });
@@ -9,6 +9,7 @@ module.exports = {
9
9
  '@plone/volto/babel': '<rootDir>/node_modules/@plone/volto/babel',
10
10
  '@plone/volto/(.*)$': '<rootDir>/node_modules/@plone/volto/src/$1',
11
11
  '@package/(.*)$': '<rootDir>/src/$1',
12
+ '@root/(.*)$': '<rootDir>/src/$1',
12
13
  '@plone/volto-quanta/(.*)$': '<rootDir>/src/addons/volto-quanta/src/$1',
13
14
  '@eeacms/(.*?)/(.*)$': '<rootDir>/src/addons/$1/src/$2',
14
15
  '@plone/volto-slate':
@@ -16,12 +17,10 @@ module.exports = {
16
17
  '~/(.*)$': '<rootDir>/src/$1',
17
18
  'load-volto-addons':
18
19
  '<rootDir>/node_modules/@plone/volto/jest-addons-loader.js',
20
+ '\\.(css|less|scss|sass)$': 'identity-obj-proxy',
19
21
  },
20
22
  transform: {
21
23
  '^.+\\.js(x)?$': 'babel-jest',
22
- '^.+\\.css$': 'jest-css-modules',
23
- '^.+\\.less$': 'jest-css-modules',
24
- '^.+\\.scss$': 'jest-css-modules',
25
24
  '^.+\\.(png)$': 'jest-file',
26
25
  '^.+\\.(jpg)$': 'jest-file',
27
26
  '^.+\\.(svg)$': './node_modules/@plone/volto/jest-svgsystem-transform.js',
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-tabs-block",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "volto-tabs-block: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -26,24 +26,28 @@
26
26
  "slick-carousel": "^1.8.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@cypress/code-coverage": "^3.9.5",
30
- "babel-plugin-transform-class-properties": "^6.24.1"
29
+ "@plone/scripts": "*",
30
+ "@cypress/code-coverage": "^3.10.0",
31
+ "babel-plugin-transform-class-properties": "^6.24.1",
32
+ "md5": "^2.3.0"
31
33
  },
32
34
  "scripts": {
33
35
  "release": "release-it",
36
+ "release-major-beta": "release-it major --preRelease=beta",
37
+ "release-beta": "release-it --preRelease=beta",
34
38
  "bootstrap": "npm install -g ejs; npm link ejs; node bootstrap",
35
39
  "test": "make test",
36
40
  "test:fix": "make test-update",
37
41
  "pre-commit": "yarn stylelint:fix && yarn prettier:fix && yarn lint:fix",
38
- "stylelint": "../../../node_modules/.bin/stylelint 'theme/**/*.{css,less}' 'src/**/*.{css,less}'",
39
- "stylelint:overrides": "../../../node_modules/.bin/stylelint --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'",
40
- "stylelint:fix": "yarn stylelint --fix && yarn stylelint:overrides --fix",
41
- "prettier": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --check 'src/**/*.{js,jsx,json,css,less,md}'; fi",
42
- "prettier:fix": "if [ -d ./project ]; then ./project/node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; else ../../../node_modules/.bin/prettier --single-quote --write 'src/**/*.{js,jsx,json,css,less,md}'; fi",
43
- "lint": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --max-warnings=0 'src/**/*.{js,jsx}'; fi",
44
- "lint:fix": "if [ -d ./project ]; then ./project/node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; else ../../../node_modules/eslint/bin/eslint.js --fix 'src/**/*.{js,jsx}'; fi",
45
- "i18n": "rm -rf build/messages && NODE_ENV=production i18n --addon",
46
- "cypress:run": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress run; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress run; fi",
47
- "cypress:open": "if [ -d ./project ]; then NODE_ENV=development ./project/node_modules/cypress/bin/cypress open; else NODE_ENV=development ../../../node_modules/cypress/bin/cypress open; fi"
42
+ "stylelint": "make stylelint",
43
+ "stylelint:overrides": "make stylelint-overrides",
44
+ "stylelint:fix": "make stylelint-fix",
45
+ "prettier": "make prettier",
46
+ "prettier:fix": "make prettier-fix",
47
+ "lint": "make lint",
48
+ "lint:fix": "make lint-fix",
49
+ "i18n": "make i18n",
50
+ "cypress:run": "make cypress-run",
51
+ "cypress:open": "make cypress-open"
48
52
  }
49
53
  }
@@ -11,6 +11,10 @@
11
11
  display: none !important;
12
12
  }
13
13
 
14
+ .ui.menu {
15
+ margin-bottom: @menuMarginButton;
16
+ }
17
+
14
18
  > .styled > .tabs > .ui.menu,
15
19
  > .styled > .tabs > .ui.grid > .column > .ui.menu,
16
20
  > .tabs > .ui.menu,
@@ -2,6 +2,8 @@
2
2
  Tabs menu
3
3
  *******************************/
4
4
 
5
+ @menuMarginButton: 0;
6
+
5
7
  /* Menu title */
6
8
  @menuTitleFontSize: 24px;
7
9
  @menuTitleFontWeight: normal;
@@ -7,6 +7,8 @@
7
7
  .loadAddonVariables();
8
8
 
9
9
  .tabs-block {
10
+ color: @tabsBlockColor;
11
+
10
12
  > .styled {
11
13
  display: flex !important;
12
14
  flex: 1;
@@ -62,4 +64,8 @@
62
64
  }
63
65
  }
64
66
 
67
+ .RRT__container .ui.RRT__tabs {
68
+ margin-bottom: 0;
69
+ }
70
+
65
71
  .loadAddonOverrides();
@@ -2,8 +2,9 @@
2
2
  Tabs block
3
3
  *******************************/
4
4
 
5
- @verticalPadding: 1em;
6
- @horizontalPadding: 0;
5
+ @tabsBlockColor: #000;
6
+ @verticalPadding: 1rem;
7
+ @horizontalPadding: 1rem;
7
8
 
8
9
  /* Tab pane */
9
10
  @tabPanePadding: @verticalPadding @horizontalPadding;
package/Jenkinsfile DELETED
@@ -1,242 +0,0 @@
1
- pipeline {
2
- agent any
3
-
4
- environment {
5
- GIT_NAME = "volto-tabs-block"
6
- NAMESPACE = "@eeacms"
7
- SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,circularity.eea.europa.eu"
8
- DEPENDENCIES = "@eeacms/volto-block-style"
9
- VOLTO = "16.0.0-alpha.14"
10
- }
11
-
12
- stages {
13
-
14
- stage('Release') {
15
- when {
16
- allOf {
17
- environment name: 'CHANGE_ID', value: ''
18
- branch 'master'
19
- }
20
- }
21
- steps {
22
- node(label: 'docker') {
23
- withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),string(credentialsId: 'eea-jenkins-npm-token', variable: 'NPM_TOKEN')]) {
24
- sh '''docker pull eeacms/gitflow'''
25
- sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" -e GIT_TOKEN="$GITHUB_TOKEN" -e NPM_TOKEN="$NPM_TOKEN" -e LANGUAGE=javascript eeacms/gitflow'''
26
- }
27
- }
28
- }
29
- }
30
-
31
- stage('Code') {
32
- when {
33
- allOf {
34
- environment name: 'CHANGE_ID', value: ''
35
- not { changelog '.*^Automated release [0-9\\.]+$' }
36
- not { branch 'master' }
37
- }
38
- }
39
- steps {
40
- parallel(
41
-
42
- "ES lint": {
43
- node(label: 'docker') {
44
- sh '''docker run -i --rm --name="$BUILD_TAG-eslint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci eslint'''
45
- }
46
- },
47
-
48
- "Style lint": {
49
- node(label: 'docker') {
50
- sh '''docker run -i --rm --name="$BUILD_TAG-stylelint" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci stylelint'''
51
- }
52
- },
53
-
54
- "Prettier": {
55
- node(label: 'docker') {
56
- sh '''docker run -i --rm --name="$BUILD_TAG-prettier" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci prettier'''
57
- }
58
- }
59
- )
60
- }
61
- }
62
-
63
- stage('Tests') {
64
- when {
65
- allOf {
66
- environment name: 'CHANGE_ID', value: ''
67
- anyOf {
68
- not { changelog '.*^Automated release [0-9\\.]+$' }
69
- branch 'master'
70
- }
71
- }
72
- }
73
- steps {
74
- parallel(
75
-
76
- "Volto": {
77
- node(label: 'docker') {
78
- script {
79
- try {
80
- sh '''docker pull plone/volto-addon-ci'''
81
- sh '''docker run -i --name="$BUILD_TAG-volto" -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" plone/volto-addon-ci'''
82
- sh '''rm -rf xunit-reports'''
83
- sh '''mkdir -p xunit-reports'''
84
- sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/coverage xunit-reports/'''
85
- sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/junit.xml xunit-reports/'''
86
- sh '''docker cp $BUILD_TAG-volto:/opt/frontend/my-volto-project/unit_tests_log.txt xunit-reports/'''
87
- stash name: "xunit-reports", includes: "xunit-reports/**"
88
- archiveArtifacts artifacts: "xunit-reports/unit_tests_log.txt", fingerprint: true
89
- publishHTML (target : [
90
- allowMissing: false,
91
- alwaysLinkToLastBuild: true,
92
- keepAll: true,
93
- reportDir: 'xunit-reports/coverage/lcov-report',
94
- reportFiles: 'index.html',
95
- reportName: 'UTCoverage',
96
- reportTitles: 'Unit Tests Code Coverage'
97
- ])
98
- } finally {
99
- catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
100
- junit testResults: 'xunit-reports/junit.xml', allowEmptyResults: true
101
- }
102
- sh script: '''docker rm -v $BUILD_TAG-volto''', returnStatus: true
103
- }
104
- }
105
- }
106
- }
107
- )
108
- }
109
- }
110
-
111
- stage('Integration tests') {
112
- when {
113
- allOf {
114
- environment name: 'CHANGE_ID', value: ''
115
- anyOf {
116
- not { changelog '.*^Automated release [0-9\\.]+$' }
117
- branch 'master'
118
- }
119
- }
120
- }
121
- steps {
122
- parallel(
123
-
124
- "Cypress": {
125
- node(label: 'docker') {
126
- script {
127
- try {
128
- sh '''docker pull eeacms/plone-backend; docker run --rm -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="eea.kitkat:testing" eeacms/plone-backend'''
129
- sh '''docker pull plone/volto-addon-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e NAMESPACE="$NAMESPACE" -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e DEPENDENCIES="$DEPENDENCIES" -e NODE_ENV=development -e VOLTO="$VOLTO" plone/volto-addon-ci cypress'''
130
- } finally {
131
- try {
132
- sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
133
- sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
134
- sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
135
- sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
136
- coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
137
- if ( coverage == 0 ) {
138
- publishHTML (target : [allowMissing: false,
139
- alwaysLinkToLastBuild: true,
140
- keepAll: true,
141
- reportDir: 'cypress-coverage/coverage/lcov-report',
142
- reportFiles: 'index.html',
143
- reportName: 'CypressCoverage',
144
- reportTitles: 'Integration Tests Code Coverage'])
145
- }
146
- sh '''touch empty_file; for ok_test in $(grep -E 'file=.*failures="0"' $(grep 'testsuites .*failures="0"' $(find cypress-results -name *.xml) empty_file | awk -F: '{print $1}') empty_file | sed 's/.* file="\\(.*\\)" time.*/\\1/' | sed 's#^cypress/integration/##g' | sed 's#^../../../node_modules/@eeacms/##g'); do rm -f cypress-reports/videos/$ok_test.mp4; rm -f cypress-reports/$ok_test.mp4; done'''
147
- archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
148
- stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
149
- }
150
- finally {
151
- catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
152
- junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
153
- }
154
- sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
155
- sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
156
- sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
157
-
158
- }
159
- }
160
- }
161
- }
162
- }
163
-
164
- )
165
- }
166
- }
167
-
168
- stage('Report to SonarQube') {
169
- when {
170
- allOf {
171
- environment name: 'CHANGE_ID', value: ''
172
- anyOf {
173
- branch 'master'
174
- allOf {
175
- branch 'develop'
176
- not { changelog '.*^Automated release [0-9\\.]+$' }
177
- }
178
- }
179
- }
180
- }
181
- steps {
182
- node(label: 'swarm') {
183
- script{
184
- checkout scm
185
- unstash "xunit-reports"
186
- unstash "cypress-coverage"
187
- def scannerHome = tool 'SonarQubeScanner';
188
- def nodeJS = tool 'NodeJS';
189
- withSonarQubeEnv('Sonarqube') {
190
- sh '''sed -i "s#/opt/frontend/my-volto-project/src/addons/${GIT_NAME}/##g" xunit-reports/coverage/lcov.info'''
191
- sh "export PATH=${scannerHome}/bin:${nodeJS}/bin:$PATH; sonar-scanner -Dsonar.javascript.lcov.reportPaths=./xunit-reports/coverage/lcov.info,./cypress-coverage/coverage/lcov.info -Dsonar.sources=./src -Dsonar.projectKey=$GIT_NAME-$BRANCH_NAME -Dsonar.projectVersion=$BRANCH_NAME-$BUILD_NUMBER"
192
- sh '''try=2; while [ \$try -gt 0 ]; do curl -s -XPOST -u "${SONAR_AUTH_TOKEN}:" "${SONAR_HOST_URL}api/project_tags/set?project=${GIT_NAME}-${BRANCH_NAME}&tags=${SONARQUBE_TAGS},${BRANCH_NAME}" > set_tags_result; if [ \$(grep -ic error set_tags_result ) -eq 0 ]; then try=0; else cat set_tags_result; echo "... Will retry"; sleep 60; try=\$(( \$try - 1 )); fi; done'''
193
- }
194
- }
195
- }
196
- }
197
- }
198
-
199
- stage('Pull Request') {
200
- when {
201
- not {
202
- environment name: 'CHANGE_ID', value: ''
203
- }
204
- environment name: 'CHANGE_TARGET', value: 'master'
205
- }
206
- steps {
207
- node(label: 'docker') {
208
- script {
209
- if ( env.CHANGE_BRANCH != "develop" ) {
210
- error "Pipeline aborted due to PR not made from develop branch"
211
- }
212
- withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) {
213
- sh '''docker pull eeacms/gitflow'''
214
- sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_TARGET="$CHANGE_TARGET" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e LANGUAGE=javascript eeacms/gitflow'''
215
- }
216
- }
217
- }
218
- }
219
- }
220
-
221
- }
222
-
223
- post {
224
- always {
225
- cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true)
226
- }
227
- changed {
228
- script {
229
- def details = """<h1>${env.JOB_NAME} - Build #${env.BUILD_NUMBER} - ${currentBuild.currentResult}</h1>
230
- <p>Check console output at <a href="${env.BUILD_URL}/display/redirect">${env.JOB_BASE_NAME} - #${env.BUILD_NUMBER}</a></p>
231
- """
232
- emailext(
233
- subject: '$DEFAULT_SUBJECT',
234
- body: details,
235
- attachLog: true,
236
- compressLog: true,
237
- recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider']]
238
- )
239
- }
240
- }
241
- }
242
- }
package/Makefile DELETED
@@ -1,50 +0,0 @@
1
- SHELL=/bin/bash
2
-
3
- DIR=$(shell basename $$(pwd))
4
- ADDON ?= "@eeacms/volto-tabs-block"
5
-
6
- # We like colors
7
- # From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
8
- RED=`tput setaf 1`
9
- GREEN=`tput setaf 2`
10
- RESET=`tput sgr0`
11
- YELLOW=`tput setaf 3`
12
-
13
- project:
14
- npm install -g yo
15
- npm install -g @plone/generator-volto
16
- npm install -g mrs-developer
17
- yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive
18
- ln -sf $$(pwd) project/src/addons/
19
- cp .project.eslintrc.js .eslintrc.js
20
- cd project && yarn
21
- @echo "-------------------"
22
- @echo "$(GREEN)Volto project is ready!$(RESET)"
23
- @echo "$(RED)Now run: cd project && yarn start$(RESET)"
24
-
25
- all: project
26
-
27
- .PHONY: start-test-backend
28
- start-test-backend: ## Start Test Plone Backend
29
- @echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
30
- docker run -i --rm -e ZSERVER_HOST=0.0.0.0 -e ZSERVER_PORT=55001 -p 55001:55001 -e SITE=plone -e APPLY_PROFILES=plone.app.contenttypes:plone-content,plone.restapi:default,kitconcept.volto:default-homepage -e CONFIGURE_PACKAGES=plone.app.contenttypes,plone.restapi,kitconcept.volto,kitconcept.volto.cors -e ADDONS='plone.app.robotframework plone.app.contenttypes plone.restapi kitconcept.volto' plone ./bin/robot-server plone.app.robotframework.testing.PLONE_ROBOT_TESTING
31
-
32
- .PHONY: start-backend-docker
33
- start-backend-docker: ## Starts a Docker-based backend
34
- @echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
35
- docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone
36
-
37
- .PHONY: test
38
- test:
39
- docker pull plone/volto-addon-ci
40
- docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" plone/volto-addon-ci yarn test --watchAll=false
41
-
42
- .PHONY: test-update
43
- test-update:
44
- docker pull plone/volto-addon-ci
45
- docker run -it --rm -e NAMESPACE="@eeacms" -e GIT_NAME="${DIR}" -e RAZZLE_JEST_CONFIG=jest-addon.config.js -v "$$(pwd):/opt/frontend/my-volto-project/src/addons/${DIR}" plone/volto-addon-ci yarn test --watchAll=false -u
46
-
47
- .PHONY: help
48
- help: ## Show this help.
49
- @echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
50
- -s :)"
@@ -1,5 +0,0 @@
1
- {
2
- "name": "Using fixtures to represent data",
3
- "email": "hello@cypress.io",
4
- "body": "Fixtures are a great way to mock data for responses to routes"
5
- }