mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
Compare commits
4 Commits
d6cebddd92
...
4f6e1c121f
Author | SHA1 | Date | |
---|---|---|---|
|
4f6e1c121f | ||
|
438a257fe3 | ||
|
2e88d7d035 | ||
|
b338c33d42 |
@ -1,3 +1,37 @@
|
|||||||
|
include:
|
||||||
|
- template: Security/Container-Scanning.gitlab-ci.yml
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Pipeline stages in order of execution #
|
||||||
|
##############################################################################
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- publish
|
||||||
|
- sca
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Pipeline behavior #
|
||||||
|
##############################################################################
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
# Run the pipeline on commits to the default branch
|
||||||
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
|
variables:
|
||||||
|
# Set the Docker image tag to `latest`
|
||||||
|
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:latest
|
||||||
|
when: always
|
||||||
|
# Run the pipeline on tag creation
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
variables:
|
||||||
|
# Set the Docker image tag to the Git tag name
|
||||||
|
DOCKER_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
||||||
|
when: always
|
||||||
|
# Don't run the pipeline on all other occasions
|
||||||
|
- when: never
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Default values for pipeline jobs #
|
||||||
|
##############################################################################
|
||||||
default:
|
default:
|
||||||
image: docker:24.0.6
|
image: docker:24.0.6
|
||||||
services:
|
services:
|
||||||
@ -5,38 +39,46 @@ default:
|
|||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# CI/CD variables for all jobs in the pipeline #
|
||||||
|
##############################################################################
|
||||||
variables:
|
variables:
|
||||||
DOCKER_TLS_CERTDIR: /certs
|
DOCKER_TLS_CERTDIR: /certs
|
||||||
|
DOCKER_BUILD_PATH: .
|
||||||
|
DOCKERFILE: Dockerfile
|
||||||
|
|
||||||
build_image:
|
##############################################################################
|
||||||
|
# Pipeline jobs #
|
||||||
|
##############################################################################
|
||||||
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
||||||
when: on_success
|
|
||||||
variables:
|
|
||||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
|
|
||||||
- if: $CI_COMMIT_TAG
|
|
||||||
when: "on_success"
|
|
||||||
variables:
|
|
||||||
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
|
|
||||||
- when: never
|
|
||||||
before_script:
|
|
||||||
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
||||||
script:
|
script:
|
||||||
- docker build -t $IMAGE_TAG .
|
- docker build --tag $DOCKER_IMAGE --file $DOCKERFILE $DOCKER_BUILD_PATH
|
||||||
- docker push $IMAGE_TAG
|
- docker save $DOCKER_IMAGE > docker_image.tar
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- docker_image.tar
|
||||||
|
|
||||||
include:
|
publish:
|
||||||
- template: Security/Container-Scanning.gitlab-ci.yml
|
stage: publish
|
||||||
|
before_script:
|
||||||
|
- docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY
|
||||||
|
script:
|
||||||
|
- docker load --input docker_image.tar
|
||||||
|
- docker push $DOCKER_IMAGE
|
||||||
|
after_script:
|
||||||
|
- docker logout $CI_REGISTRY
|
||||||
|
|
||||||
container_scanning:
|
container_scanning:
|
||||||
|
stage: sca
|
||||||
rules:
|
rules:
|
||||||
|
# Run the job on commits to the default branch
|
||||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||||
when: on_success
|
when: always
|
||||||
variables:
|
# Run the job on tag creation
|
||||||
CS_IMAGE: $CI_REGISTRY_IMAGE:latest
|
|
||||||
- if: $CI_COMMIT_TAG
|
- if: $CI_COMMIT_TAG
|
||||||
when: on_success
|
when: always
|
||||||
variables:
|
# Don't run the job on all other occasions
|
||||||
CS_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
|
|
||||||
- when: never
|
- when: never
|
||||||
|
variables:
|
||||||
|
CS_IMAGE: $DOCKER_IMAGE
|
||||||
|
@ -45,7 +45,7 @@ def _create_build_corpus_service(corpus):
|
|||||||
''' ## Constraints ## '''
|
''' ## Constraints ## '''
|
||||||
constraints = ['node.role==worker']
|
constraints = ['node.role==worker']
|
||||||
''' ## Image ## '''
|
''' ## Image ## '''
|
||||||
image = f'{current_app.config["NOPAQUE_DOCKER_IMAGE_PREFIX"]}cwb:r1853'
|
image = f'{current_app.config["NOPAQUE_DOCKER_IMAGE_PREFIX"]}cwb:r1879'
|
||||||
''' ## Labels ## '''
|
''' ## Labels ## '''
|
||||||
labels = {
|
labels = {
|
||||||
'origin': current_app.config['SERVER_NAME'],
|
'origin': current_app.config['SERVER_NAME'],
|
||||||
@ -139,7 +139,7 @@ def _create_cqpserver_container(corpus):
|
|||||||
''' ## Entrypoint ## '''
|
''' ## Entrypoint ## '''
|
||||||
entrypoint = ['bash', '-c']
|
entrypoint = ['bash', '-c']
|
||||||
''' ## Image ## '''
|
''' ## Image ## '''
|
||||||
image = f'{current_app.config["NOPAQUE_DOCKER_IMAGE_PREFIX"]}cwb:r1853'
|
image = f'{current_app.config["NOPAQUE_DOCKER_IMAGE_PREFIX"]}cwb:r1879'
|
||||||
''' ## Name ## '''
|
''' ## Name ## '''
|
||||||
name = f'cqpserver_{corpus.id}'
|
name = f'cqpserver_{corpus.id}'
|
||||||
''' ## Network ## '''
|
''' ## Network ## '''
|
||||||
|
@ -115,6 +115,8 @@ class Config:
|
|||||||
NOPAQUE_READCOOP_USERNAME = os.environ.get('NOPAQUE_READCOOP_USERNAME')
|
NOPAQUE_READCOOP_USERNAME = os.environ.get('NOPAQUE_READCOOP_USERNAME')
|
||||||
NOPAQUE_READCOOP_PASSWORD = os.environ.get('NOPAQUE_READCOOP_PASSWORD')
|
NOPAQUE_READCOOP_PASSWORD = os.environ.get('NOPAQUE_READCOOP_PASSWORD')
|
||||||
|
|
||||||
|
NOPAQUE_VERSION='1.0.0'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def init_app(app: Flask):
|
def init_app(app: Flask):
|
||||||
# Set up logging according to the corresponding (NOPAQUE_LOG_*)
|
# Set up logging according to the corresponding (NOPAQUE_LOG_*)
|
||||||
|
Loading…
Reference in New Issue
Block a user