Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #160 from HXSecurity/develop
Browse files Browse the repository at this point in the history
Release 1.0.5
  • Loading branch information
Bidaya0 authored Oct 23, 2021
2 parents f6c8948 + 3b750ef commit 9cf7dbe
Show file tree
Hide file tree
Showing 25 changed files with 1,093 additions and 351 deletions.
57 changes: 55 additions & 2 deletions .github/workflows/deploy_webapi_to_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,66 @@ name: Deploy DongTai WebApi To AWS
on:
pull_request:
branches: [ main ]

push:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
Run-UnitTest:
runs-on: ubuntu-latest
services:
mysql:
image: dongtai/dongtai-mysql:latest
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping --silent"
--health-interval 10s
--health-timeout 180s
--health-retries 10
redis:
image: dongtai/dongtai-redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
max-parallel: 4
matrix:
python-version: [3.7]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-prod.txt
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Waiting For MySql Init
run: sleep 120

- name: Run UnitTest
run: |
cp conf/config.ini.example conf/config.ini
python3 manage.py test
Deploy-to-test:
# The type of runner that the job will run on
if: github.event_name == 'push'
needs: [Run-UnitTest]
runs-on: ubuntu-latest
strategy:
max-parallel: 4
Expand Down
93 changes: 0 additions & 93 deletions .github/workflows/deploy_webapi_to_aws_test.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/release_webapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ jobs:
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ${{ secrets.ALIYUN_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKERHUB_USER }}
password: ${{ secrets.ALIYUN_DOCKERHUB_PASSWORD }}
username: ${{ secrets.DONGTAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.DONGTAI_DOCKERHUB_TOKEN }}

- id: release
run: |
Expand All @@ -72,7 +71,9 @@ jobs:
with:
context: .
push: true
tags: "registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-webapi:latest,registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-webapi:${{ steps.release.outputs.version }},"
tags: |
dongtai/dongtai-webapi:latest
dongtai/dongtai-webapi:${{ steps.release.outputs.version }}
- name: finish build
Expand Down
4 changes: 1 addition & 3 deletions deploy/deploy-dongtai-webapi-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
spec:
containers:
- name: dongtai-webapi-container
image: registry.cn-beijing.aliyuncs.com/secnium/iast-saas-webapi:VERSION
image: dongtai/dongtai-webapi:VERSION
imagePullPolicy: IfNotPresent
volumeMounts:
- name: configfile
Expand All @@ -39,8 +39,6 @@ spec:
- name: configfile
configMap:
name: dongtai-iast-config-prod.ini
imagePullSecrets:
- name: aliyun-registry-secret
---
apiVersion: v1
kind: Service
Expand Down
Loading

0 comments on commit 9cf7dbe

Please sign in to comment.