From 7a12333649695f7ef95103e2257a0ef74b0561a1 Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Tue, 6 Oct 2020 15:49:58 +0200 Subject: [PATCH 1/4] start dockerfile with rpm deps --- .gitlab-ci/Dockerfile-rpm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitlab-ci/Dockerfile-rpm diff --git a/.gitlab-ci/Dockerfile-rpm b/.gitlab-ci/Dockerfile-rpm new file mode 100644 index 0000000..4cab7e5 --- /dev/null +++ b/.gitlab-ci/Dockerfile-rpm @@ -0,0 +1,26 @@ +FROM centos:7 + +RUN yum-config-manager --enable centos-sclo-rh && \ + yum-config-manager --add-repo http://fts-repo.web.cern.ch/fts-repo/testing/el7/x86_64/ && \ + yum install epel-release && \ + yum install centos-release-scl && \ + yum install fts-rest-server && \ + yum install fts-rest-client && \ + yum clean all + +RUN yum install python3 git python3-devel openssl-devel swig gcc gcc-c++ make mysql-devel mariadb -y && \ +yum clean all + +# install rpmbuild dependencies +RUN yum install gcc rpm-build rpm-devel rpmlint make coreutils diffutils patch rpmdevtools -y && \ +yum clean all + +RUN useradd --create-home ci + +# create directory for logs +RUN mkdir /var/log/fts3rest +RUN chown ci /var/log/fts3rest + +WORKDIR /home/ci +USER ci + -- GitLab From 83efecbb07b9399be66d2f14469556db088de139 Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Wed, 7 Oct 2020 09:21:55 +0200 Subject: [PATCH 2/4] finish rpm ci image --- .gitlab-ci.yml | 4 ++-- .gitlab-ci/Dockerfile-rpm | 22 +++++++++------------- .gitlab-ci/docker_push.sh | 7 ++++++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d4360b2..7c3ecbd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,6 +51,7 @@ radon: - source .gitlab-ci/radon.sh functional_tests36: + image: gitlab-registry.cern.ch/fts/fts-rest-flask:rpm stage: tests services: - name: centos/mariadb:latest @@ -58,8 +59,7 @@ functional_tests36: script: - python --version - source .gitlab-ci/db.sh - - coverage run --branch --source src/fts3rest/fts3rest/ --omit 'src/fts3rest/fts3rest/tests/*' -m pytest src/ -x - - coverage report + - pytest src/ -x functional_tests37: stage: tests diff --git a/.gitlab-ci/Dockerfile-rpm b/.gitlab-ci/Dockerfile-rpm index 4cab7e5..4213faa 100644 --- a/.gitlab-ci/Dockerfile-rpm +++ b/.gitlab-ci/Dockerfile-rpm @@ -1,24 +1,20 @@ FROM centos:7 -RUN yum-config-manager --enable centos-sclo-rh && \ - yum-config-manager --add-repo http://fts-repo.web.cern.ch/fts-repo/testing/el7/x86_64/ && \ - yum install epel-release && \ - yum install centos-release-scl && \ - yum install fts-rest-server && \ - yum install fts-rest-client && \ +RUN yum-config-manager --enable centos-sclo-rh && \ + yum clean all +RUN yum-config-manager --add-repo http://fts-repo.web.cern.ch/fts-repo/testing/el7/x86_64/ && \ + yum clean all +RUN yum install --nogpgcheck epel-release centos-release-scl -y && \ + yum clean all +RUN yum install --nogpgcheck fts-rest-server fts-rest-client -y && \ yum clean all -RUN yum install python3 git python3-devel openssl-devel swig gcc gcc-c++ make mysql-devel mariadb -y && \ -yum clean all - -# install rpmbuild dependencies -RUN yum install gcc rpm-build rpm-devel rpmlint make coreutils diffutils patch rpmdevtools -y && \ -yum clean all +RUN yum install --nogpgcheck python3 python36-pytest git python3-devel openssl-devel swig gcc gcc-c++ make mysql-devel mariadb \ + -y && yum clean all RUN useradd --create-home ci # create directory for logs -RUN mkdir /var/log/fts3rest RUN chown ci /var/log/fts3rest WORKDIR /home/ci diff --git a/.gitlab-ci/docker_push.sh b/.gitlab-ci/docker_push.sh index 70298a0..2fa08b0 100644 --- a/.gitlab-ci/docker_push.sh +++ b/.gitlab-ci/docker_push.sh @@ -1,8 +1,13 @@ #!/bin/sh # These files are needed for the docker build +echo Building fts-rest-flask:ci ... cp ../pipcompile.sh ../pipsyncdev.sh ../dev-requirements.in ../requirements.in . docker login gitlab-registry.cern.ch/fts/fts-rest-flask -docker build -t gitlab-registry.cern.ch/fts/fts-rest-flask:ci . +docker build -t gitlab-registry.cern.ch/fts/fts-rest-flask:ci . docker push gitlab-registry.cern.ch/fts/fts-rest-flask:ci rm pipcompile.sh pipsyncdev.sh dev-requirements.in requirements.in + +echo Building fts-rest-flask:rpm ... +docker build -t gitlab-registry.cern.ch/fts/fts-rest-flask:rpm . -f ./Dockerfile-rpm +docker push gitlab-registry.cern.ch/fts/fts-rest-flask:rpm \ No newline at end of file -- GitLab From 3da9042120889810f2e115da67f60e0b2a5106ce Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Wed, 7 Oct 2020 09:27:59 +0200 Subject: [PATCH 3/4] fix --- .gitlab-ci.yml | 74 +++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c3ecbd..b1b9366 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,42 +13,42 @@ variables: PYTHONPATH: ./src:./src/fts3rest FTS3TESTCONFIG: ./src/fts3rest/fts3rest/tests/fts3testconfig_ci -black: - # Check that every file has been formatted with black - stage: static_code_analysis - script: - - black --check --fast --target-version py36 src/ - -pylint36: - # Check that every file doesn't have syntax errors - stage: static_code_analysis - script: - - python --version - - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy - -pylint37: - stage: static_code_analysis - script: - - source ~/.bashrc - - pyenv global $PY37 - - source $VENV_37/bin/activate - - python --version - - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy - -pylint38: - stage: static_code_analysis - script: - - source ~/.bashrc - - pyenv global $PY38 - - source $VENV_38/bin/activate - - python --version - - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy - -radon: - # Check metrics for every file - stage: static_code_analysis - script: - - source .gitlab-ci/radon.sh +#black: +# # Check that every file has been formatted with black +# stage: static_code_analysis +# script: +# - black --check --fast --target-version py36 src/ +# +#pylint36: +# # Check that every file doesn't have syntax errors +# stage: static_code_analysis +# script: +# - python --version +# - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy +# +#pylint37: +# stage: static_code_analysis +# script: +# - source ~/.bashrc +# - pyenv global $PY37 +# - source $VENV_37/bin/activate +# - python --version +# - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy +# +#pylint38: +# stage: static_code_analysis +# script: +# - source ~/.bashrc +# - pyenv global $PY38 +# - source $VENV_38/bin/activate +# - python --version +# - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy +# +#radon: +# # Check metrics for every file +# stage: static_code_analysis +# script: +# - source .gitlab-ci/radon.sh functional_tests36: image: gitlab-registry.cern.ch/fts/fts-rest-flask:rpm @@ -59,7 +59,7 @@ functional_tests36: script: - python --version - source .gitlab-ci/db.sh - - pytest src/ -x + - pytest-3 src/ -x functional_tests37: stage: tests -- GitLab From fe24fc1d2f5da1e16fc002360cbe58297dbb8abe Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Wed, 7 Oct 2020 09:34:36 +0200 Subject: [PATCH 4/4] finish --- .gitlab-ci.yml | 74 +++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b1b9366..8473053 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,42 +13,42 @@ variables: PYTHONPATH: ./src:./src/fts3rest FTS3TESTCONFIG: ./src/fts3rest/fts3rest/tests/fts3testconfig_ci -#black: -# # Check that every file has been formatted with black -# stage: static_code_analysis -# script: -# - black --check --fast --target-version py36 src/ -# -#pylint36: -# # Check that every file doesn't have syntax errors -# stage: static_code_analysis -# script: -# - python --version -# - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy -# -#pylint37: -# stage: static_code_analysis -# script: -# - source ~/.bashrc -# - pyenv global $PY37 -# - source $VENV_37/bin/activate -# - python --version -# - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy -# -#pylint38: -# stage: static_code_analysis -# script: -# - source ~/.bashrc -# - pyenv global $PY38 -# - source $VENV_38/bin/activate -# - python --version -# - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy -# -#radon: -# # Check metrics for every file -# stage: static_code_analysis -# script: -# - source .gitlab-ci/radon.sh +black: + # Check that every file has been formatted with black + stage: static_code_analysis + script: + - black --check --fast --target-version py36 src/ + +pylint36: + # Check that every file doesn't have syntax errors + stage: static_code_analysis + script: + - python --version + - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy + +pylint37: + stage: static_code_analysis + script: + - source ~/.bashrc + - pyenv global $PY37 + - source $VENV_37/bin/activate + - python --version + - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy + +pylint38: + stage: static_code_analysis + script: + - source ~/.bashrc + - pyenv global $PY38 + - source $VENV_38/bin/activate + - python --version + - pylint --output-format colorized --disable C,R,W src/ --ignored-modules=sqlalchemy + +radon: + # Check metrics for every file + stage: static_code_analysis + script: + - source .gitlab-ci/radon.sh functional_tests36: image: gitlab-registry.cern.ch/fts/fts-rest-flask:rpm @@ -57,7 +57,7 @@ functional_tests36: - name: centos/mariadb:latest alias: mariadb script: - - python --version + - python3 --version - source .gitlab-ci/db.sh - pytest-3 src/ -x -- GitLab