Skip to content

Commit

Permalink
Merge pull request #33 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea authored Sep 29, 2023
2 parents a99bc5f + 69c0e42 commit 4bcfb04
Show file tree
Hide file tree
Showing 24 changed files with 1,316 additions and 119 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
1 change: 0 additions & 1 deletion .i18n.babel.config.js

This file was deleted.

18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ 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.1.4](https://github.com/eea/volto-object-widget/compare/5.1.3...5.1.4) - 29 September 2023

#### :house: Internal changes

- style: lint-staged reorder in package.json [Alin Voinea - [`608f4d9`](https://github.com/eea/volto-object-widget/commit/608f4d9ae0f97bd0d0cb5c241010f481930372e7)]

#### :house: Documentation changes

- docs: Update README and DEVELOP [Alin Voinea - [`bcb0ca8`](https://github.com/eea/volto-object-widget/commit/bcb0ca8b9a3e23025f3f064e374c38e2acbfad03)]
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`59c256f`](https://github.com/eea/volto-object-widget/commit/59c256f28bfcfc0c35d434b909418afa62c0b535)]

#### :hammer_and_wrench: Others

- test: add unit tests - refs #254313 [ana-oprea - [`ec53971`](https://github.com/eea/volto-object-widget/commit/ec53971d38d4458d65ca3a627976054c8eeceef8)]
- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`fa47506`](https://github.com/eea/volto-object-widget/commit/fa475064b0e8800bd8f5a775ddeccd3995b16533)]
- test: Fix eslint and yarn i18n [Alin Voinea - [`b566224`](https://github.com/eea/volto-object-widget/commit/b56622406cf196fe09641583c84197497a9cff83)]
- i18n: Add en [Alin Voinea - [`e96fb5b`](https://github.com/eea/volto-object-widget/commit/e96fb5b25300c78f29c682dfed579990a1a7baf2)]
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`99817cd`](https://github.com/eea/volto-object-widget/commit/99817cd62e3e85fd0214157977f8dc8aff638097)]
### [5.1.3](https://github.com/eea/volto-object-widget/compare/5.1.2...5.1.3) - 24 July 2023

#### :hammer_and_wrench: Others
Expand Down
65 changes: 60 additions & 5 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

## Develop

1. Make sure you have `docker` and `docker compose` installed and running on your machine:

```Bash
git clone https://github.com/eea/volto-object-widget.git
cd volto-object-widget
git checkout -b bugfix-123456 develop
make
make start
```

1. Wait for `Volto started at 0.0.0.0:3000` meesage

1. Go to http://localhost:3000

1. Initialize git hooks

```Bash
yarn prepare
```

1. Happy hacking!

### Or add @eeacms/volto-object-widget 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`
Expand All @@ -26,18 +50,15 @@ Before starting make sure your development environment is properly set. See [Vol

1. Install

yarn develop
make develop
yarn

1. Start backend

docker pull plone
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" 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
Expand All @@ -49,3 +70,37 @@ Before starting make sure your development environment is properly set. See [Vol
1. Happy hacking!

cd src/addons/volto-object-widget/

## Cypress

To run cypress locally, first make sure you don't have any Volto/Plone running on ports `8080` and `3000`.
You don't have to be in a `clean-volto-project`, you can be in any Volto Frontend
project where you added `volto-object-widget` to `mrs.developer.json`

Go to:

```BASH
cd src/addons/volto-object-widget/
```

Start:

```Bash
make
make start
```

This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-object-widget` block installed.

Open Cypress Interface:

```Bash
make cypress-open
```

Or run it:

```Bash
make cypress-run
```
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# syntax=docker/dockerfile:1
ARG VOLTO_VERSION
FROM plone/frontend-builder:${VOLTO_VERSION}

ARG ADDON_NAME
ARG ADDON_PATH

COPY --chown=node:node ./ /app/src/addons/${ADDON_PATH}/

RUN /setupAddon
RUN yarn install

ENTRYPOINT ["yarn"]
CMD ["start"]
83 changes: 66 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
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 @@ -110,11 +116,17 @@ pipeline {

stage('Integration 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 @@ -167,13 +179,19 @@ pipeline {

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 @@ -197,6 +215,37 @@ pipeline {
}
}

stage('SonarQube compare to master') {
when {
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 {
node(label: 'docker') {
script {
sh '''docker pull eeacms/gitflow'''
sh '''echo "Error" > checkresult.txt'''
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
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'''
}

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",
text: readFile(file: 'checkresult.txt'), conclusion: "${currentBuild.currentResult}",
detailsURL: "${env.BUILD_URL}display/redirect"
}
}
}
}

stage('Pull Request') {
when {
not {
Expand Down
Loading

0 comments on commit 4bcfb04

Please sign in to comment.