Skip to content

Commit

Permalink
Merge pull request #54 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea committed Oct 12, 2023
2 parents 881b735 + 316177b commit dd5f53b
Show file tree
Hide file tree
Showing 10 changed files with 191 additions and 125 deletions.
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ -n "$CI" ] && exit 0
yarn lint-staged
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

### [5.2.4](https://github.com/eea/volto-slate-zotero/compare/5.2.3...5.2.4) - 11 October 2023

#### :house: Internal changes

- chore:volto 16 in tests, update docs, fix stylelint overrides [valentinab25 - [`726bc0a`](https://github.com/eea/volto-slate-zotero/commit/726bc0a66e250df5c8970f6909045fff97f206bc)]
- style: lint-staged reorder in package.json [Alin Voinea - [`e72a4cf`](https://github.com/eea/volto-slate-zotero/commit/e72a4cf63ae5653522965f8237a1d4239c2a0135)]

#### :house: Documentation changes

- docs: Update README and DEVELOP [Alin Voinea - [`a4c20e5`](https://github.com/eea/volto-slate-zotero/commit/a4c20e50a4c799fbdb90b5cb268adcfc8fb95c80)]
- docs: Update README and DEVELOP [Alin Voinea - [`d5edf70`](https://github.com/eea/volto-slate-zotero/commit/d5edf70bfa59020b8af56b9660dffe4dd1a067fd)]

#### :hammer_and_wrench: Others

- test: change e2e test [ana-oprea - [`93bde44`](https://github.com/eea/volto-slate-zotero/commit/93bde44a744b27a9d8db26d3726c006690ca0d5d)]
- test: change e2e test [ana-oprea - [`c8f1e43`](https://github.com/eea/volto-slate-zotero/commit/c8f1e43e973442dcb160aa575b4ee601db2a3dbd)]
- test: change e2e test [ana-oprea - [`2b6823b`](https://github.com/eea/volto-slate-zotero/commit/2b6823b30b10516e382173d3daf3bfaf83e53f0a)]
- test: change e2e test [ana-oprea - [`4d65aa0`](https://github.com/eea/volto-slate-zotero/commit/4d65aa04b6bdb59c31e9ce1861834915013457ee)]
- test: change volto version in Jenkinsfile [ana-oprea - [`41998e6`](https://github.com/eea/volto-slate-zotero/commit/41998e6ddfc6064039f65853693af0ec56afb56b)]
- test: update package.json pre-commit lint order [ana-oprea - [`f5cf3ad`](https://github.com/eea/volto-slate-zotero/commit/f5cf3ad4d03a909ac41b03a0c94a6adfc97aab27)]
- test: eslint [ana-oprea - [`30889ce`](https://github.com/eea/volto-slate-zotero/commit/30889ce2208653b2efaec4c702cf4245cc8204ba)]
- test: eslint [ana-oprea - [`c981671`](https://github.com/eea/volto-slate-zotero/commit/c981671b761e2591bd845ef5c1bb5f8396cd306a)]
- test: increase cypress timeout [ana-oprea - [`c3604bb`](https://github.com/eea/volto-slate-zotero/commit/c3604bba4366325106798a861554387a101a3f04)]
- test: Re-enable cypress [Alin Voinea - [`b4a2cb9`](https://github.com/eea/volto-slate-zotero/commit/b4a2cb9d316b23e49f284b5b01fc58b38ade8ab7)]
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`7a7c214`](https://github.com/eea/volto-slate-zotero/commit/7a7c2143e2ee7fffdbbcb330c1f3f6c74724956d)]
### [5.2.3](https://github.com/eea/volto-slate-zotero/compare/5.2.2...5.2.3) - 1 September 2023

#### :bug: Bug Fixes
Expand Down
30 changes: 12 additions & 18 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,26 @@

1. Go to http://localhost:3000

1. Happy hacking!
1. Initialize git hooks

```Bash
cd src/addons/volto-slate-zotero/
yarn prepare
```

1. Happy hacking!

### Or add @eeacms/volto-slate-zotero to your Volto project

Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)

1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`

$ npm install -g yo
$ npm install -g @plone/generator-volto
$ npm install -g mrs-developer
npm install -g yo @plone/generator-volto mrs-developer

1. Create new volto app

$ yo @plone/volto my-volto-project \
--workspace src/addons/volto-slate-zotero \
--addon @eeacms/volto-slate-zotero \
--no-interactive \
--skip-install
$ cd my-volto-project
yo @plone/volto my-volto-project --addon @eeacms/volto-slate-zotero --skip-install
cd my-volto-project

1. Add the following to `mrs.developer.json`:

Expand All @@ -54,28 +50,26 @@ Before starting make sure your development environment is properly set. See [Vol

1. Install

$ yarn develop
$ yarn
make develop
yarn

1. Start backend

$ docker run -d --name plone -p 8080:8080 -e SITE=Plone plone
docker run --pull always -it --rm --name plone -p 8080:8080 -e SITE=Plone plone/plone-backend

...wait for backend to setup and start - `Ready to handle requests`:

$ docker logs -f plone

...you can also check http://localhost:8080/Plone

1. Start frontend

$ yarn start
yarn start

1. Go to http://localhost:3000

1. Happy hacking!

$ cd src/addons/volto-slate-zotero/
cd src/addons/volto-slate-zotero/

## Cypress

Expand Down
167 changes: 96 additions & 71 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pipeline {
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,www.eea.europa.eu-ims,climate-energy.eea.europa.eu,sustainability.eionet.europa.eu,forest.eea.europa.eu,biodiversity.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en"
DEPENDENCIES = ""
VOLTO = ""
VOLTO = "16"
}

stages {
Expand Down Expand Up @@ -62,11 +62,17 @@ pipeline {

stage('Tests') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
}
}
}
}
Expand Down Expand Up @@ -108,72 +114,84 @@ pipeline {
}
}

// stage('Integration tests') {
// when {
// allOf {
// environment name: 'CHANGE_ID', value: ''
// anyOf {
// not { changelog '.*^Automated release [0-9\\.]+$' }
// branch 'master'
// }
// }
// }
// steps {
// parallel(
stage('Integration tests') {
when {
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
not { changelog '.*^Automated release [0-9\\.]+$' }
branch 'master'
}
}
}
}
steps {
parallel(

// "Cypress": {
// node(label: 'docker') {
// script {
// try {
// 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'''
// 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'''
// } finally {
// try {
// sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
// sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
// sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
// coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
// if ( coverage == 0 ) {
// publishHTML (target : [allowMissing: false,
// alwaysLinkToLastBuild: true,
// keepAll: true,
// reportDir: 'cypress-coverage/coverage/lcov-report',
// reportFiles: 'index.html',
// reportName: 'CypressCoverage',
// reportTitles: 'Integration Tests Code Coverage'])
// }
// 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'''
// archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
// stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
// }
// finally {
// catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
// junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
// }
// sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
// sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true
"Cypress": {
node(label: 'docker') {
script {
try {
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'''
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'''
} finally {
try {
sh '''rm -rf cypress-reports cypress-results cypress-coverage'''
sh '''mkdir -p cypress-reports cypress-results cypress-coverage'''
sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/videos cypress-reports/'''
sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/cypress/reports cypress-results/'''
coverage = sh script: '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/src/addons/$GIT_NAME/coverage cypress-coverage/''', returnStatus: true
if ( coverage == 0 ) {
publishHTML (target : [allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'cypress-coverage/coverage/lcov-report',
reportFiles: 'index.html',
reportName: 'CypressCoverage',
reportTitles: 'Integration Tests Code Coverage'])
}
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'''
archiveArtifacts artifacts: 'cypress-reports/**/*.mp4', fingerprint: true, allowEmptyArchive: true
stash name: "cypress-coverage", includes: "cypress-coverage/**", allowEmpty: true
}
finally {
catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') {
junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true
}
sh script: "docker stop $BUILD_TAG-plone", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true
sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true

// }
// }
// }
// }
// }
}
}
}
}
}

// )
// }
// }
)
}
}

stage('Report to SonarQube') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
branch 'master'
allOf {
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
anyOf {
allOf {
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
}
branch 'master'
}
}
}
Expand All @@ -183,7 +201,7 @@ pipeline {
script{
checkout scm
unstash "xunit-reports"
// unstash "cypress-coverage"
unstash "cypress-coverage"
def scannerHome = tool 'SonarQubeScanner';
def nodeJS = tool 'NodeJS';
withSonarQubeEnv('Sonarqube') {
Expand All @@ -199,10 +217,16 @@ pipeline {

stage('SonarQube compare to master') {
when {
allOf {
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
anyOf {
allOf {
not { environment name: 'CHANGE_ID', value: '' }
environment name: 'CHANGE_TARGET', value: 'develop'
}
allOf {
environment name: 'CHANGE_ID', value: ''
branch 'develop'
not { changelog '.*^Automated release [0-9\\.]+$' }
}
}
}
steps {
Expand All @@ -222,6 +246,7 @@ pipeline {
}
}


stage('Pull Request') {
when {
not {
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ stylelint: ## Stylelint

.PHONY: stylelint-overrides
stylelint-overrides:
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides'

.PHONY: stylelint-fix
stylelint-fix: ## Fix stylelint
$(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix
$(NODE_MODULES)/.bin/stylelint --syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix
$(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix

.PHONY: prettier
prettier: ## Prettier
Expand Down
18 changes: 4 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

This version requires: `@plone/volto >= 16.0.0.alpha.15` (`volto-slate` part of Volto Core).

## Dependencies (Backend)

* [eea.zotero](https://pypi.org/project/eea.zotero)

## Getting started

### Try volto-slate-zotero with Docker
Expand Down Expand Up @@ -79,19 +83,6 @@ Go to http://localhost:3000

1. Happy editing!


## Dependencies

### Backend

- [Plone](https://plone.org/download)
- [plone.restapi](https://pypi.org/project/plone.restapi/)
- [eea.zotero](https://pypi.org/project/eea.zotero)

### Frontend

- [Volto](https://github.com/plone/volto)

## Release

See [RELEASE.md](https://github.com/eea/volto-slate-zotero/blob/master/RELEASE.md).
Expand All @@ -100,7 +91,6 @@ See [RELEASE.md](https://github.com/eea/volto-slate-zotero/blob/master/RELEASE.m

See [DEVELOP.md](https://github.com/eea/volto-slate-zotero/blob/master/DEVELOP.md).


## Copyright and license

The Initial Owner of the Original Code is European Environment Agency (EEA).
Expand Down
Loading

0 comments on commit dd5f53b

Please sign in to comment.