Skip to content

Commit

Permalink
Merge pull request #22 from eea/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
claudiaifrim committed Aug 30, 2023
2 parents 2b819e4 + eceb52b commit 73ab6ff
Show file tree
Hide file tree
Showing 15 changed files with 344 additions and 72 deletions.
1 change: 0 additions & 1 deletion .i18n.babel.config.js

This file was deleted.

32 changes: 29 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ 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).

### [3.0.0](https://github.com/eea/volto-statistic-block/compare/2.0.0...3.0.0) - 28 July 2023
### [3.0.1](https://github.com/eea/volto-statistic-block/compare/3.0.0...3.0.1) - 30 August 2023

#### :house: Internal changes
#### :house: Documentation changes

- docs: add demo gif - refs #253277 [ana-oprea - [`3a5ebbc`](https://github.com/eea/volto-statistic-block/commit/3a5ebbc8a7526170773a9153200aa48dbc7df89e)]
- docs: Cleanup Makefile, update DEVELOP documentation, i18n - refs #254894 [valentinab25 - [`edf24ac`](https://github.com/eea/volto-statistic-block/commit/edf24ac3c8d4516ee6256341f340aa73c0abf0a9)]

#### :hammer_and_wrench: Others

- chore: remove override of RichTextWidget [Miu Razvan - [`31d3b80`](https://github.com/eea/volto-statistic-block/commit/31d3b8084aa50e7d98fb1050cac706408b248a99)]
- i18n: Add en [Alin Voinea - [`8954bbb`](https://github.com/eea/volto-statistic-block/commit/8954bbbe756f8137118f66eaca660d0a6c72986c)]
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`32673cf`](https://github.com/eea/volto-statistic-block/commit/32673cf884a5ce7287a7e7538bd6f04925e98901)]
- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`01d3c56`](https://github.com/eea/volto-statistic-block/commit/01d3c56518d46a051e4793573a4660ddbd431808)]
## [3.0.0](https://github.com/eea/volto-statistic-block/compare/2.0.0...3.0.0) - 29 July 2023

#### :hammer_and_wrench: Others

Expand Down Expand Up @@ -38,6 +46,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :house: Internal changes

- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`3dc3490`](https://github.com/eea/volto-statistic-block/commit/3dc34908cf22514318c3fd737d517c8261da7fd4)]

#### :hammer_and_wrench: Others

Expand All @@ -62,16 +71,30 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

- use countup.js@2.5.0 [Miu Razvan - [`9dad099`](https://github.com/eea/volto-statistic-block/commit/9dad099fb6519688752bf4788023712bd9719671)]
- bump version [Miu Razvan - [`e886513`](https://github.com/eea/volto-statistic-block/commit/e886513e63bf480dcdb5c9e0a627b31c6b4e989d)]
- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`7cf6d5b`](https://github.com/eea/volto-statistic-block/commit/7cf6d5b1427a9f17bb1c740d019130e323668286)]
### [1.1.0](https://github.com/eea/volto-statistic-block/compare/1.0.1...1.1.0) - 27 March 2023

#### :hammer_and_wrench: Others

- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`1ecdcec`](https://github.com/eea/volto-statistic-block/commit/1ecdcec0ef98c891d9157db9592365fc10760b59)]
- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`e5f76cc`](https://github.com/eea/volto-statistic-block/commit/e5f76cc8f90dfa21ba1f2bb25b2491ae0e1b102d)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`439ba7f`](https://github.com/eea/volto-statistic-block/commit/439ba7f0016eb5ba86ef267309e0ddef7b81f379)]
- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`1e72601`](https://github.com/eea/volto-statistic-block/commit/1e72601f1f9a7e8023c9130407d9ce28f1d7b6f9)]
- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`9ab65ad`](https://github.com/eea/volto-statistic-block/commit/9ab65ad0f5b300a14590f5f260659749f4831956)]
- test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`75e506f`](https://github.com/eea/volto-statistic-block/commit/75e506fd7cf92296871ddf52f9b1c82a053ec931)]
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`9297e9f`](https://github.com/eea/volto-statistic-block/commit/9297e9fb8a638a1564d7d7a6d2ebbea0056d775e)]
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`6dde4aa`](https://github.com/eea/volto-statistic-block/commit/6dde4aae3c87bfe434a28719479e37078db11099)]
- yarn 3 [Alin Voinea - [`b4949e1`](https://github.com/eea/volto-statistic-block/commit/b4949e18f23a7965c76ef97a5790607a587987dc)]
- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`8820afa`](https://github.com/eea/volto-statistic-block/commit/8820afa4ab8fcebd17e90522196c1fde8b246e21)]
- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`8eb5b8d`](https://github.com/eea/volto-statistic-block/commit/8eb5b8de3f87152cb57faeb960233791b328c900)]
- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`58f36bd`](https://github.com/eea/volto-statistic-block/commit/58f36bd4ae9dcdccbef182789957dbf0bb97da74)]
- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`3bb9a21`](https://github.com/eea/volto-statistic-block/commit/3bb9a2128a88c1196258722112a1957f60d332fc)]
### [1.0.1](https://github.com/eea/volto-statistic-block/compare/1.0.0...1.0.1) - 16 November 2022

#### :hammer_and_wrench: Others

- test(estlint): Fix .project.eslintrc.js [Alin Voinea - [`d81878f`](https://github.com/eea/volto-statistic-block/commit/d81878fff2ba1be4446dd330560c46d8161f8bc2)]
- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`a58f436`](https://github.com/eea/volto-statistic-block/commit/a58f436c5bb052fcdd13b213895c497881e48c67)]
## [1.0.0](https://github.com/eea/volto-statistic-block/compare/0.3.0...1.0.0) - 28 October 2022

#### :nail_care: Enhancements
Expand All @@ -83,6 +106,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- Cleanup [Alin Voinea - [`6d5f4a6`](https://github.com/eea/volto-statistic-block/commit/6d5f4a6d8048689e97e567316f24902d0865de88)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`5fd7ba7`](https://github.com/eea/volto-statistic-block/commit/5fd7ba7a4595e157bdb0ebb0932f1d3afd64b369)]
### [0.3.0](https://github.com/eea/volto-statistic-block/compare/0.2.0...0.3.0) - 19 September 2022

#### :nail_care: Enhancements
Expand Down Expand Up @@ -113,6 +137,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### :hammer_and_wrench: Others

- Remove useless from block title [Alin Voinea - [`a3daf0a`](https://github.com/eea/volto-statistic-block/commit/a3daf0ad63666d0cd87eef465f42f525a5a307bc)]
- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`4a9ea35`](https://github.com/eea/volto-statistic-block/commit/4a9ea35d0717941e9d96a29e46dc85717140fccf)]
### [0.1.1](https://github.com/eea/volto-statistic-block/compare/0.1.0...0.1.1) - 10 March 2022

#### :hammer_and_wrench: Others
Expand All @@ -123,4 +148,5 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### :hammer_and_wrench: Others

- yarn bootstrap [Alin Voinea - [`ba85706`](https://github.com/eea/volto-statistic-block/commit/ba857067b16dc04f9bc970b0c0d4afd479bb7528)]
- Initial commit [Alin Voinea - [`2e19fe2`](https://github.com/eea/volto-statistic-block/commit/2e19fe2708f89887d2d79f88696e197643ea10f4)]
56 changes: 56 additions & 0 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

## Develop

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

```Bash
git clone https://github.com/eea/volto-statistic-block.git
cd volto-statistic-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. Happy hacking!

```Bash
cd src/addons/volto-statistic-block/
```

### Or add @eeacms/volto-statistic-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 Down Expand Up @@ -49,3 +71,37 @@ Before starting make sure your development environment is properly set. See [Vol
1. Happy hacking!

cd src/addons/volto-statistic-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-statistic-block` to `mrs.developer.json`

Go to:

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

Start:

```Bash
make
make start
```

This will build and start with Docker a clean `Plone backend` and `Volto Frontend` with `volto-statistic-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"]
27 changes: 26 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
environment {
GIT_NAME = "volto-statistic-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 @@ -197,6 +197,31 @@ pipeline {
}
}

stage('SonarQube compare to master') {
when {
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
134 changes: 84 additions & 50 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,54 +1,95 @@
SHELL=/bin/bash
##############################################################################
# Run:
# make
# make start
#
# Go to:
#
# http://localhost:3000
#
# Cypress:
#
# make cypress-open
#
##############################################################################
# SETUP MAKE
#
## Defensive settings for make: https://tech.davis-hansson.com/p/make/
SHELL:=bash
.ONESHELL:
# for Makefile debugging purposes add -x to the .SHELLFLAGS
.SHELLFLAGS:=-eu -o pipefail -O inherit_errexit -c
.SILENT:
.DELETE_ON_ERROR:
MAKEFLAGS+=--warn-undefined-variables
MAKEFLAGS+=--no-builtin-rules

# Colors
# OK=Green, warn=yellow, error=red
ifeq ($(TERM),)
# no colors if not in terminal
MARK_COLOR=
OK_COLOR=
WARN_COLOR=
ERROR_COLOR=
NO_COLOR=
else
MARK_COLOR=`tput setaf 6`
OK_COLOR=`tput setaf 2`
WARN_COLOR=`tput setaf 3`
ERROR_COLOR=`tput setaf 1`
NO_COLOR=`tput sgr0`
endif

##############################################################################
# SETTINGS AND VARIABLE
DIR=$(shell basename $$(pwd))
ADDON ?= "@eeacms/volto-statistic-block"

# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
RED=`tput setaf 1`
GREEN=`tput setaf 2`
RESET=`tput sgr0`
YELLOW=`tput setaf 3`
NODE_MODULES?="../../../node_modules"
PLONE_VERSION?=6
VOLTO_VERSION?=16
ADDON_PATH="${DIR}"
ADDON_NAME="@eeacms/${ADDON_PATH}"
DOCKER_COMPOSE=PLONE_VERSION=${PLONE_VERSION} VOLTO_VERSION=${VOLTO_VERSION} ADDON_NAME=${ADDON_NAME} ADDON_PATH=${ADDON_PATH} docker compose

# Top-level targets
.PHONY: all
all: clean install

.PHONY: clean
clean: ## Cleanup development environment
${DOCKER_COMPOSE} down --volumes --remove-orphans

.PHONY: install
install: ## Build and install development environment
echo "Running: ${DOCKER_COMPOSE} build"
${DOCKER_COMPOSE} pull
${DOCKER_COMPOSE} build

.PHONY: start
start: ## Start development environment
echo "Running: ${DOCKER_COMPOSE} up"
${DOCKER_COMPOSE} up

.PHONY: shell
shell: ## Start a shell in the frontend container
echo "Running: ${DOCKER_COMPOSE} run frontend bash"
${DOCKER_COMPOSE} run --entrypoint=bash frontend

ifeq ($(wildcard ./project),)
NODE_MODULES = "../../../node_modules"
else
NODE_MODULES = "./project/node_modules"
endif
.PHONY: cypress-open
cypress-open: ## Open cypress integration tests
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open

project:
npm install -g yo
npm install -g @plone/generator-volto
npm install -g mrs-developer
yo @plone/volto project --addon ${ADDON} --workspace "src/addons/${DIR}" --no-interactive
ln -sf $$(pwd) project/src/addons/
cp .project.eslintrc.js .eslintrc.js
cd project && yarn
@echo "-------------------"
@echo "$(GREEN)Volto project is ready!$(RESET)"
@echo "$(RED)Now run: cd project && yarn start$(RESET)"

all: project

.PHONY: start-test-backend
start-test-backend: ## Start Test Plone Backend
@echo "$(GREEN)==> Start Test Plone Backend$(RESET)"
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

.PHONY: start-backend-docker
start-backend-docker: ## Starts a Docker-based backend
@echo "$(GREEN)==> Start Docker-based Plone Backend$(RESET)"
docker run -it --rm --name=plone -p 8080:8080 -e SITE=Plone -e ADDONS="kitconcept.volto" -e ZCML="kitconcept.volto.cors" plone
.PHONY: cypress-run
cypress-run: ## Run cypress integration tests
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run

.PHONY: test
test: ## Run jest tests
docker pull plone/volto-addon-ci:alpha
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}" -e CI="true" plone/volto-addon-ci:alpha
${DOCKER_COMPOSE} run -e CI=1 frontend test

.PHONY: test-update
test-update: ## Update jest tests snapshots
docker pull plone/volto-addon-ci:alpha
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}" -e CI="true" plone/volto-addon-ci:alpha yarn test src/addons/${DIR}/src --watchAll=false -u
${DOCKER_COMPOSE} run -e CI=1 frontend test -u

.PHONY: stylelint
stylelint: ## Stylelint
Expand Down Expand Up @@ -84,14 +125,7 @@ i18n: ## i18n
rm -rf build/messages
NODE_ENV=development $(NODE_MODULES)/.bin/i18n --addon

.PHONY: cypress-run
cypress-run: ## Run cypress integration tests
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress run

.PHONY: cypress-open
cypress-open: ## Open cypress integration tests
NODE_ENV=development $(NODE_MODULES)/cypress/bin/cypress open

.PHONY: help
help: ## Show this help.
help: ## Show this help.
@echo -e "$$(grep -hE '^\S+:.*##' $(MAKEFILE_LIST) | sed -e 's/:.*##\s*/:/' -e 's/^\(.\+\):\(.*\)/\\x1b[36m\1\\x1b[m:\2/' | column -c2 -t -s :)"
head -n 14 Makefile
Loading

0 comments on commit 73ab6ff

Please sign in to comment.