Skip to content

Commit 852ade2

Browse files
authored
Merge pull request #1636 from HXSecurity/beta
Beta
2 parents c061d2d + 2494171 commit 852ade2

File tree

266 files changed

+5110
-11315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+5110
-11315
lines changed

.github/deploy/deploy-dongtai-server-test.yml

Lines changed: 0 additions & 403 deletions
This file was deleted.

.github/workflows/deploy-dev.yaml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ on:
1111
agent_version:
1212
required: true
1313
type: string
14-
# server_version:
15-
# required: true
16-
# type: string
1714

1815
jobs:
1916
Deploy-to-dev:
@@ -27,12 +24,6 @@ jobs:
2724
- name: Checkout
2825
uses: actions/checkout@v3
2926

30-
# - name: Checkout
31-
# if: ${{ inputs.server_version }}
32-
# uses: actions/checkout@v3
33-
# with:
34-
# ref: ${{ inputs.server_version }}
35-
3627
- name: Get the release version
3728
id: version
3829
run: echo ::set-output name=GITHUB_REF::${GITHUB_REF##*/}
@@ -63,7 +54,7 @@ jobs:
6354
access-key-secret: ${{ secrets.CHART_OSS_ACCESS_KEY_SECRET }}
6455

6556
- name: Download Agent dev
66-
if: ${{ steps.version.outputs.GITHUB_REF }} == develop || ${{ steps.version.outputs.GITHUB_REF }} == beta || ${{ steps.version.outputs.GITHUB_REF }} == main
57+
# if: ${{ steps.version.outputs.GITHUB_REF }} == develop || ${{ steps.version.outputs.GITHUB_REF }} == beta || ${{ steps.version.outputs.GITHUB_REF }} == main
6758
run: |
6859
if [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then ossutil cp oss://dongtai-helm-charts/agent_test/java/latest/ ./ --include "*.jar" -r
6960
else ossutil cp oss://dongtai-helm-charts/agent_${{ steps.version.outputs.GITHUB_REF }}/java/latest/ ./ --include "*.jar" -r
@@ -86,18 +77,23 @@ jobs:
8677
push: true
8778
platforms: linux/amd64
8879
tags: |
89-
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-server-test:latest-${{ steps.version.outputs.GITHUB_REF }}
90-
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-server-test:1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}
80+
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-server:${{ steps.version.outputs.GITHUB_REF }}-latest
81+
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-server:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
82+
83+
- name: Set the value
84+
id: release
85+
run: |
86+
if [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then echo "helm_ns=test" >> $GITHUB_ENV; echo "helm_mysql=test" >> $GITHUB_ENV
87+
elif [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then echo "helm_ns=beta" >> $GITHUB_ENV; echo "helm_mysql=beta" >> $GITHUB_ENV
88+
else echo "helm_ns=main" >> $GITHUB_ENV ; echo "helm_mysql=temp" >> $GITHUB_ENV ;fi
9189
92-
- uses: actions/checkout@master
9390
- name: deploy to cluster
9491
uses: wahyd4/kubectl-helm-action@master
9592
env:
9693
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_TEST_DATA }}
9794
with:
9895
args: |
99-
if [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then find .github/deploy/deploy-dongtai-server-test.yml -type f -exec sed -i 's/iast-test/iast-beta/g' {} \;
100-
elif [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then echo testing !!!
101-
else find .github/deploy/deploy-dongtai-server-test.yml -type f -exec sed -i 's/iast-test/iast-main/g' {} \; ;fi
102-
find .github/deploy/deploy-dongtai-server-test.yml -type f -exec sed -i 's/VERSION/1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}/g' {} \;
103-
ls .github/deploy/deploy-dongtai-server-test.yml | xargs -I {} kubectl apply -f {}
96+
git clone https://github.com/HXSecurity/DongTai.git
97+
helm upgrade --install huoxian --create-namespace -n iast-${{ env.helm_ns }} ./DongTai/deploy/kubernetes/helm/ \
98+
--set sca.sca_token=${{ secrets.TOKEN_SCA }} --set usb.usb_token=${{ secrets.TOKEN_SCA }} --set mysql.host=iast-mysql-${{ env.helm_mysql }}.huoxian.cn \
99+
--set tag=${{ steps.version.outputs.GITHUB_REF }}-latest --set build.server_number=iast${{github.run_number}} --set develop.agentZip=${{ env.helm_ns }} --values https://charts.dongtai.io/devops.yaml

.github/workflows/teststate.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
125125
- name: Django Unit Testing
126126
run: |
127-
mypy --show-error-codes --ignore-missing-imports --no-incremental --show-error-codes --check-untyped-defs --disable-error-code var-annotated --disable-error-code list-item --disable-error-code attr-defined --disable-error-code arg-type --disable-error-code assignment --disable-error-code misc --disable-error-code union-attr --disable-error-code index --disable-error-code call-overload --disable-error-code dict-item --disable-error-code truthy-function --disable-error-code operator --disable-error-code name-defined .
127+
mypy --show-error-codes --ignore-missing-imports --no-incremental --show-error-codes --check-untyped-defs --disable-error-code var-annotated --disable-error-code list-item --disable-error-code attr-defined --disable-error-code assignment --disable-error-code misc --disable-error-code union-attr --disable-error-code index --disable-error-code call-overload --disable-error-code dict-item --disable-error-code truthy-function --disable-error-code operator --disable-error-code name-defined .
128128
129129
Run-Pep8Check:
130130
runs-on: ubuntu-latest
@@ -244,6 +244,7 @@ jobs:
244244
245245
- name: Django Unit Testing
246246
run: |
247+
export CELERY_EAGER_TEST=TRUE
247248
cp dongtai_conf/conf/config.ini.test dongtai_conf/conf/config.ini
248249
mkdir -p /tmp/logstash/report/{img,word,pdf,excel} && mkdir -p /tmp/iast_cache/package && mkdir -p /tmp/logstash/batchagent
249250
python3 ./deploy/docker/version_update.py || true
@@ -293,6 +294,7 @@ jobs:
293294
294295
- name: Django Unit Testing
295296
run: |
297+
export CELERY_EAGER_TEST=TRUE
296298
cp dongtai_conf/conf/config.ini.test dongtai_conf/conf/config.ini
297299
mkdir -p /tmp/logstash/report/{img,word,pdf,excel} && mkdir -p /tmp/iast_cache/package && mkdir -p /tmp/logstash/batchagent
298300
python3 ./deploy/docker/version_update.py || true

Pipfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ botocore = "==1.27.91"
6969
setuptools = "==65.5.1"
7070
elasticsearch = "==7.17.7"
7171
django-mock-queries = "==v2.1.7"
72-
cryptography = "==41.0.0"
72+
cryptography = "==41.0.2"
7373
jsonschema = "==4.17.0"
7474
pillow = "==9.3.0"
7575
pyrsistent = "==0.19.1"
@@ -84,6 +84,11 @@ django-seriously = "*"
8484
dataclasses-json = "*"
8585
django-silk = "*"
8686
types-python-dateutil = "*"
87+
shortuuid = "*"
88+
networkit = "*"
89+
flower = "~=2.0.0"
90+
django-health-check = "==3.17.0"
91+
django-prometheus = "==2.3.1"
8792

8893
[dev-packages]
8994

0 commit comments

Comments
 (0)