-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50afc36
commit bbcc089
Showing
212 changed files
with
23,495 additions
and
12,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rules: | ||
line-length: | ||
max: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.