Commit 3da020b5 authored by zhongshangwu's avatar zhongshangwu

调整CICD

parent 02de6876
kind: pipeline
name: saturn
name: like-saturn
steps:
- name: build
- name: build-test
image: plugins/docker
when:
branch: deploy/like-test
settings:
dockerfile: deploy/test/Dockerfile
registry: ccr.ccs.tencentyun.com
username: 100009168942
password: 3m4V#TMrUTSIebv1
repo: ccr.ccs.tencentyun.com/gm-ai/saturn-test
tags: ${DRONE_COMMIT}
repo: ccr.ccs.tencentyun.com/gm-ai/like-saturn
tags:
- ${DRONE_COMMIT}
- name: helm
image: quay.io/ipedrazas/drone-helm
skip_tls_verify: true
- name: build-stage
image: plugins/docker
when:
branch: deploy/like-stage
settings:
dockerfile: deploy/stage/Dockerfile
registry: ccr.ccs.tencentyun.com
username: 100009168942
password: 3m4V#TMrUTSIebv1
repo: ccr.ccs.tencentyun.com/gm-ai/like-saturn
tags:
- ${DRONE_COMMIT}
- name: build-prod
image: plugins/docker
when:
branch: deploy/like-prod
settings:
dockerfile: deploy/prod/Dockerfile
registry: ccr.ccs.tencentyun.com
dockerfile: deploy/prod/Dockerfile
username: 100009168942
password: 3m4V#TMrUTSIebv1
repo: ccr.ccs.tencentyun.com/gm-ai/like-saturn
tags:
- ${DRONE_COMMIT}
- name: deploy-app
image: ccr.ccs.tencentyun.com/gm-ai/drone-kube:pre
environment:
API_SERVER:
from_secret: api_server
KUBERNETES_TOKEN:
from_secret: kubernetes_token
repo: alpha/saturn
when:
instance:
exclude:
- aidrone.iyanzhi.com
settings:
skip_tls_verify: true
chart: deploy
stable_repo_url: http://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts
namespace: like-test
values: image.tag=${DRONE_COMMIT}
release: "saturn"
namespace: ${DRONE_BRANCH}
template: deploy.yaml
tag: ${DRONE_COMMIT}
trigger:
branch:
- test
\ No newline at end of file
- deploy/*
image_pull_secrets:
- dockerconfig
......@@ -60,7 +60,7 @@ docs/_build/
fabfile.py
settings.online.py
/gaia/settings.py
settings_local.py
/settings/settings_local.py
media/
log/
crawldata/
......@@ -85,4 +85,4 @@ gaia/rpcd.json
dbmw_deploy/config.dir/
sms_config.json
app_conf.xml
\ No newline at end of file
/app_conf.xml
\ No newline at end of file
branches=(
feature/alpha_types
feature/tmp_rm_sensitive
feature/user_list
feature/weibo
haow/batch_create_topic
haow/check_content
haow/dev
haow/home/dev
haow/hotfix
haow/new
haow/pin_crawl
haow/tag
honghsu
hotfix/NoneType
hotfix/Sensitive
hotfix/strip
hotfix/tags_name_repeat
hotfix/topic_repeat
hotfix/user_id_check
jackie/dev
revert-13a16f48
shangwu/hotfix-xiaohongshu
user_level_deal_with
ycl/fix
ycl/location
ycl/location_test
yingjie/ins_account_exist
)
for branch_name in ${branches[@]}
do
git push origin :$branch_name
done
# service
apiVersion: v1
kind: Service
metadata:
name: saturn
spec:
ports:
- name: tcp-80-80
port: 80
protocol: TCP
targetPort: 80
selector:
release: saturn
sessionAffinity: None
type: ClusterIP
---
# deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: saturn
release: saturn
name: saturn
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: saturn
release: saturn
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: saturn
release: saturn
spec:
containers:
- command:
- /bin/bash
- -c
- gunicorn gm_rpcd.wsgi:application --bind=0.0.0.0:80 --workers=16 --worker-class=gevent
--worker-connections=1024 --timeout 600 --chdir /srv/apps/saturn/
image: ccr.ccs.tencentyun.com/gm-ai/like-saturn:<IMAGE_TAG>
imagePullPolicy: Always
name: saturn
ports:
- containerPort: 80
name: http
protocol: TCP
imagePullSecrets:
- name: gm-secret
restartPolicy: Always
\ No newline at end of file
FROM ccr.ccs.tencentyun.com/gm-ai/like-configs:prod as configs
FROM ccr.ccs.tencentyun.com/gm-ai/alpha-python:3.6
COPY --from=configs /etc/gm-config /etc/gm-config
RUN mkdir -p /data/log/sms/app
COPY ./requirements.txt /srv/apps/sms/
WORKDIR /srv/apps/sms/
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
COPY . .
ENV GM_RPCD_DEPLOY_CONF_PATH="/srv/apps/sms/app_conf.xml"
ENV PROJECT_ENV=prod
COPY ./deploy/prod/app_conf.xml .
COPY ./deploy/prod/settings_local.py ./settings/
CMD bash -c 'source ~/.bashrc && gunicorn gm_rpcd.wsgi:application -w 16 -b 0.0.0.0:80 -k gevent'
<?xml version="1.0" encoding="utf-8"?>
<gm_rpcd_config>
<info config_name="app" version="1.0"/>
<config name="sentry_dsn" value="http://39f1236352c04a80826878f459ef1b05:333fbf94113c4879addaf656f233eb8e@sentry.igengmei.com/138"/>
<config name="application_name" value="saturn"/>
<config name="service_list">
<element value="saturn"/>
</config>
<config name="initializer_list">
<element value="saturn.django_init"/>
</config>
</gm_rpcd_config>
\ No newline at end of file
import helios
DEBUG = False
# QINIU_ACCESS_KEY = "ln5otz9s46t3LcpAFXcA1faYO8y1K34f6cvVBXiz"
# QINIU_SECRET_KEY = "hDZJAfVecAn0qj3pCONyd9ba-cTiekQZs2HIJalI"
SENTRY_CELERY_ENDPOINT = 'http://2ee4f9dbe16747da9ac504cc62deace2:37bcd9464f1d47a99b2b72e777f322f4@sentry.gengmei.cc/26'
# ALLOWED_HOSTS = ["xxx"]
USER_COOKIE_NAME = 'sessionid'
RPC_INVOKER = helios.rpc.create_default_invoker(debug=DEBUG)
#DEBUG_PROPAGATE_EXCEPTIONS = True
TMP_STATIC_DOMAIN = "earth.igengmei.com"
SESSION_COOKIE_DOMAIN_IGENGMEI = '127.0.0.1'
REDIS_HOST = '172.17.40.145'
REDIS_GROUP = {
'pick_cache': {'host': REDIS_HOST, 'port': 6379, 'db': 1, 'password': 'zi1jlhVHtH8MGNqB'},
'ins_cache': {'host': REDIS_HOST, 'port': 6379, 'db': 1, 'password': 'zi1jlhVHtH8MGNqB'},
}
\ No newline at end of file
FROM ccr.ccs.tencentyun.com/gm-ai/like-configs:stage as configs
FROM ccr.ccs.tencentyun.com/gm-ai/alpha-python:3.6
COPY --from=configs /etc/gm-config /etc/gm-config
RUN mkdir -p /data/log/sms/app
COPY ./requirements.txt /srv/apps/sms/
WORKDIR /srv/apps/sms/
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
COPY . .
ENV GM_RPCD_DEPLOY_CONF_PATH="/srv/apps/sms/app_conf.xml"
ENV PROJECT_ENV=stage
COPY ./deploy/stage/app_conf.xml .
COPY ./deploy/stage/settings_local.py ./settings/
CMD bash -c 'source ~/.bashrc && gunicorn gm_rpcd.wsgi:application -w 16 -b 0.0.0.0:80 -k gevent'
<?xml version="1.0" encoding="utf-8"?>
<gm_rpcd_config>
<info config_name="app" version="1.0"/>
<config name="sentry_dsn" value="http://39f1236352c04a80826878f459ef1b05:333fbf94113c4879addaf656f233eb8e@sentry.igengmei.com/138"/>
<config name="application_name" value="saturn"/>
<config name="service_list">
<element value="saturn"/>
</config>
<config name="initializer_list">
<element value="saturn.django_init"/>
</config>
</gm_rpcd_config>
\ No newline at end of file
import helios
DEBUG = False
# QINIU_ACCESS_KEY = "ln5otz9s46t3LcpAFXcA1faYO8y1K34f6cvVBXiz"
# QINIU_SECRET_KEY = "hDZJAfVecAn0qj3pCONyd9ba-cTiekQZs2HIJalI"
SENTRY_CELERY_ENDPOINT = 'http://2ee4f9dbe16747da9ac504cc62deace2:37bcd9464f1d47a99b2b72e777f322f4@sentry.gengmei.cc/26'
# ALLOWED_HOSTS = ["xxx"]
USER_COOKIE_NAME = 'sessionid'
RPC_INVOKER = helios.rpc.create_default_invoker(debug=DEBUG)
#DEBUG_PROPAGATE_EXCEPTIONS = True
TMP_STATIC_DOMAIN = "earth.igengmei.com"
SESSION_COOKIE_DOMAIN_IGENGMEI = '127.0.0.1'
REDIS_HOST = '172.17.40.145'
REDIS_GROUP = {
'pick_cache': {'host': REDIS_HOST, 'port': 6379, 'db': 1, 'password': 'zi1jlhVHtH8MGNqB'},
'ins_cache': {'host': REDIS_HOST, 'port': 6379, 'db': 1, 'password': 'zi1jlhVHtH8MGNqB'},
}
\ No newline at end of file
FROM ccr.ccs.tencentyun.com/gm-ai/like-configs:test as configs
FROM ccr.ccs.tencentyun.com/gm-ai/alpha-python:3.6
COPY --from=configs /etc/gm-config /etc/gm-config
RUN mkdir -p /data/log/sms/app
COPY ./requirements.txt /srv/apps/sms/
WORKDIR /srv/apps/sms/
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
COPY . .
ENV GM_RPCD_DEPLOY_CONF_PATH="/srv/apps/sms/app_conf.xml"
ENV PROJECT_ENV=test
COPY ./deploy/test/app_conf.xml .
COPY ./deploy/test/settings_local.py ./settings/
CMD bash -c 'source ~/.bashrc && gunicorn gm_rpcd.wsgi:application -w 16 -b 0.0.0.0:80 -k gevent'
<?xml version="1.0" encoding="utf-8"?>
<gm_rpcd_config>
<info config_name="app" version="1.0"/>
<config name="sentry_dsn" value="http://39f1236352c04a80826878f459ef1b05:333fbf94113c4879addaf656f233eb8e@sentry.igengmei.com/138"/>
<config name="application_name" value="earth"/>
<config name="service_list">
<element value="earth"/>
</config>
<config name="initializer_list">
<element value="earth.django_init"/>
</config>
</gm_rpcd_config>
\ No newline at end of file
import helios
DEBUG = True
# QINIU_ACCESS_KEY = "ln5otz9s46t3LcpAFXcA1faYO8y1K34f6cvVBXiz"
# QINIU_SECRET_KEY = "hDZJAfVecAn0qj3pCONyd9ba-cTiekQZs2HIJalI"
SENTRY_CELERY_ENDPOINT = 'http://45b0ef6a79204d6988b59c32c9dd4bef:fa018677fb4f49be88d2ba61cdc7ee32@sentry.igengmei.com/135'
REDIS_HOST = '172.21.52.8'
REDIS_GROUP = {
'ins_cache': {'host': REDIS_HOST, 'port': 6379, 'db': 1, 'password': 'Gengmei123'},
}
# ALLOWED_HOSTS = ["xxx"]
USER_COOKIE_NAME = 'sessionid'
RPC_INVOKER = helios.rpc.create_default_invoker(debug=DEBUG)
DEBUG_PROPAGATE_EXCEPTIONS = True
TMP_STATIC_DOMAIN = "earth.igengmei.com"
SESSION_COOKIE_DOMAIN_IGENGMEI = '127.0.0.1'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment