Skip to content

Commit

Permalink
[integration] Enhance CI/CD for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Oct 17, 2023
1 parent f682839 commit 1b92cba
Showing 1 changed file with 1 addition and 127 deletions.
128 changes: 1 addition & 127 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,94 +156,6 @@ jobs:
only_on_fail: true
webhook_url: $MS_TEAMS_WEBHOOK_URL

deploy_demo:
working_directory: ~/opencti
docker:
- image: circleci/node:current
resource_class: medium+
steps:
- attach_workspace:
at: ~/
- add_ssh_keys
- run: ssh-keyscan -H opencti.io >> ~/.ssh/known_hosts
- run: sudo apt-get update -qq && sudo apt install rsync curl
- run: mkdir deploy
- run: git config --global user.email "[email protected]" && git config --global user.name "OpenCTI CircleCI"
- run:
working_directory: ~/opencti/deploy
command: git clone ssh://[email protected]:/~/opencti-fiqid45E.git .
- run:
working_directory: ~/opencti/deploy
command: git submodule init && git submodule update --remote
- run:
working_directory: ~/opencti/deploy
command: git remote add ci ~/opencti && git pull --no-edit -s recursive -X theirs ci master
- run:
working_directory: ~/opencti/deploy
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/public/ ./opencti-platform/opencti-graphql/public/
- run:
working_directory: ~/opencti/deploy
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/build/ ./opencti-platform/opencti-graphql/build/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ./opencti-connectors/ ./opencti-connectors-enabled/
- run:
working_directory: ~/opencti/deploy
command: git add -A && git add -f ./opencti-platform/opencti-graphql/public && git add -f ./opencti-platform/opencti-graphql/build
- run:
working_directory: ~/opencti/deploy
command: git diff-index --quiet HEAD || git commit -a -m "[CircleCI-Workflow] Deploy new version" && git push origin master
- slack/notify:
event: fail
template: basic_fail_1
- ms-teams/report:
only_on_fail: true
webhook_url: $MS_TEAMS_WEBHOOK_URL

deploy_reference:
working_directory: ~/opencti
docker:
- image: circleci/node:current
resource_class: medium+
steps:
- attach_workspace:
at: ~/
- add_ssh_keys
- run: ssh-keyscan -H opencti.io >> ~/.ssh/known_hosts
- run: sudo apt-get update -qq && sudo apt install rsync curl
- run: mkdir -p deploy
- run: git config --global user.email "[email protected]" && git config --global user.name "OpenCTI CircleCI"
- run:
working_directory: ~/opencti/deploy
command: git clone ssh://[email protected]:/~/opencti-b0gY5UHe.git .
- run:
working_directory: ~/opencti/deploy
command: git submodule init && git submodule update --remote
- run:
working_directory: ~/opencti/deploy
command: git remote add ci ~/opencti && git pull --no-edit -s recursive -X theirs ci master
- run:
working_directory: ~/opencti/deploy
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/public/ ./opencti-platform/opencti-graphql/public/
- run:
working_directory: ~/opencti/deploy
command: rsync -av --delete ~/opencti/opencti-platform/opencti-graphql/build/ ./opencti-platform/opencti-graphql/build/
- run:
working_directory: ~/opencti/deploy
command: rsync -av ./opencti-connectors/ ./opencti-connectors-enabled/
- run:
working_directory: ~/opencti/deploy
command: git add -A && git add -f ./opencti-platform/opencti-graphql/public && git add -f ./opencti-platform/opencti-graphql/build
- run:
working_directory: ~/opencti/deploy
command: git diff-index --quiet HEAD || git commit -a -m "[CircleCI-Workflow] Deploy new version" && git push origin master
- slack/notify:
event: fail
template: basic_fail_1
- ms-teams/report:
only_on_fail: true
webhook_url: $MS_TEAMS_WEBHOOK_URL

docker_build_platform:
working_directory: ~/opencti_docker
machine:
Expand Down Expand Up @@ -412,29 +324,7 @@ jobs:
steps:
- checkout
- kubernetes/install-kubectl
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-front
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-ingest
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-worker
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-alienvault
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-abuseipdb
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-common-vulnerabilities-and-exposures
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-exportfilecsv
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-exportfilestix2
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-exportfiletxt
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-exportreportpdf
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-google-dns
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-hybrid-analysis-sandbox-windows-10-64bit
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-hygiene
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-importdocument
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-importexternalreference
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-importfilestix
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-ipinfo
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-malpedia
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-misp-feed-cert-fr-cert-fr
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-misp-feed-circl-circl
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-mitre-datasets
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-opencti-datasets
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment/opencti-connector-virustotal
- run: kubectl --server=https://api.staging.eu-west.filigran.io --token=$K8S_TOKEN -n customer-testing rollout restart deployment

notify_rolling:
docker:
Expand Down Expand Up @@ -494,20 +384,6 @@ workflows:
branches:
only:
- master
- deploy_demo:
requires:
- build_platform
filters:
branches:
only:
- master
- deploy_reference:
requires:
- build_platform
filters:
branches:
only:
- master
- docker_build_platform_rolling:
requires:
- build_frontend
Expand Down Expand Up @@ -544,8 +420,6 @@ workflows:
- docker_build_worker_rolling
- notify_rolling:
requires:
- deploy_demo
- deploy_reference
- deploy_testing
- package_rolling
- package_rolling_musl
Expand Down

0 comments on commit 1b92cba

Please sign in to comment.