Skip to content

Commit

Permalink
[integration] Adapt the CI workflow to prepare ARM build (#1271)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Hassine committed May 17, 2021
1 parent 62e1cf5 commit 4742722
Showing 1 changed file with 40 additions and 23 deletions.
63 changes: 40 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

jobs:
build_platform:
build_frontend:
working_directory: ~/opencti
docker:
- image: nikolaik/python-nodejs:python3.9-nodejs15
Expand All @@ -16,6 +16,20 @@ jobs:
working_directory: ~/opencti/opencti-platform/opencti-front
command: yarn build
no_output_timeout: 30m
- persist_to_workspace:
root: ~/
paths:
- opencti

build_platform:
working_directory: ~/opencti
docker:
- image: nikolaik/python-nodejs:python3.9-nodejs15
steps:
- run:
command: apt-get update --allow-insecure-repositories --allow-unauthenticated && apt-get install -y build-essential libffi-dev
- attach_workspace:
at: ~/
- run:
working_directory: ~/opencti/opencti-platform/opencti-graphql
command: yarn install
Expand All @@ -25,23 +39,17 @@ jobs:
- persist_to_workspace:
root: ~/
paths:
- opencti
- opencti_built

build_platform_musl:
working_directory: ~/opencti_musl
working_directory: ~/opencti
docker:
- image: nikolaik/python-nodejs:python3.9-nodejs15-alpine
steps:
- run:
command: apk update && apk upgrade && apk --no-cache add git build-base libmagic libffi-dev
- checkout
- run:
working_directory: ~/opencti_musl/opencti-platform/opencti-front
command: yarn install
- run:
working_directory: ~/opencti_musl/opencti-platform/opencti-front
command: yarn build
no_output_timeout: 30m
- attach_workspace:
at: ~/
- run:
working_directory: ~/opencti_musl/opencti-platform/opencti-graphql
command: yarn install
Expand All @@ -51,10 +59,10 @@ jobs:
- persist_to_workspace:
root: ~/
paths:
- opencti_musl
- opencti_built_musl

package_rolling:
working_directory: ~/opencti
working_directory: ~/opencti_built
docker:
- image: circleci/node:15-stretch
steps:
Expand All @@ -77,7 +85,7 @@ jobs:
command: scp "opencti-$(date '+%Y%m%d').tar.gz" [email protected]:/dns/io/opencti/releases/

package_rolling_musl:
working_directory: ~/opencti_musl
working_directory: ~/opencti_built_musl
docker:
- image: circleci/node:15-stretch
steps:
Expand All @@ -100,7 +108,7 @@ jobs:
command: scp "opencti-$(date '+%Y%m%d')_musl.tar.gz" [email protected]:/dns/io/opencti/releases/

deploy_demo:
working_directory: ~/opencti
working_directory: ~/opencti_built
docker:
- image: circleci/node:15-stretch
steps:
Expand Down Expand Up @@ -137,7 +145,7 @@ jobs:
command: git diff-index --quiet HEAD || git commit -a -m "[CircleCI-Workflow] Deploy new version" && git push origin master

deploy_reference:
working_directory: ~/opencti
working_directory: ~/opencti_built
docker:
- image: circleci/node:15-stretch
steps:
Expand Down Expand Up @@ -174,7 +182,7 @@ jobs:
command: git diff-index --quiet HEAD || git commit -a -m "[CircleCI-Workflow] Deploy new version" && git push origin master

deploy_testing:
working_directory: ~/opencti
working_directory: ~/opencti_built
docker:
- image: circleci/node:15-stretch
steps:
Expand Down Expand Up @@ -211,7 +219,7 @@ jobs:
command: git diff-index --quiet HEAD || git commit -a -m "[CircleCI-Workflow] Deploy new version" && git push origin master

deploy_club:
working_directory: ~/opencti
working_directory: ~/opencti_built
docker:
- image: circleci/node:15-stretch
steps:
Expand Down Expand Up @@ -252,7 +260,8 @@ jobs:
docker:
- image: circleci/buildpack-deps:stretch
steps:
- checkout
- attach_workspace:
at: ~/
- setup_remote_docker:
version: 19.03.13
- run:
Expand Down Expand Up @@ -283,7 +292,7 @@ jobs:
- run:
working_directory: ~/opencti/opencti-platform
name: Build Docker image opencti/platform
command: docker build -t opencti/platform:rolling .
command: docker build -f Dockerfile_circleci -t opencti/platform:rolling .
no_output_timeout: 30m
- run:
working_directory: ~/opencti/opencti-worker
Expand All @@ -299,14 +308,22 @@ jobs:
workflows:
opencti:
jobs:
- build_frontend:
filters:
tags:
only: /.*/
- build_platform:
filters:
tags:
only: /.*/
requires:
- build_frontend
- build_platform_musl:
filters:
tags:
only: /.*/
only: /.*/
requires:
- build_frontend
- package_rolling:
requires:
- build_platform
Expand Down Expand Up @@ -351,14 +368,14 @@ workflows:
- master
- docker_build_rolling:
requires:
- build_platform
- build_frontend
filters:
branches:
only:
- master
- docker_build:
requires:
- build_platform
- build_frontend
filters:
tags:
only: /[0-9]+(\.[0-9]+)+(\.[0-9]+)*/
Expand Down

0 comments on commit 4742722

Please sign in to comment.