Skip to content

Commit

Permalink
2.21.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
logilabteam authored and Katia Saurfelt committed Feb 20, 2023
1 parent 25c7c71 commit da380e1
Show file tree
Hide file tree
Showing 460 changed files with 82,791 additions and 21,926 deletions.
20 changes: 9 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"env": {
"production": {
"presets": [
["env", {
["@babel/preset-react", {
"targets": {
"browsers": ["Firefox >= 48", "Chrome >= 50", "ie >= 9"]
}
Expand All @@ -11,7 +11,7 @@
},
"development": {
"presets": [
["env", {
["@babel/preset-react", {
"targets": {
"browsers": ["last 1 Chrome version", "last 1 Firefox version"]
}
Expand All @@ -20,15 +20,13 @@
},
"test": {
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
]
"@babel/preset-react",
["@babel/preset-env", {
"targets": {
"node": "current"
}
}]
]
}
}
}
}
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ignore hidden files
.*
# except .babelrc, needed to build bundles-*.js by webpack
!.babelrc

*.egg-info
**/__pycache__
Dockerfile
Jenkinsfile
Makefile
tox.ini
deploy
data
test
debian
node_modules
114 changes: 15 additions & 99 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,15 @@
image: python:latest

stages:
- deps
- lint
- test
- qa

cache:
paths:
- node_modules/

# see test/pgfixtures.py that needs these variables
variables:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: siaftest
POSTGRES_PASSWORD: siaftest

flake8:
stage: lint
before_script:
- pip install tox
script: tox -e flake8
allow_failure: true
black:
stage: lint
before_script:
- pip install tox
script: tox -e black
allow_failure: true
dodgy:
stage: lint
before_script:
- pip install tox
script: tox -e dodgy
allow_failure: true
check-manifest:
stage: lint
before_script:
- pip install tox
script: tox -e check-manifest
allow_failure: true

py3:
stage: test
image: python
before_script:
# TODO - move this to an image
- apt update && apt -y install ruby-sass python3-dev npm poppler-utils
- pip install tox
services:
- name: dvainrub/postgres-plpython
- name: docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.1
alias: elasticsearch
command: ['bin/elasticsearch', '-Ediscovery.type=single-node']
script:
- tox -e py37-gitlab-ci

sonarqube:
stage: qa
image: newtmitch/sonar-scanner
only:
- branch/default
script:
- apt install -y python-setuptools
- sonar-scanner
--define sonar.scm.revision=${CI_COMMIT_REF_NAME##*/}
--define sonar.projectBaseDir=.
--define sonar.projectVersion=`python setup.py --version`
--define sonar.scm.provider=hg
--define sonar.host.url=${SONAR_URL}

js-deps:
stage: deps
image: node:latest
script:
- npm install
artifacts:
paths:
- node_modules/

js-format:
stage: lint
image: node:latest
script:
- npm run format

js-lint:
stage: lint
image: node:latest
script:
- npm run lint

js-build:
stage: test
image: node:latest
script:
- npm run build
include:
- project: francearchives/infra
file: gitlab-ci/gitlab-ci.yml
- project: francearchives/infra
file: gitlab-ci/gitlab-ci-consultation.yml

trigger-cms:
stage: livraisoncontinue
only:
- branch/integration
trigger:
project: francearchives/cubicweb-frarchives-edition
branch: branch/integration
strategy: depend
allow_failure: true
7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 100
level: warning
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM python:3.9-alpine AS temp
RUN apk --no-cache add npm
RUN npm install -g sass
COPY . .

RUN npm ci
ENV NODE_ENV="production"
RUN npm run build
RUN sass scss/main.scss:cubicweb_francearchives/data/css/francearchives.bundle.css
RUN python setup.py sdist

FROM logilab/cubicweb-base:bullseye-1.0@sha256:39e0c229d6fff2a96f17451587dd93022bfead40763267448ad17d53383ad671
USER root
RUN apt update && apt -y --no-install-recommends install \
screen \
curl \
poppler-utils \
procps \
wget \
gnupg \
&& rm -rf /var/lib/apt/lists/*
# XXX restart worker after a number of requests (prevent memory leak)
# TODO remove when https://forge.extranet.logilab.fr/cubicweb/docker-cubicweb/-/issues/8 is fixed
RUN echo "max-requests = 128000" >> /etc/uwsgi/uwsgi.ini
# enable stats socket used by uwsgi prometheus exporter
RUN echo "memory-report = true" >> /etc/uwsgi/uwsgi.ini
RUN echo "stats = 127.0.0.1:8001" >> /etc/uwsgi/uwsgi.ini
USER cubicweb
COPY --from=temp dist/cubicweb-francearchives-*.tar.gz .
COPY ./requirements.txt /requirements.txt
RUN pip install --no-cache-dir -r /requirements.txt
RUN pip install cubicweb-francearchives-*.tar.gz
RUN pip install pyramid-session-redis
ENV CUBE=francearchives
ENV CW_DB_NAME=${CUBE}
RUN docker-cubicweb-helper create-instance
USER root
RUN rm /requirements.txt
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get remove -y postgresql-client
RUN apt-get install -y postgresql-client-12
USER cubicweb
34 changes: 0 additions & 34 deletions Jenkinsfile

This file was deleted.

14 changes: 11 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
recursive-include cubicweb_francearchives *.py *.css *.js *.jinja2 *.jpg *.json *.csv *.ttf *.otf *.eot *.svg *.xsl *.xslt *.html *.png *.woff *.woff2 *.xml *.yaml *.txt *.ico .editorconfig .jshintrc *.po *.pot *.scss *.md
recursive-include doc *.html *.rst *.yaml
recursive-include cubicweb_francearchives *.py *.css *.js *.jinja2 *.jpg *.json *.csv *.ttf *.otf *.eot *.svg *.xsl *.xslt *.html *.png *.woff *.woff2 *.xml *.yaml *.txt *.ico .editorconfig .jshintrc *.po *.pot *.scss *.md *.sql
recursive-include doc *.html *.rst *.yaml *.example
recursive-include a11y *.js *.json
recursive-include appjs *.js
include pyproject.toml
Expand All @@ -10,7 +10,7 @@ include LICENCE.txt Licence_CeCILL-C_V1-en.txt
include francearchives_screenshot.jpg
include *.js
include pa11y.json
recursive-include test *.py bootstrap_cubes *.XML *.csv *.jpg *.pdf *.png *.rdf *.rst *.txt *.xml *.xsd ccsv
recursive-include test *.py bootstrap_cubes *.XML *.csv *.jpg *.pdf *.png *.rdf *.rst *.txt *.xml *.xsd ccsv *.json *.ttl
# build from sass
include cubicweb_francearchives/data/css/francearchives.bundle.css
include cubicweb_francearchives/data/css/francearchives.bundle.css.map
Expand All @@ -20,6 +20,7 @@ include cubicweb_francearchives/data/bundle-pnialocation-map.js
include cubicweb_francearchives/data/bundle-pnia-toc.js
include cubicweb_francearchives/data/bundle-pnia-faq.js
include cubicweb_francearchives/data/bundle-glossary.js
include cubicweb_francearchives/data/*.geojson
prune scss
prune debian
exclude gitfilter
Expand All @@ -30,5 +31,12 @@ exclude .prettierrc
exclude .gitlab-ci.yml
exclude .style.yapf
exclude dev-requirements.txt
exclude requirements.txt
exclude tox.ini
exclude .yamllint
exclude Makefile
exclude Makefile.docker
exclude Dockerfile
prune deploy
exclude deploy.sh
exclude env.example
16 changes: 16 additions & 0 deletions Makefile.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version = $(shell hg log -r . -T "{sub(':.*', '', '{latesttag}')}{sub('^-0-.*', '', '-{latesttagdistance}-hg{shortest(node, 7)}')}\n")
tag-version = $(REGISTRY):$(version)
tag-latest = $(REGISTRY):latest

all: build

build:
docker build --pull -t $(tag-version) .

build-nocache:
docker build --pull --no-cache -t $(tag-version) .

push:
docker push $(tag-version)
docker tag $(tag-version) $(tag-latest)
docker push $(tag-latest)
Loading

0 comments on commit da380e1

Please sign in to comment.