Skip to content

Commit b886951

Browse files
authored
Merge pull request #16 from eea/develop
Release
2 parents ffb3476 + 726ca36 commit b886951

File tree

17 files changed

+434
-119
lines changed

17 files changed

+434
-119
lines changed

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[ -n "$CI" ] && exit 0
2+
yarn lint-staged

.i18n.babel.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@ All notable changes to this project will be documented in this file. Dates are d
44

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

7-
### [3.1.2](https://github.com/eea/volto-widget-toggle/compare/3.1.1...3.1.2) - 24 July 2023
7+
### [3.1.3](https://github.com/eea/volto-widget-toggle/compare/3.1.2...3.1.3) - 29 September 2023
8+
9+
#### :house: Internal changes
10+
11+
- style: lint-staged reorder in package.json [Alin Voinea - [`e76a014`](https://github.com/eea/volto-widget-toggle/commit/e76a0149a1b5fb842e0c4f9f1cff8c2628faa75a)]
12+
13+
#### :house: Documentation changes
14+
15+
- docs: Update README and DEVELOP [Alin Voinea - [`3a26f66`](https://github.com/eea/volto-widget-toggle/commit/3a26f66d8abf5f4dcd9f963e2671f64009d5e0d6)]
16+
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`01571f4`](https://github.com/eea/volto-widget-toggle/commit/01571f44314839c25a206d0991f2b079c704ffcb)]
817

918
#### :hammer_and_wrench: Others
1019

11-
- test: add unit tests for CheckboxWidget - refs #253277 [ana-oprea - [`7eb7622`](https://github.com/eea/volto-widget-toggle/commit/7eb7622ab02f7a429ad300c0795798aa7301e918)]
20+
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`b2f509e`](https://github.com/eea/volto-widget-toggle/commit/b2f509eb236e0beeccfc8bc89f4c6527a3fca223)]
21+
- test: Fix package.json scripts to use makefile [Alin Voinea - [`72e8245`](https://github.com/eea/volto-widget-toggle/commit/72e8245a4741988849eaa73e5fd238ff6d340fa9)]
22+
- test: Fix eslint and yarn i18n [Alin Voinea - [`034eaf8`](https://github.com/eea/volto-widget-toggle/commit/034eaf890faa3a9c09aa6f4ddca1bc04e46782a8)]
23+
- i18n: Add en [Alin Voinea - [`e60d799`](https://github.com/eea/volto-widget-toggle/commit/e60d799a64230544e37e1f4796dc73bbc0e674c6)]
24+
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`f86b2f7`](https://github.com/eea/volto-widget-toggle/commit/f86b2f7119f24b637e8bc8101effc2c2c3416a65)]
25+
### [3.1.2](https://github.com/eea/volto-widget-toggle/compare/3.1.1...3.1.2) - 24 July 2023
26+
1227
### [3.1.1](https://github.com/eea/volto-widget-toggle/compare/3.1.0...3.1.1) - 12 June 2023
1328

1429
#### :hammer_and_wrench: Others

DEVELOP.md

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,40 @@
22

33
## Develop
44

5+
1. Make sure you have `docker` and `docker compose` installed and running on your machine:
6+
7+
```Bash
8+
git clone https://github.com/eea/volto-widget-toggle.git
9+
cd volto-widget-toggle
10+
git checkout -b bugfix-123456 develop
11+
make
12+
make start
13+
```
14+
15+
1. Wait for `Volto started at 0.0.0.0:3000` meesage
16+
17+
1. Go to http://localhost:3000
18+
19+
1. Initialize git hooks
20+
21+
```Bash
22+
yarn prepare
23+
```
24+
25+
1. Happy hacking!
26+
27+
### Or add @eeacms/volto-widget-toggle to your Volto project
28+
529
Before starting make sure your development environment is properly set. See [Volto Developer Documentation](https://docs.voltocms.com/getting-started/install/)
630

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

9-
$ npm install -g yo
10-
$ npm install -g @plone/generator-volto
11-
$ npm install -g mrs-developer
33+
npm install -g yo @plone/generator-volto mrs-developer
1234

1335
1. Create new volto app
1436

15-
$ yo @plone/volto my-volto-project --addon @eeacms/volto-widget-toggle
16-
$ cd my-volto-project
37+
yo @plone/volto my-volto-project --addon @eeacms/volto-widget-toggle --skip-install
38+
cd my-volto-project
1739

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

@@ -28,25 +50,57 @@ Before starting make sure your development environment is properly set. See [Vol
2850

2951
1. Install
3052

31-
$ yarn develop
32-
$ yarn
53+
make develop
54+
yarn
3355

3456
1. Start backend
3557

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

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

40-
$ docker logs -f plone
41-
4262
...you can also check http://localhost:8080/Plone
4363

4464
1. Start frontend
4565

46-
$ yarn start
66+
yarn start
4767

4868
1. Go to http://localhost:3000
4969

5070
1. Happy hacking!
5171

52-
$ cd src/addons/volto-widget-toggle/
72+
cd src/addons/volto-widget-toggle/
73+
74+
## Cypress
75+
76+
To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
77+
78+
You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
79+
project where you added `volto-widget-toggle` to `mrs.developer.json`
80+
81+
Go to:
82+
83+
```BASH
84+
cd src/addons/volto-widget-toggle/
85+
```
86+
87+
Start:
88+
89+
```Bash
90+
make
91+
make start
92+
```
93+
94+
This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-widget-toggle` block installed.
95+
96+
Open Cypress Interface:
97+
98+
```Bash
99+
make cypress-open
100+
```
101+
102+
Or run it:
103+
104+
```Bash
105+
make cypress-run
106+
```

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# syntax=docker/dockerfile:1
2+
ARG VOLTO_VERSION
3+
FROM plone/frontend-builder:${VOLTO_VERSION}
4+
5+
ARG ADDON_NAME
6+
ARG ADDON_PATH
7+
8+
COPY --chown=node:node ./ /app/src/addons/${ADDON_PATH}/
9+
10+
RUN /setupAddon
11+
RUN yarn install
12+
13+
ENTRYPOINT ["yarn"]
14+
CMD ["start"]

Jenkinsfile

Lines changed: 66 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,17 @@ pipeline {
6262

6363
stage('Tests') {
6464
when {
65-
allOf {
66-
environment name: 'CHANGE_ID', value: ''
67-
anyOf {
68-
not { changelog '.*^Automated release [0-9\\.]+$' }
69-
branch 'master'
65+
anyOf {
66+
allOf {
67+
not { environment name: 'CHANGE_ID', value: '' }
68+
environment name: 'CHANGE_TARGET', value: 'develop'
69+
}
70+
allOf {
71+
environment name: 'CHANGE_ID', value: ''
72+
anyOf {
73+
not { changelog '.*^Automated release [0-9\\.]+$' }
74+
branch 'master'
75+
}
7076
}
7177
}
7278
}
@@ -110,11 +116,17 @@ pipeline {
110116

111117
stage('Integration tests') {
112118
when {
113-
allOf {
114-
environment name: 'CHANGE_ID', value: ''
115-
anyOf {
116-
not { changelog '.*^Automated release [0-9\\.]+$' }
117-
branch 'master'
119+
anyOf {
120+
allOf {
121+
not { environment name: 'CHANGE_ID', value: '' }
122+
environment name: 'CHANGE_TARGET', value: 'develop'
123+
}
124+
allOf {
125+
environment name: 'CHANGE_ID', value: ''
126+
anyOf {
127+
not { changelog '.*^Automated release [0-9\\.]+$' }
128+
branch 'master'
129+
}
118130
}
119131
}
120132
}
@@ -167,13 +179,19 @@ pipeline {
167179

168180
stage('Report to SonarQube') {
169181
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\\.]+$' }
182+
anyOf {
183+
allOf {
184+
not { environment name: 'CHANGE_ID', value: '' }
185+
environment name: 'CHANGE_TARGET', value: 'develop'
186+
}
187+
allOf {
188+
environment name: 'CHANGE_ID', value: ''
189+
anyOf {
190+
allOf {
191+
branch 'develop'
192+
not { changelog '.*^Automated release [0-9\\.]+$' }
193+
}
194+
branch 'master'
177195
}
178196
}
179197
}
@@ -197,6 +215,37 @@ pipeline {
197215
}
198216
}
199217

218+
stage('SonarQube compare to master') {
219+
when {
220+
anyOf {
221+
allOf {
222+
not { environment name: 'CHANGE_ID', value: '' }
223+
environment name: 'CHANGE_TARGET', value: 'develop'
224+
}
225+
allOf {
226+
environment name: 'CHANGE_ID', value: ''
227+
branch 'develop'
228+
not { changelog '.*^Automated release [0-9\\.]+$' }
229+
}
230+
}
231+
}
232+
steps {
233+
node(label: 'docker') {
234+
script {
235+
sh '''docker pull eeacms/gitflow'''
236+
sh '''echo "Error" > checkresult.txt'''
237+
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
238+
sh '''set -o pipefail; docker run -i --rm --name="$BUILD_TAG-gitflow-sn" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME="$GIT_NAME" eeacms/gitflow /checkSonarqubemaster.sh | grep -v "Found script" | tee checkresult.txt'''
239+
}
240+
241+
publishChecks name: 'SonarQube', title: 'Sonarqube Code Quality Check', summary: "Quality check on the SonarQube metrics from branch develop, comparing it with the ones from master branch. No bugs are allowed",
242+
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
243+
detailsURL: "${env.BUILD_URL}display/redirect"
244+
}
245+
}
246+
}
247+
}
248+
200249
stage('Pull Request') {
201250
when {
202251
not {

0 commit comments

Comments
 (0)