Skip to content

Commit

Permalink
1.8.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 50afc36 commit bbcc089
Show file tree
Hide file tree
Showing 212 changed files with 23,495 additions and 12,005 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
extends:
- eslint:recommended
- plugin:react/recommended
- prettier
parserOptions:
sourceType: "module"
ecmaVersion: 2018
Expand All @@ -20,7 +21,9 @@ env:
es6: true
node: true
rules:
prettier/prettier: ["error"]
react/no-multi-comp: off
react/display-name: off
react/jsx-indent-props: [2, 4]
react/no-unescaped-entities: 0
object-curly-spacing: ["error", "never"]
Expand All @@ -36,6 +39,6 @@ rules:
no-use-before-define: [2, "nofunc"]
eqeqeq: [1]
comma-dangle: ["error", "always-multiline"]
space-before-function-paren: ["error", "never"]
plugins:
- react
- prettier
140 changes: 37 additions & 103 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,37 @@
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']
- name: redis
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.projectKey=${CI_PROJECT_PATH_SLUG}
--define sonar.projectName=${CI_PROJECT_TITLE}
--define sonar.links.homepage=${CI_PROJECT_URL}
--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-edition.yml

deploy_livraisoncontinue:
environment:
url: https://livraisoncontinue-cms.francearchives.demo.logilab.fr
script:
- ./deploy.sh ../../../env.example

image_build_antivirus:
stage: build
only:
- branch/integration
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile.antivirus
--destination $CI_REGISTRY_IMAGE/antivirus:$CI_COMMIT_HG_SHORT_SHA
--destination $CI_REGISTRY_IMAGE/antivirus:latest
needs: []

image_build_livraisoncontinue:
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--destination $CI_REGISTRY_IMAGE:$CI_COMMIT_HG_SHORT_SHA
--build-arg CONSULTATION_IMAGE=$CI_REGISTRY/francearchives/cubicweb-francearchives
--build-arg CONSULTATION_TAG=latest-integration
3 changes: 3 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
line-length:
max: 100
70 changes: 30 additions & 40 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
FROM python:3.7-alpine AS build

ARG GITLAB_TOKEN
ARG SHA
RUN apk add --no-cache npm curl
FROM python:3.9-alpine AS temp
RUN apk add --no-cache nodejs
RUN apk add --no-cache npm # or use python:3.9 image
RUN apk add build-base
RUN npm install -g sass
WORKDIR /src/francearchives
RUN curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "https://forge.extranet.logilab.fr/api/v4/projects/380/repository/archive?sha=$SHA" | tar -xzf -
RUN mv cubicweb-francearchives-* cubicweb-francearchives
WORKDIR /src/francearchives/cubicweb-francearchives
RUN python ./setup.py sdist

WORKDIR /src/frarchives-edition

COPY package.json .
COPY package-lock.json .

COPY . .
RUN python ./setup.py sdist

FROM logilab/cubicweb:latest
USER root

COPY --from=build \
/src/francearchives/cubicweb-francearchives/dist/cubicweb-francearchives-*.tar.gz \
/src/cubicweb-francearchives.tar.gz
RUN pip install /src/cubicweb-francearchives.tar.gz

COPY --from=build \
/src/frarchives-edition/dist/cubicweb-frarchives-edition-*.tar.gz \
/src/cubicweb-frarchives-edition.tar.gz
RUN pip install /src/cubicweb-frarchives-edition.tar.gz
RUN pip install pyramid-debugtoolbar pyramid-redis-sessions

RUN npm ci
ENV NODE_ENV="production"
RUN npm run build
RUN python setup.py sdist

