Skip to content

Commit

Permalink
Merge pull request #18 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
avoinea committed Sep 29, 2023
2 parents 1b3450b + 68e2fc7 commit 46e3b55
Show file tree
Hide file tree
Showing 18 changed files with 471 additions and 105 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).

### [1.2.2](https://github.com/eea/volto-tags-block/compare/1.2.1...1.2.2) - 29 September 2023

#### :house: Internal changes

- style: lint-staged reorder in package.json [Alin Voinea - [`d05661d`](https://github.com/eea/volto-tags-block/commit/d05661d1f4bf30e07d3590965d13f9026c615790)]

#### :house: Documentation changes

- docs: Update README and DEVELOP [Alin Voinea - [`8940358`](https://github.com/eea/volto-tags-block/commit/894035803b0d8308620b07660a876bc45cbc9c16)]
- docs: Update README and DEVELOP [Alin Voinea - [`4241622`](https://github.com/eea/volto-tags-block/commit/42416226a7e50b977a73730c985db97f7f21ae2e)]
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`d303a3a`](https://github.com/eea/volto-tags-block/commit/d303a3a9260cec568e159797a4562b4ef1cc28e8)]

#### :hammer_and_wrench: Others

- test: EN locales, pre-commit fix, feature PRs checks Refs #257193 [valentinab25 - [`ddfdb53`](https://github.com/eea/volto-tags-block/commit/ddfdb539114cfcf40d877a32dba2530419a02f67)]
- i18n: Add en [Alin Voinea - [`97dbb21`](https://github.com/eea/volto-tags-block/commit/97dbb21a6026fd56004d04dafd839e0c34fb967f)]
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`8da00d2`](https://github.com/eea/volto-tags-block/commit/8da00d21865f4cae997179b18070ea2f8849f185)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`08817e7`](https://github.com/eea/volto-tags-block/commit/08817e756da822194c72c93cf3a37381f19ae857)]
### [1.2.1](https://github.com/eea/volto-tags-block/compare/1.2.0...1.2.1) - 24 July 2023

#### :bug: Bug Fixes
Expand Down
66 changes: 60 additions & 6 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-tags-block.git
cd volto-tags-block
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-tags-block 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,4 +70,37 @@ Before starting make sure your development environment is properly set. See [Vol
1. Happy hacking!

cd src/addons/volto-tags-block/
s/volto-tags-block/

## 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-tags-block` to `mrs.developer.json`

Go to:

```BASH
cd src/addons/volto-tags-block/
```

Start:

```Bash
make
make start
```

This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-tags-block` 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"]
85 changes: 67 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
environment {
GIT_NAME = "volto-tags-block"
NAMESPACE = "@eeacms"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,forest.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,biodiversity.europa.eu,climate-adapt.eea.europa.eu,climate-energy.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-ims,www.eea.europa.eu-en,industry.eea.europa.eu"
SONARQUBE_TAGS = "volto.eea.europa.eu,demo-www.eea.europa.eu,forest.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,biodiversity.europa.eu,climate-adapt.eea.europa.eu,climate-energy.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-ims,www.eea.europa.eu-en,industry.eea.europa.eu,water.europa.eu-freshwater"
DEPENDENCIES = ""
VOLTO = ""
}
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 @@ -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

0 comments on commit 46e3b55

Please sign in to comment.