Skip to content
This repository has been archived by the owner on Apr 20, 2022. It is now read-only.

Commit

Permalink
Update release_openapi.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Bidaya0 authored Feb 24, 2022
1 parent 2f39e84 commit 721121c
Showing 1 changed file with 2 additions and 66 deletions.
68 changes: 2 additions & 66 deletions .github/workflows/release_openapi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a basic workflow to help you get started with Actions
jj# This is a basic workflow to help you get started with Actions

name: Release DongTai OpenAPI

Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
# AccessKeySceret
access-key-secret: ${{ secrets.ALIYUN_OSS_KEY_SECRET }}
- run: |
ossutil cp oss://dongtai/agent/java/${{ steps.release.outputs.version }}/ ./ --include "*.jar" -r
ossutil cp oss://dongtai/agent/java/latest/ ./ --include "*.jar" -r
ossutil cp oss://dongtai/agent/python/ ./ --include "*.tar.gz" -r
ossutil cp oss://dongtai/agent/php/ ./ --include "*.tar.gz" -r
ossutil cp oss://huoqi-public/iast/release-version/DongTai-agent-python/${{ steps.release.outputs.VERSION }}/version.txt DongTai-agent-python.version.txt || true
Expand All @@ -107,67 +107,3 @@ jobs:
echo "REPLACE INTO project_version_control (version, component_name, component_version_hash) VALUES('$DONGTAI_PYTHON_AGENT_VERSION', '$DONGTAI_PYTHON_AGENT_REPONAME', '$DONGTAI_PYTHON_AGENT_HASH');" >> ./docker/version.sql
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DONGTAI_DOCKERHUB_USERNAME }}
password: ${{ secrets.DONGTAI_DOCKERHUB_TOKEN }}

- name: Login to AliyunRegistry
uses: docker/login-action@v1
with:
registry: ${{ secrets.ALIYUN_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKERHUB_USER }}
password: ${{ secrets.ALIYUN_DOCKERHUB_PASSWORD }}


- name: Build to local
uses: docker/build-push-action@v2
with:
context: .
load: true
tags: |
dongtai/dongtai-openapi:${{ steps.release.outputs.version }}
dongtai/dongtai-openapi:latest
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-openapi:${{ steps.release.outputs.version }}
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-openapi:latest
- name: Save image to tar file
run: |
docker save dongtai/dongtai-openapi:${{ steps.release.outputs.version }} | gzip > /tmp/dongtai-openapi-${{ steps.release.outputs.version }}.tar.gz
- name: Setup Ossutil
uses: manyuanrong/setup-ossutil@v2.0
with:
endpoint: ${{ secrets.ALIYUN_OSS_ENDPOINT }}
access-key-id: ${{ secrets.ALIYUN_OSS_KEY_ID }}
access-key-secret: ${{ secrets.ALIYUN_OSS_KEY_SECRET }}

- name: Upload images to oss
run: |
ossutil cp /tmp/dongtai-openapi-${{ steps.release.outputs.version }}.tar.gz oss://huoqi-public/iast/server-package/${{ steps.release.outputs.version }}/
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
dongtai/dongtai-openapi:${{ steps.release.outputs.version }}
dongtai/dongtai-openapi:latest
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-openapi:${{ steps.release.outputs.version }}
registry.cn-beijing.aliyuncs.com/huoxian_pub/dongtai-openapi:latest
- name: Deploy to staging
uses: wahyd4/kubectl-helm-action@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: |
find deploy/deploy-eks-iast-saas-openapi-prod.yml -type f -exec sed -i 's/VERSION/${{ steps.release.outputs.version }}/g' {} \;
ls deploy/deploy-eks-iast-saas-openapi-prod.yml | xargs -I {} kubectl apply -f {}
- name: finish build
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.DONGTAI_WEBHOOK_URL }}
body: '{"msg_type": "interactive","card": {"config": {"wide_screen_mode": true,"enable_forward": true},"elements": [{"tag": "div","text": {"content": "状态:构建完成\n项目:${{github.repository}}\n分支:${{github.ref}}\n流程:${{github.workflow}}\n构建编号:${{github.run_number}}\n触发事件:${{github.event_name}}\n提交人:${{github.actor}}\nSHA-1:${{github.sha}}\n","tag": "lark_md"}}]}}'

0 comments on commit 721121c

Please sign in to comment.