FROM francearchives/cubicweb-francearchives:2.21.4
ENV CW_INSTANCE=instance
COPY ./requirements.txt /requirements.txt
RUN pip install --no-cache-dir -r /requirements.txt
COPY --from=temp dist/cubicweb-frarchives-edition-*.tar.gz .
# bump version due to incompatibility w/ 9.4.0
# see https://github.com/linkchecker/linkchecker/tree/v10.0.0
# and https://github.com/linkchecker/linkchecker/tree/v10.0.1 for details
RUN pip install beautifulsoup4==4.8.0
RUN pip install Linkchecker==10.0.1
RUN pip install cubicweb-frarchives-edition-*.tar.gz
RUN pip install pyramid-session-redis
ENV PATH=".local/bin:$PATH"
USER cubicweb
ENV CUBE=frarchives_edition
ENV CW_DB_NAME=${CUBE}
ENV CW_ANONYMOUS_USER=anon
ENV CW_ANONYMOUS_PASSWORD=anon
RUN cubicweb-ctl create frarchives_edition instance --automatic --no-db-create
# uncomment option so that cubicweb searches for it in the environment
RUN sed -i "s/^#published-index-name=/published-index-name=/" /etc/cubicweb.d/instance/all-in-one.conf
RUN sed -i "s/^#ead-services-dir=/ead-services-dir=/" /etc/cubicweb.d/instance/all-in-one.conf
RUN sed -i "s/^#=eac-services-dir/=eac-services-dir/" /etc/cubicweb.d/instance/all-in-one.conf
COPY pyramid.ini /etc/cubicweb.d/instance/pyramid.ini
RUN docker-cubicweb-helper create-instance

# FIXME https://forge.extranet.logilab.fr/cubicweb/cubicweb/-/issues/468
RUN echo 'superuser-login=' >> /etc/cubicweb.d/instance/sources
RUN echo 'superuser-password=' >> /etc/cubicweb.d/instance/sources
USER root
RUN rm /requirements.txt
USER cubicweb
62 changes: 0 additions & 62 deletions Jenkinsfile

This file was deleted.

11 changes: 9 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
recursive-include cubicweb_frarchives_edition *.py *.json *.eot *.svg *.ttf *.sql *.map *.woff *.woff2 *.js *.css *.po *.jinja2 *.pt
recursive-include cubicweb_frarchives_edition *.py *.json *.eot *.svg *.ttf *.sql *.map *.woff *.woff2 *.js *.css *.po *.pot *.jinja2 *.pt
recursive-include doc *.rst
include frarchives_edition.jpg
include LICENCE.txt Licence_CeCILL-C_V1-en.txt
Expand All @@ -7,7 +7,8 @@ include package.json
include *.js
include pyproject.toml
recursive-include sphinx *.rst *.bat *.py Makefile
recursive-include test *.csv *.py *.jpg *.pdf *.txt *.xml *.rst *.html
recursive-include test *.csv *.py *.jpg *.pdf *.txt *.xml *.rst *.html *.png
recursive-include cubicweb_frarchives_edition/scripts *.ipynb
include test/data/bootstrap_cubes
prune appjs
prune debian
Expand All @@ -20,9 +21,15 @@ exclude .prettierrc
exclude .gitlab-ci.yml
exclude Makefile
exclude dev-requirements.txt
exclude requirements.txt
exclude gitfilter
exclude tox.ini
exclude Dockerfile
exclude Dockerfile.antivirus
exclude entrypoint.antivirus.sh
exclude .dockerignore
exclude Makefile.docker
exclude pyramid.ini
exclude deploy.sh
exclude env.example
exclude .yamllint
5 changes: 2 additions & 3 deletions Makefile.docker
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
REGISTRY?=r.ext.logilab.fr/francearchives_demo/francearchives_demo
VERSION?=$(shell hg log -r . -T "{sub(':.*', '', '{latesttag}')}{sub('^-0-.*', '', '-{latesttagdistance}-hg{shortest(node, 7)}')}\n")
IMAGE?=$(REGISTRY):$(VERSION)

all: build

build:
docker build --pull -t $(IMAGE) . --build-arg GITLAB_TOKEN=$(GITLAB_TOKEN) --build-arg SHA=$(SHA)
docker build --pull -t $(IMAGE) .

build-nocache:
docker build --pull -t $(IMAGE) . --build-arg GITLAB_TOKEN=$(GITLAB_TOKEN) --build-arg SHA=$(SHA) --no-cache
docker build --pull -t $(IMAGE) . --no-cache

push:
docker push $(IMAGE)
Expand Down
Loading

0 comments on commit bbcc089

Please sign in to comment.