mirror of
https://github.com/OpenCTI-Platform/opencti.git
synced 2025-12-22 08:17:08 +00:00
687 lines
26 KiB
YAML
687 lines
26 KiB
YAML
---
|
|
kind: pipeline
|
|
name: opencti-tests
|
|
|
|
steps:
|
|
- name: Runner information
|
|
image: alpine:3.23
|
|
commands:
|
|
- echo DRONE_STAGE_MACHINE ${DRONE_STAGE_MACHINE}
|
|
|
|
- name: dependencies-checkout
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
environment:
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
commands:
|
|
# copy opencti-platform without nodes_modules
|
|
- cp -R opencti-platform platform-reference
|
|
- apk add git github-cli
|
|
- chmod 777 scripts/*
|
|
- ./scripts/clone-dependencies.sh "${DRONE_SOURCE_BRANCH}" "${DRONE_TARGET_BRANCH}" "$(pwd)" "${DRONE_PULL_REQUEST}"
|
|
- ls -lart
|
|
|
|
- name: backend-verify-licenses
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-backend-verify-licenses-yarn
|
|
path: /root/.yarn/berry
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- apk add build-base git libffi-dev cargo
|
|
- pip3 install --upgrade setuptools
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd "$DRONE_WORKSPACE/opencti-platform/opencti-graphql"
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn verify-licenses
|
|
depends_on:
|
|
- dependencies-checkout
|
|
|
|
- name: frontend-verify-licenses
|
|
image: node:22.21.1
|
|
volumes:
|
|
- name: cache-frontend-verify-licenses-yarn
|
|
path: /root/.yarn/berry
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- cd ./opencti-platform/opencti-front
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn verify-licenses
|
|
depends_on:
|
|
- dependencies-checkout
|
|
|
|
- name: generate-licenses
|
|
image: node:22.21.1
|
|
commands:
|
|
- chmod 777 scripts/*
|
|
- ./scripts/generate-licenses.sh
|
|
- test -f ./licenses/third-party-licenses.txt
|
|
depends_on:
|
|
- backend-verify-licenses
|
|
- frontend-verify-licenses
|
|
|
|
- name: api-tests
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-api-tests-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__BASE_URL: http://api-tests:4010/
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__CHILD_LOCKING_PROCESS__ENABLED: false
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
APP__SYNC_RAW_START_REMOTE_URI: http://opencti-raw-start:4100/graphql
|
|
APP__SYNC_LIVE_START_REMOTE_URI: http://opencti-live-start:4200/graphql
|
|
APP__SYNC_DIRECT_START_REMOTE_URI: http://opencti-direct-start:4300/graphql
|
|
APP__SYNC_RESTORE_START_REMOTE_URI: http://opencti-restore-start:4400/graphql
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
REDIS__HOSTNAME: redis
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
MINIO__ENDPOINT: minio
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
PYTHONUNBUFFERED: 1
|
|
commands:
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- apk add build-base git libffi-dev cargo
|
|
- pip3 install --upgrade setuptools
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd "$DRONE_WORKSPACE/opencti-platform/opencti-graphql"
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn build
|
|
- yarn check-ts
|
|
- yarn lint
|
|
- if [ $(wget --server-response "http://opencti-raw-start:4100/health?health_access_key=cihealthkey" -O opencti-raw-start-health 2>&1 | grep -c "200 OK") != 1 ]; then echo "ERROR opencti-raw-start has not start correctly"; exit 1; fi
|
|
- if [ $(wget --server-response "http://opencti-live-start:4200/health?health_access_key=cihealthkey" -O opencti-live-start-health 2>&1 | grep -c "200 OK") != 1 ]; then echo "ERROR opencti-live-start has not start correctly"; exit 1; fi
|
|
- if [ $(wget --server-response "http://opencti-direct-start:4300/health?health_access_key=cihealthkey" -O opencti-direct-start 2>&1 | grep -c "200 OK") != 1 ]; then echo "ERROR opencti-direct-start has not start correctly"; exit 1; fi
|
|
- if [ $(wget --server-response "http://opencti-restore-start:4400/health?health_access_key=cihealthkey" -O opencti-restore-start 2>&1 | grep -c "200 OK") != 1 ]; then echo "ERROR opencti-restore-start has not start correctly"; exit 1; fi
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn test
|
|
depends_on:
|
|
- dependencies-checkout
|
|
- generate-licenses
|
|
|
|
- name: api-coverage
|
|
image: plugins/codecov
|
|
failure: ignore
|
|
settings:
|
|
flags:
|
|
- opencti
|
|
- opencti-graphql
|
|
token:
|
|
from_secret: codecov_token
|
|
paths:
|
|
- opencti-platform/opencti-graphql/coverage
|
|
depends_on:
|
|
- api-tests
|
|
|
|
- name: frontend-tests
|
|
image: node:22-alpine
|
|
volumes:
|
|
- name: cache-frontend-tests-yarn
|
|
path: /root/.yarn/berry
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- apk add git tini gcc g++ make musl-dev cargo python3 python3-dev postfix postfix-pcre
|
|
- npm install -g node-gyp
|
|
- cd opencti-platform/opencti-front
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn build
|
|
- yarn check-ts
|
|
- yarn lint
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn test:coverage
|
|
depends_on:
|
|
- generate-licenses
|
|
|
|
- name: frontend-e2e-tests
|
|
image: node:22.21.1
|
|
volumes:
|
|
- name: cache-frontend-e2e-tests-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
BACK_END_URL: http://opencti-e2e-start:4500
|
|
E2E_TEST: true
|
|
TEAMS_WEBHOOK: teams-webhook-url
|
|
ipc: host
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- apt-get update
|
|
- apt-get -y install netcat-traditional
|
|
- cd opencti-platform/opencti-front
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- npx playwright install --with-deps chromium
|
|
- yarn build
|
|
- yarn test:e2e
|
|
depends_on:
|
|
- frontend-tests
|
|
|
|
- name: frontend-coverage
|
|
image: plugins/codecov
|
|
settings:
|
|
flags:
|
|
- opencti
|
|
- opencti-front
|
|
token:
|
|
from_secret: codecov_token
|
|
paths:
|
|
- opencti-platform/opencti-front/coverage/unit
|
|
depends_on:
|
|
- frontend-tests
|
|
|
|
- name: upload-build-artefact
|
|
image: node:22.21.1
|
|
failure: ignore
|
|
when:
|
|
status:
|
|
- failure
|
|
- success
|
|
environment:
|
|
JFROG_TOKEN:
|
|
from_secret: jfrog_token
|
|
JFROG_BUILD_NAME: opencti-build
|
|
JFROG_REPOSITORY: opencti-drone
|
|
JFROG_URL: https://filigran.jfrog.io/artifactory
|
|
commands:
|
|
- apt-get update
|
|
# see https://docs.jfrog-applications.jfrog.io/jfrog-applications/jfrog-cli/cli-for-jfrog-artifactory
|
|
- npm install -g jfrog-cli-v2-jf
|
|
# Collect git info
|
|
- jf rt bag $JFROG_BUILD_NAME $DRONE_BUILD_NUMBER
|
|
# Archive and upload each artefact that we need, if folder are present.
|
|
- test -d opencti-platform/opencti-front/test-results && tar -czvf frontend-test-results-$DRONE_BUILD_NUMBER.tar.gz opencti-platform/opencti-front/test-results
|
|
- test -d opencti-platform/opencti-front/test-results && jf rt u frontend-test-results-$DRONE_BUILD_NUMBER.tar.gz $JFROG_REPOSITORY --build-name=$JFROG_BUILD_NAME --build-number=$DRONE_BUILD_NUMBER --url=$JFROG_URL --access-token=$JFROG_TOKEN
|
|
- test -d opencti-platform/opencti-graphql/test-results && tar -czvf backend-test-results-$DRONE_BUILD_NUMBER.tar.gz opencti-platform/opencti-graphql/test-results
|
|
- test -d opencti-platform/opencti-graphql/test-results && jf rt u backend-test-results-$DRONE_BUILD_NUMBER.tar.gz $JFROG_REPOSITORY --build-name=$JFROG_BUILD_NAME --build-number=$DRONE_BUILD_NUMBER --url=$JFROG_URL --access-token=$JFROG_TOKEN
|
|
# Next line should be done only once at the end: it's recording and gathering build info
|
|
- jf rt bp $JFROG_BUILD_NAME $DRONE_BUILD_NUMBER --url=$JFROG_URL --access-token=$JFROG_TOKEN --build-url=$DRONE_BUILD_LINK
|
|
# Cleaning up old build in JFrog
|
|
- jf rt bdi $JFROG_BUILD_NAME --max-days=30 --url=$JFROG_URL --access-token=$JFROG_TOKEN
|
|
depends_on:
|
|
- frontend-e2e-tests
|
|
- api-tests
|
|
|
|
- name: frontend-verify-translation
|
|
image: node:22.21.1
|
|
commands:
|
|
- cd opencti-platform/opencti-front
|
|
- node script/verify-translation.js
|
|
|
|
- name: client-test-39
|
|
image: python:3.9
|
|
environment:
|
|
OPENCTI_API_URL: http://opencti-pycti-start:4600
|
|
OPENCTI_API_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
commands:
|
|
- cd client-python
|
|
- pip3 install -r requirements.txt --user
|
|
- pip3 install -r test-requirements.txt --user
|
|
- sleep 180
|
|
- python3 -m pytest --no-header -vv --disable-warnings --cov=pycti --drone
|
|
depends_on:
|
|
- dependencies-checkout
|
|
|
|
- name: client-test-310
|
|
image: python:3.10
|
|
environment:
|
|
OPENCTI_API_URL: http://opencti-pycti-start:4600
|
|
OPENCTI_API_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
commands:
|
|
- cd client-python
|
|
- pip3 install -r requirements.txt --user
|
|
- pip3 install -r test-requirements.txt --user
|
|
# - sleep 180
|
|
- python3 -m pytest --no-header -vv --disable-warnings --cov=pycti --drone
|
|
depends_on:
|
|
- client-test-39
|
|
|
|
- name: client-test-311
|
|
image: python:3.11
|
|
environment:
|
|
OPENCTI_API_URL: http://opencti-pycti-start:4600
|
|
OPENCTI_API_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
commands:
|
|
- cd client-python
|
|
- pip3 install -r requirements.txt --user
|
|
- pip3 install -r test-requirements.txt --user
|
|
# - sleep 180
|
|
- python3 -m pytest --no-header -vv --disable-warnings --cov=pycti --drone
|
|
depends_on:
|
|
- client-test-310
|
|
|
|
- name: client-test-312
|
|
image: python:3.12
|
|
environment:
|
|
OPENCTI_API_URL: http://opencti-pycti-start:4600
|
|
OPENCTI_API_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
commands:
|
|
- cd client-python
|
|
- pip3 install -r requirements.txt --user
|
|
- pip3 install -r test-requirements.txt --user
|
|
# - sleep 180
|
|
- python3 -m pytest --no-header -vv --disable-warnings --cov=pycti --drone
|
|
depends_on:
|
|
- client-test-311
|
|
|
|
# always run the examples last since they don't clean up
|
|
# ---------> already done in Github Actions
|
|
- name: pycti-example-tests
|
|
image: python:3.12
|
|
environment:
|
|
OPENCTI_API_URL: http://opencti-pycti-start:4600
|
|
OPENCTI_API_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
commands:
|
|
- cd client-python
|
|
- pip3 install -r requirements.txt --user
|
|
- pip3 install .
|
|
- cd examples/
|
|
- /bin/bash run_all.sh
|
|
depends_on:
|
|
- client-test-312
|
|
|
|
- name: slack
|
|
image: plugins/slack
|
|
settings:
|
|
webhook:
|
|
from_secret: slack_webhook
|
|
username: drone
|
|
channel: notifications
|
|
when:
|
|
status: [success, failure]
|
|
depends_on:
|
|
- api-tests
|
|
- frontend-tests
|
|
- frontend-e2e-tests
|
|
|
|
services:
|
|
- name: redis
|
|
image: redis:8.4.0
|
|
- name: elastic
|
|
image: elasticsearch:8.19.8
|
|
environment:
|
|
discovery.type: single-node
|
|
xpack.security.enabled: false
|
|
ES_JAVA_OPTS: -Xms2g -Xmx2g
|
|
- name: minio
|
|
image: minio/minio:RELEASE.2025-06-13T11-33-47Z
|
|
environment:
|
|
MINIO_ROOT_USER: ChangeMe
|
|
MINIO_ROOT_PASSWORD: ChangeMe
|
|
command: [server, /data]
|
|
- name: rabbitmq
|
|
image: rabbitmq:4.2.1-management
|
|
|
|
- name: opencti-raw-start
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-opencti-raw-start-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__PORT: 4100
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__ENABLED_DEV_FEATURES: '["*"]'
|
|
APP__CHILD_LOCKING_PROCESS__ENABLED: true
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
APP__APP_LOG__EXTENDED_ERROR_MESSAGE: true
|
|
APP__HEALTH_ACCESS_KEY: cihealthkey
|
|
REDIS__HOSTNAME: redis
|
|
REDIS__NAMESPACE: raw-start
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
ELASTICSEARCH__INDEX_PREFIX: raw-start
|
|
MINIO__ENDPOINT: minio
|
|
MINIO__BUCKET_NAME: raw-start-bucket
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
RABBITMQ__QUEUE_PREFIX: raw-start
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- sleep 10
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- ls -lart
|
|
- apk add build-base git libffi-dev cargo
|
|
- mkdir -p /tmp/raw-start-platform/
|
|
- cp -a $DRONE_WORKSPACE/platform-reference/* /tmp/raw-start-platform/
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd /tmp/raw-start-platform/opencti-graphql
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn install:python
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
|
|
|
|
- name: opencti-live-start
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-opencti-live-start-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__PORT: 4200
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__ENABLED_DEV_FEATURES: '["*"]'
|
|
APP__CHILD_LOCKING_PROCESS__ENABLED: true
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
APP__APP_LOG__EXTENDED_ERROR_MESSAGE: true
|
|
APP__HEALTH_ACCESS_KEY: cihealthkey
|
|
REDIS__HOSTNAME: redis
|
|
REDIS__NAMESPACE: live-start
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
ELASTICSEARCH__INDEX_PREFIX: live-start
|
|
MINIO__ENDPOINT: minio
|
|
MINIO__BUCKET_NAME: live-start-bucket
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
RABBITMQ__QUEUE_PREFIX: live-start
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- sleep 10
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- apk add build-base git libffi-dev cargo
|
|
- mkdir -p /tmp/live-start-platform/
|
|
- cp -a $DRONE_WORKSPACE/platform-reference/* /tmp/live-start-platform/
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd /tmp/live-start-platform/opencti-graphql
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn install:python
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
|
|
|
|
- name: opencti-direct-start
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-opencti-direct-start-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__PORT: 4300
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__ENABLED_DEV_FEATURES: '["*"]'
|
|
APP__CHILD_LOCKING_PROCESS__ENABLED: true
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
APP__APP_LOG__EXTENDED_ERROR_MESSAGE: true
|
|
APP__HEALTH_ACCESS_KEY: cihealthkey
|
|
REDIS__HOSTNAME: redis
|
|
REDIS__NAMESPACE: direct-start
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
ELASTICSEARCH__INDEX_PREFIX: direct-start
|
|
MINIO__ENDPOINT: minio
|
|
MINIO__BUCKET_NAME: direct-start-bucket
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
RABBITMQ__QUEUE_PREFIX: direct-start
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- sleep 10
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- apk add build-base git libffi-dev cargo
|
|
- mkdir -p /tmp/direct-start-platform/
|
|
- cp -a $DRONE_WORKSPACE/platform-reference/* /tmp/direct-start-platform/
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd /tmp/direct-start-platform/opencti-graphql
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn install:python
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
|
|
|
|
- name: opencti-direct-worker
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
environment:
|
|
OPENCTI_URL: http://opencti-direct-start:4300
|
|
OPENCTI_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
WORKER_LOG_LEVEL: info
|
|
commands:
|
|
- sleep 10
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- apk add build-base git libffi-dev cargo
|
|
- cp -a opencti-worker /tmp/direct-start-worker
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- while ! nc -z opencti-direct-start 4300 ; do sleep 1 ; done
|
|
- cd /tmp/direct-start-worker
|
|
# Remove pycti as it is already installed and can conflict
|
|
- sed -i '/^pycti==/d' src/requirements.txt
|
|
- pip3 install -r src/requirements.txt
|
|
- python3 src/worker.py
|
|
|
|
- name: opencti-test-worker
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
environment:
|
|
OPENCTI_URL: http://api-tests:4010
|
|
OPENCTI_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
WORKER_LOG_LEVEL: info
|
|
commands:
|
|
- sleep 10
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- cp -a opencti-worker /tmp/opencti-test-worker
|
|
- apk add build-base git libffi-dev cargo
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- echo "[INFO] using client-python on branch $(git branch --show-current)"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- while ! nc -z api-tests 4010 ; do sleep 1 ; done
|
|
- cd /tmp/opencti-test-worker
|
|
- pip install -r src/requirements.txt
|
|
- python3 src/worker.py
|
|
|
|
- name: opencti-restore-start
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-opencti-restore-start-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__PORT: 4400
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__ENABLED_DEV_FEATURES: '["*"]'
|
|
APP__CHILD_LOCKING_PROCESS__ENABLED: true
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
APP__APP_LOG__EXTENDED_ERROR_MESSAGE: true
|
|
APP__HEALTH_ACCESS_KEY: cihealthkey
|
|
REDIS__HOSTNAME: redis
|
|
REDIS__NAMESPACE: restore-start
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
ELASTICSEARCH__INDEX_PREFIX: restore-start
|
|
MINIO__ENDPOINT: minio
|
|
MINIO__BUCKET_NAME: restore-start-bucket
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
RABBITMQ__QUEUE_PREFIX: restore-start
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- sleep 10
|
|
- if [ -f $DRONE_WORKSPACE/api-test.skip ]; then echo "API TESTS ARE SKIPPED" ; exit 0; fi
|
|
- apk add build-base git libffi-dev cargo
|
|
- mkdir -p /tmp/restore-start-platform/
|
|
- cp -a $DRONE_WORKSPACE/platform-reference/* /tmp/restore-start-platform/
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd /tmp/restore-start-platform/opencti-graphql
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn install:python
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
|
|
|
|
- name: opencti-e2e-start
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-opencti-e2e-start-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__PORT: 4500
|
|
APP__ENABLED_DEV_FEATURES: '["*"]'
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__CHILD_LOCKING_PROCESS__ENABLED: true
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
APP__APP_LOG__EXTENDED_ERROR_MESSAGE: true
|
|
APP__HEALTH_ACCESS_KEY: cihealthkey
|
|
REDIS__HOSTNAME: redis
|
|
REDIS__NAMESPACE: e2e-start
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
ELASTICSEARCH__INDEX_PREFIX: e2e-start
|
|
MINIO__ENDPOINT: minio
|
|
MINIO__BUCKET_NAME: e2e-start-bucket
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
RABBITMQ__QUEUE_PREFIX: e2e-start
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
PUBLISHER_MANAGER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- sleep 10
|
|
- apk add build-base git libffi-dev cargo
|
|
- mkdir -p /tmp/e2e-start-platform/
|
|
- cp -a $DRONE_WORKSPACE/platform-reference/* /tmp/e2e-start-platform/
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd /tmp/e2e-start-platform/opencti-graphql
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn install:python
|
|
- BRANCH=$(echo $DRONE_COMMIT_BRANCH | cut -d "/" -f 2)
|
|
- yarn build:dev
|
|
- yarn wait-api && node build/script-insert-dataset.js --datasets=DATA-TEST-STIX2_v2,data-test-stix-e2e,poisonivy &
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
|
|
|
|
- name: opencti-e2e-worker
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
environment:
|
|
OPENCTI_URL: http://opencti-e2e-start:4500
|
|
OPENCTI_TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
WORKER_LOG_LEVEL: info
|
|
commands:
|
|
- sleep 10
|
|
- cp -a opencti-worker /tmp/opencti-e2e-worker
|
|
- apk add build-base git libffi-dev cargo
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- echo "[INFO] using client-python on branch $(git branch --show-current)"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- while ! nc -z opencti-e2e-start 4500 ; do sleep 1 ; done
|
|
- cd /tmp/opencti-e2e-worker
|
|
- pip install -r src/requirements.txt
|
|
- python3 src/worker.py
|
|
|
|
- name: opencti-pycti-start
|
|
image: nikolaik/python-nodejs:python3.11-nodejs22-alpine
|
|
volumes:
|
|
- name: cache-opencti-pycti-start-yarn
|
|
path: /root/.yarn/berry
|
|
environment:
|
|
APP__PORT: 4600
|
|
APP__HEALTH_ACCESS_KEY: cihealthkey
|
|
APP__ADMIN__PASSWORD: admin
|
|
APP__ADMIN__TOKEN: bfa014e0-e02e-4aa6-a42b-603b19dcf159
|
|
APP__ENTERPRISE_EDITION_LICENSE:
|
|
from_secret: ee_license
|
|
REDIS__HOSTNAME: redis
|
|
REDIS__NAMESPACE: pycti-start
|
|
ELASTICSEARCH__URL: http://elastic:9200
|
|
ELASTICSEARCH__INDEX_PREFIX: pycti-start
|
|
MINIO__ENDPOINT: minio
|
|
MINIO__BUCKET_NAME: pycti-start
|
|
RABBITMQ__HOSTNAME: rabbitmq
|
|
RABBITMQ__QUEUE_PREFIX: pycti-start
|
|
EXPIRATION_SCHEDULER__ENABLED: false
|
|
SUBSCRIPTION_SCHEDULER__ENABLED: false
|
|
SMTP__ENABLED: false
|
|
GITHUB_TOKEN:
|
|
from_secret: github_token
|
|
commands:
|
|
- echo "$(ls /root/.yarn/berry/cache/ 2> /dev/null | wc -l || echo 0) packages in Yarn global cache"
|
|
- sleep 10
|
|
- ls -lart
|
|
- apk add build-base git libffi-dev cargo
|
|
- mkdir -p /tmp/pycti-start-platform/
|
|
- cp -a $DRONE_WORKSPACE/platform-reference/* /tmp/pycti-start-platform/
|
|
- cd "$DRONE_WORKSPACE/client-python"
|
|
- pip install -r requirements.txt
|
|
- pip install -e .[dev,doc]
|
|
- cd /tmp/pycti-start-platform/opencti-graphql
|
|
- npm install -g corepack
|
|
- cp $DRONE_WORKSPACE/opencti-platform/.yarnrc.yml .
|
|
- yarn install
|
|
- yarn install:python
|
|
- NODE_OPTIONS=--max_old_space_size=8192 yarn start
|
|
|
|
volumes:
|
|
- name: cache-backend-verify-licenses-yarn
|
|
host:
|
|
path: /tmp/cache-backend-verify-licenses-yarn
|
|
- name: cache-frontend-verify-licenses-yarn
|
|
host:
|
|
path: /tmp/cache-frontend-verify-licenses-yarn
|
|
- name: cache-api-tests-yarn
|
|
host:
|
|
path: /tmp/cache-api-tests-yarn
|
|
- name: cache-opencti-raw-start-yarn
|
|
host:
|
|
path: /tmp/cache-opencti-raw-start-yarn
|
|
- name: cache-opencti-live-start-yarn
|
|
host:
|
|
path: /tmp/cache-opencti-live-start-yarn
|
|
- name: cache-opencti-direct-start-yarn
|
|
host:
|
|
path: /tmp/cache-opencti-direct-start-yarn
|
|
- name: cache-opencti-restore-start-yarn
|
|
host:
|
|
path: /tmp/cache-opencti-restore-start-yarn
|
|
- name: cache-opencti-e2e-start-yarn
|
|
host:
|
|
path: /tmp/cache-opencti-e2e-start-yarn
|
|
- name: cache-frontend-tests-yarn
|
|
host:
|
|
path: /tmp/cache-frontend-tests-yarn
|
|
- name: cache-frontend-e2e-tests-yarn
|
|
host:
|
|
path: /tmp/cache-frontend-e2e-tests-yarn
|
|
- name: cache-opencti-pycti-start-yarn
|
|
host:
|
|
path: /tmp/cache-opencti-pycti-start-yarn
|
|
image_pull_secrets:
|
|
- dockerconfigjson
|