Skip to content
Snippets Groups Projects
Commit c648388d authored by Daniel Hornung's avatar Daniel Hornung
Browse files

STY DOC: Reordered .gitlab-ci.yml, fixed documentation a bit.

parent b35b950a
No related branches found
No related tags found
No related merge requests found
...@@ -18,23 +18,10 @@ ...@@ -18,23 +18,10 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
variables:
CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-pyinttest/testenv:latest
CI_REGISTRY_IMAGE_BASE: $CI_REGISTRY/caosdb/src/caosdb-pyinttest/base:latest
DEPLOY_REF: dev
stages:
- setup
- cert
- style
- test
- deploy
# During the test stage the CI pipeline (which runs in a "root" docker) starts # During the test stage the CI pipeline (which runs in a "root" docker) starts two docker containers
# two docker containers with docker-compose (one for the caosdb-server, another # with docker-compose (one for the caosdb-server, another for the mysql-backend). Then a third
# for the mysql-backend). Then a third docker is being started which contains # docker is started which contains the pyintest suite and runs the integration tests.
# the pyintest suite and executes it.
# #
# +-------------(root docker)-------------------------+ # +-------------(root docker)-------------------------+
# | | # | |
...@@ -44,8 +31,8 @@ stages: ...@@ -44,8 +31,8 @@ stages:
# | +-(caosdb-server)-------------------+ | # | +-(caosdb-server)-------------------+ |
# | | | | # | | | |
# | | /opt/caosdb | | # | | /opt/caosdb | |
# | .------->| + /git/caosdb-server/scripting/ | | # | .------->| + /git/caosdb-server/authtoken/ | |
# | | .----->| + /git/caosdb-server/authtoken/ | | # | | .----->| + /git/caosdb-server/scripting/ | |
# | | | .--->| + /mnt/extroot | | # | | | .--->| + /mnt/extroot | |
# | | | | .->| + /cert | | # | | | | .->| + /cert | |
# | | | | | | | | # | | | | | | | |
...@@ -79,6 +66,79 @@ stages: ...@@ -79,6 +66,79 @@ stages:
# file-system features. # file-system features.
# #
variables:
CI_REGISTRY_IMAGE: $CI_REGISTRY/caosdb/src/caosdb-pyinttest/testenv:latest
CI_REGISTRY_IMAGE_BASE: $CI_REGISTRY/caosdb/src/caosdb-pyinttest/base:latest
DEPLOY_REF: dev
stages:
- setup
- cert
- style
- test
- deploy
build-testenv:
tags: [cached-dind]
image: docker:19.03
stage: setup
timeout: 2h
only:
- schedules
- web
- pushes
needs: []
script:
- df -h
- command -v wget
- if [ -z "$PYLIB" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if pylib has branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.com/api/v4/projects/13656973/repository/branches/${CI_COMMIT_REF_NAME} ; then
PYLIB=$CI_COMMIT_REF_NAME ;
fi;
fi;
fi;
- PYLIB=${PYLIB:-dev}
- echo $PYLIB
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# use here general latest or specific branch latest...
- docker build
--build-arg PYLIB=${PYLIB}
--file .docker/Dockerfile
-t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
- docker save $CI_REGISTRY_IMAGE > /image-cache/caosdb-pyint-testenv-${CI_COMMIT_REF_NAME}.tar
- cd .docker-base
- docker build
-t $CI_REGISTRY_IMAGE_BASE .
- docker push $CI_REGISTRY_IMAGE_BASE
cert:
tags: [docker]
stage: cert
image: $CI_REGISTRY_IMAGE
artifacts:
paths:
- .docker/cert/
expire_in: 1 week
script:
- cd .docker
- CAOSHOSTNAME=caosdb-server ./cert.sh
style:
tags: [docker]
stage: style
image: $CI_REGISTRY_IMAGE
script:
- autopep8 -r --diff --exit-code .
allow_failure: true
test: test:
tags: [docker] tags: [docker]
services: services:
...@@ -153,63 +213,8 @@ test: ...@@ -153,63 +213,8 @@ test:
- .docker/hash_* - .docker/hash_*
expire_in: 1 week expire_in: 1 week
build-testenv:
tags: [cached-dind]
image: docker:19.03
stage: setup
timeout: 2h
only:
- schedules
- web
- pushes
needs: []
script:
- df -h
- command -v wget
- if [ -z "$PYLIB" ]; then
if echo "$CI_COMMIT_REF_NAME" | grep -c "^f-" ; then
echo "Check if pylib has branch $CI_COMMIT_REF_NAME" ;
if wget https://gitlab.com/api/v4/projects/13656973/repository/branches/${CI_COMMIT_REF_NAME} ; then
PYLIB=$CI_COMMIT_REF_NAME ;
fi;
fi;
fi;
- PYLIB=${PYLIB:-dev}
- echo $PYLIB
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
# use here general latest or specific branch latest...
- docker build
--build-arg PYLIB=${PYLIB}
--file .docker/Dockerfile
-t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
- docker save $CI_REGISTRY_IMAGE > /image-cache/caosdb-pyint-testenv-${CI_COMMIT_REF_NAME}.tar
- cd .docker-base
- docker build
-t $CI_REGISTRY_IMAGE_BASE .
- docker push $CI_REGISTRY_IMAGE_BASE
cert:
tags: [docker]
stage: cert
image: $CI_REGISTRY_IMAGE
artifacts:
paths:
- .docker/cert/
expire_in: 1 week
script:
- cd .docker
- CAOSHOSTNAME=caosdb-server ./cert.sh
style:
tags: [docker]
stage: style
image: $CI_REGISTRY_IMAGE
script:
- autopep8 -r --diff --exit-code .
allow_failure: true
# Deploy: Store working revision combinations to https://caosdb.org/revisions
store-version: store-version:
tags: [docker] tags: [docker]
stage: deploy stage: deploy
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment