Skip to content

Commit

Permalink
Merge pull request #200 from HXSecurity/develop
Browse files Browse the repository at this point in the history
beta
  • Loading branch information
tscuite authored Jul 17, 2023
2 parents 057c271 + d356cb9 commit de048de
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 168 deletions.
75 changes: 0 additions & 75 deletions .github/deploy/deploy-dongtai-mysql-test.yaml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/deploy/deploy.yaml

This file was deleted.

74 changes: 57 additions & 17 deletions .github/workflows/build_base_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,69 @@ jobs:
push: true
# platforms: linux/amd64,linux/arm64
tags: |
registry.cn-hongkong.aliyuncs.com/huoxian_pub/dongtai-mysql-unittest:1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}
registry.cn-hongkong.aliyuncs.com/huoxian_pub/dongtai-mysql-unittest:latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-mysql:${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-mysql:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-mysql:max-${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-mysql:max-${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
dongtai/dongtai-mysql-unittest:1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}
dongtai/dongtai-mysql-unittest:latest
- name: Build and push logstash
uses: docker/build-push-action@v3
with:
context: ./logstash
file: ./logstash/Dockerfile
push: true
tags: |
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logstash:${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logstash:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logstash:max-${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logstash:max-${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
- name: Build and push logrotate
uses: docker/build-push-action@v3
with:
context: ./logrotate
file: ./logrotate/Dockerfile
push: true
tags: |
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logrotate:${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logrotate:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logrotate:max-${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-logrotate:max-${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
- name: Build and push Redis
uses: docker/build-push-action@v2
with:
context: ./redis
push: true
tags: |
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-redis:${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-redis:${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-redis:max-${{ steps.version.outputs.GITHUB_REF }}-latest
registry.cn-hongkong.aliyuncs.com/secnium/dongtai-redis:max-${{ steps.version.outputs.GITHUB_REF }}-1.0.${{github.run_number}}
- name: Set the value
id: release
run: |
if [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then echo "helm_ns=test" >> $GITHUB_ENV; echo "helm_mysql=test" >> $GITHUB_ENV
elif [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then echo "helm_ns=beta" >> $GITHUB_ENV; echo "helm_mysql=beta" >> $GITHUB_ENV
else echo "helm_ns=main" >> $GITHUB_ENV ; echo "helm_mysql=temp" >> $GITHUB_ENV ;fi
- uses: actions/checkout@master
- name: deploy to cluster
uses: wahyd4/kubectl-helm-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_TEST_DATA }}
with:
args: |
if [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then find .github/deploy/deploy-dongtai-mysql-test.yaml -type f -exec sed -i 's/iast-test/iast-beta/g' {} \;
kubectl rollout -n iast-${{ steps.version.outputs.GITHUB_REF }} restart statefulset redis
elif [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then kubectl rollout -n iast-test restart statefulset redis
else find .github/deploy/deploy-dongtai-mysql-test.yaml -type f -exec sed -i 's/iast-test/iast-main/g' {} \;
kubectl rollout -n iast-main restart statefulset redis ;fi
if [ ${{ steps.version.outputs.GITHUB_REF }} = beta ] ; then find .github/deploy/deploy.yaml -type f -exec sed -i 's/iast-test/iast-beta/g' {} \;
kubectl rollout -n iast-${{ steps.version.outputs.GITHUB_REF }} restart statefulset redis
elif [ ${{ steps.version.outputs.GITHUB_REF }} = develop ] ; then kubectl rollout -n iast-test restart statefulset redis
else find .github/deploy/deploy.yaml -type f -exec sed -i 's/iast-test/iast-main/g' {} \;
kubectl rollout -n iast-main restart statefulset redis ;fi
find .github/deploy/deploy-dongtai-mysql-test.yaml -type f -exec sed -i 's/VERSION/1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}/g' {} \;
ls .github/deploy/deploy-dongtai-mysql-test.yaml | xargs -I {} kubectl apply -f {}
find .github/deploy/deploy.yaml -type f -exec sed -i 's/VERSION/1.0.${{github.run_number}}-${{ steps.version.outputs.GITHUB_REF }}/g' {} \;
ls .github/deploy/deploy.yaml | xargs -I {} kubectl apply -f {}
git clone https://github.com/HXSecurity/DongTai.git
helm upgrade --install huoxian --create-namespace -n iast-${{ env.helm_ns }} ./DongTai/deploy/kubernetes/helm/ \
--set sca.sca_token=${{ secrets.TOKEN_SCA }} --set usb.usb_token=${{ secrets.TOKEN_SCA }} --set mysql.host=iast-mysql-${{ env.helm_mysql }}.huoxian.cn \
--set tag=${{ steps.version.outputs.GITHUB_REF }}-latest --set build.mysql_number=iast${{github.run_number}} \
--set build.redis_number=iast${{github.run_number}} --set build.logstash_number=iast${{github.run_number}} --values https://charts.dongtai.io/devops.yaml
helm upgrade --install huoxian --create-namespace -n iast-${{ env.helm_ns }}-max ./DongTai/deploy/kubernetes/helm/ \
--set max=true --set sca.sca_token=${{ secrets.MAX_TOKEN_SCA }} --set usb.usb_token=${{ secrets.MAX_TOKEN_SCA }} --set mysql.host=iast-mysql-${{ env.helm_mysql }}-max.huoxian.cn \
--set tag=max-${{ steps.version.outputs.GITHUB_REF }}-latest --set build.mysql_number=iast${{github.run_number}} \
--set build.redis_number=iast${{github.run_number}} --set build.logstash_number=iast${{github.run_number}} --values https://charts.dongtai.io/devops.yaml
1 change: 1 addition & 0 deletions mysql/updaterecord.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

1.13.0 update-20230621-release-1.13.0.sql
1.12.0 update-20230530-release-1.12.0.sql
1.11.0 update-20230517-release-1.11.0.sql
1.10.0 update-20230319-release-1.10.0.sql
Expand Down
3 changes: 2 additions & 1 deletion redis/redis.conf
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
requirepass "123456"
requirepass "123456"
stop-writes-on-bgsave-error no

0 comments on commit de048de

Please sign in to comment.