From f3e760c30f3984dd106a705ad1eac8915eb2eefc Mon Sep 17 00:00:00 2001 From: Marat Bediev Date: Fri, 24 Jul 2020 13:38:57 +0600 Subject: [PATCH 1/5] Add drone-ci integration: Run Edelweiss tests --- .drone.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..04fcfad6 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,52 @@ +kind: pipeline +name: default + +platform: + os: linux + arch: amd64 + +steps: +- name: edelweiss_swc + image: mythx.azurecr.io/tools/edelweiss + environment: + IGNORE_FALSE_POSITIVES: + from_secret: IGNORE_FALSE_POSITIVES + IGNORE_REGRESSIONS: + from_secret: IGNORE_REGRESSIONS + AWS_DEFAULT_REGION: + from_secret: AWS_DEFAULT_REGION + AWS_ACCESS_KEY_ID: + from_secret: AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: + from_secret: AWS_SECRET_ACCESS_KEY + MONGO_URL: + from_secret: MONGO_URL + commands: + - export CIRCLE_BUILD_NUM=$DRONE_BUILD_NUMBER + - export CIRCLE_BUILD_URL=$DRONE_BUILD_LINK + - export CIRCLE_BRANCH=$DRONE_BRANCH + - export CIRCLE_SHA1=$DRONE_COMMIT_SHA + - cd /edelweiss + - git submodule update --init --recursive + - git submodule update --remote --recursive + - pip3 install mythril + - edelweiss-cli + -p mythril + --timeout 90 + --output-dir $(pwd) + --s3 + --dynamodb + --circle-ci CircleCI/mythril.csv + --ignore-false-positives $IGNORE_FALSE_POSITIVES + --ignore-regressions $IGNORE_REGRESSIONS + when: + branch: + - develop + - master + - run-edelweiss-drone + event: + - push + - tag + +image_pull_secrets: + - DOCKER_CONFIG_JSON From 2b13a8bed7ca03fdacd3a9a19c748a010b69ebbd Mon Sep 17 00:00:00 2001 From: Marat Bediev Date: Fri, 24 Jul 2020 15:07:25 +0600 Subject: [PATCH 2/5] Post-tests cleanup --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 04fcfad6..950f90f5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,7 +43,6 @@ steps: branch: - develop - master - - run-edelweiss-drone event: - push - tag From fe2ebad92940a8a2bf75f93ba50537745b111c36 Mon Sep 17 00:00:00 2001 From: Marat Bediev Date: Mon, 27 Jul 2020 17:23:35 +0600 Subject: [PATCH 3/5] [DroneCI]: install mythril cli from local dir --- .drone.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 950f90f5..b660ba6c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,22 +14,27 @@ steps: IGNORE_REGRESSIONS: from_secret: IGNORE_REGRESSIONS AWS_DEFAULT_REGION: - from_secret: AWS_DEFAULT_REGION + from_secret: AWS_DEFAULT_REGION AWS_ACCESS_KEY_ID: - from_secret: AWS_ACCESS_KEY_ID + from_secret: AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY: - from_secret: AWS_SECRET_ACCESS_KEY + from_secret: AWS_SECRET_ACCESS_KEY MONGO_URL: - from_secret: MONGO_URL + from_secret: MONGO_URL commands: + # CIRCLE_* env vars is used by edelweiss cli to generate + # the reports storage directory structure - export CIRCLE_BUILD_NUM=$DRONE_BUILD_NUMBER - export CIRCLE_BUILD_URL=$DRONE_BUILD_LINK - export CIRCLE_BRANCH=$DRONE_BRANCH - export CIRCLE_SHA1=$DRONE_COMMIT_SHA + # install pip module from current dir + - pip3 install $(pwd) + # update SWC-registry - cd /edelweiss - git submodule update --init --recursive - git submodule update --remote --recursive - - pip3 install mythril + # run edelewiss tests - edelweiss-cli -p mythril --timeout 90 From 5d7b427a33716f0f95746b5b332ae5a46f9f7878 Mon Sep 17 00:00:00 2001 From: Marat Bediev Date: Mon, 27 Jul 2020 17:24:57 +0600 Subject: [PATCH 4/5] Enable drone job for run-edelweiss-drone branch --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index b660ba6c..88d94687 100644 --- a/.drone.yml +++ b/.drone.yml @@ -46,6 +46,7 @@ steps: --ignore-regressions $IGNORE_REGRESSIONS when: branch: + - run-edelweiss-drone - develop - master event: From 1e30b6f04c8d7e8e85d8eb55379762ac8c4bf0c7 Mon Sep 17 00:00:00 2001 From: Marat Bediev Date: Mon, 27 Jul 2020 19:03:46 +0600 Subject: [PATCH 5/5] Post-tests cleanup --- .drone.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 88d94687..b660ba6c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -46,7 +46,6 @@ steps: --ignore-regressions $IGNORE_REGRESSIONS when: branch: - - run-edelweiss-drone - develop - master event: