Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Jul 28, 2021
0 parents commit 8600949
Show file tree
Hide file tree
Showing 1,713 changed files with 262,548 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = blueapps/*
28 changes: 28 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[flake8]
ignore = F405, W503, E203
exclude =
*migrations*,
# python related
*.pyc,
.git,
__pycache__,
*/node_modules/*
./static/*
./blueking/*
*/blueking/*
./blueapps/*
*/blueapps/*
./pipeline/*
./sites/*
./config/default.py
./scripts_tools/*
./support-files/*
./upgrade/*
./iam/*

max-line-length=120
max-complexity=26
format=pylint
show_source=False
statistics=True
count=True
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug反馈
about: 反馈Bug
title: "[BUG]"
labels: bug
assignees: zhangzhw8

---

**问题描述**
简明扼要地描述bug是什么

**重现方法**
列出如何重现的方法或操作步骤
1. 转到 '....'
2. 点击 '....'
3. 错误现象 '....'

**预期现象**
简明扼要地描述预期的现象是什么

**截屏**
请提供截屏来解释你的问题,当然这也能更好地帮助我们理解问题。

**请提供以下信息**

- [x] bk-nodeman 版本 (发布版本号 或 git tag): <!-- `示例: V3.1.32-ce 或者 git sha. 请不要使用 "最新版本" 或 "当前版本"等无法准确定位代码版本的语句描述` -->
- [ ] 蓝鲸PaaS 版本:<!-- `<示例:PaaS 3.0.58、PaaSAgent 3.0.9` -->
- [ ] bk-nodeman 异常日志:
63 changes: 63 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CodeCov
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: "3.6"
DJANGO_SETTINGS_MODULE: "settings"
DEBUG: true
BKPAAS_ENGINE_REGION: "open"
RUN_ENV: "open"
APP_CODE: "bk_nodeman"
APP_ID: "bk_nodeman"
SECRET_KEY: "12345678-1234-5678-1234-123456789012"
APP_TOKEN: "12345678-1234-5678-1234-123456789012"
BK_BACKEND_CONFIG: ""
BK_PAAS_HOST: "http://127.0.0.1"
BK_IAM_V3_INNER_HOST: "127.0.0.1"
BKAPP_BKNODEMAN_NGINX_URL: "127.0.0.1"
BKAPP_BACKEND_HOST: "http://127.0.0.1"
BROKER_URL: "redis://localhost:6379/0"
BKAPP_BK_NODE_APIGATEWAY: "http://127.0.0.1:8000/"
BKAPP_NODEMAN_CALLBACK_URL: "http://127.0.0.1:10300/backend"
BKAPP_NODEMAN_OUTER_CALLBACK_URL: "http://127.0.0.1:10300/backend"
BK_MYSQL_NAME: "bk_nodeman"
BK_MYSQL_USER: "root"
BK_MYSQL_PASSWORD: "root"
BK_MYSQL_HOST: "localhost"
BK_MYSQL_PORT: 3306
BK_MYSQL_TEST_NAME: "bk_nodeman_test"
WORKFLOW_DIR: "scripts/workflows"
YUM_INSTALL_SERVICE: ""
CREATE_PYTHON_VENV: ""
services:
# Label used to access the service container
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: 3.6
- name: Setup Mysql
run: |
sudo systemctl start mysql.service
- name: Generate Report
run: |
./scripts/workflows/bk_ci.sh
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v1
28 changes: 28 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Flake8 and Black

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black
- name: Lint with flake8
run: |
flake8
- name: Format with black
run: |
black .
178 changes: 178 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
## Deploy files

static/nodeman
config/local_settings.py

## Project Part
.idea/
.tmp/
.vscode/

## Python Part

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
develop-eggs/
downloads/
download_file/
eggs/
.eggs/
lib/
lib64/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.pot

# Django stuff:
*.log
config/local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

## NodeJS Part

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history


# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# postman
tests/postman/bkman

# macOS General
.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

31 changes: 31 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
before_script:
- source /data/gitlab-runner/paas-webfe/bin/activate
- which node && node --version
- alias tnpm="/data/gitlab-runner/node/bin/tnpm"
- which tnpm && tnpm --version

stages:
- pep8
- pages

pep8:
stage: pep8
script:
- echo $PWD
- /data/gitlab-runner/env/pep8/bin/flake8 --ignore=F401,F403,F405,N806,E501,F841 --config=$PWD/.flake8 ./
- echo 'end pep8'
allow_failure: true


pages:
stage: pages
script:
# 生成apidoc文档
- apidoc -i ./apps . -o public
artifacts:
paths:
- public
expire_in: 30 days
only:
- deploy

Loading

0 comments on commit 8600949

Please sign in to comment.