Commit a3fdbc66 authored by 胡凯旋's avatar 胡凯旋

Merge branch 'test' into 'master'

add Dockerfile, Jenkinsfile

See merge request !1
parents 8ac75522 e880f373
FROM ccr.ccs.tencentyun.com/gm-base/gm-alpine:v1.3
COPY ./requirements.txt /tmp
RUN apk add --no-cache --virtual .build-deps \
bzip2-dev \
coreutils \
dpkg-dev dpkg \
expat-dev \
findutils \
gcc \
gdbm-dev \
libc-dev \
libffi-dev \
libnsl-dev \
libressl-dev \
libtirpc-dev \
linux-headers \
make \
ncurses-dev \
pax-utils \
readline-dev \
sqlite-dev \
tcl-dev \
tk \
tk-dev \
xz-dev \
zlib-dev \
# 业务相关依赖和安装工具
linux-headers \
python3-dev \
librdkafka-dev \
mariadb-client \
mariadb-dev \
git \
openssh \
\
# 取消ssh第一次链接的确认
&& echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config \
&& apk add --no-cache mariadb-connector-c-dev libxml2-dev libxslt-dev librdkafka-dev \
&& apk add --no-cache jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \
&& pip install --no-cache-dir -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r /tmp/requirements.txt \
&& apk del .build-deps \
&& mkdir -p /data/log/channels/app
COPY . /srv/apps/channels/
WORKDIR /srv/apps/channels
CMD gunicorn channels.wsgi:application -w 5 -k gevent -b 0.0.0.0:8000
@Library('gm-pipeline-library') _
pipeline {
agent any
options {
// Console output add timestamps
timestamps()
// Disallow concurrent executions of the Pipeline
disableConcurrentBuilds()
// On failure, retry the entire Pipeline the specified number of times.
retry(1)
}
parameters {
choice(name: 'cache', choices: ['', '--no-cache'], description: 'docker build 是否使用cache,默认使用,不使用为--no-cache')
}
environment {
// Image Tag branch.time.hash
TAG = dockerTag()
// Image Full Tag
IMAGE = "${DOCKER_REGISTRY}/gm-backend/channels:$TAG"
}
stages {
stage("Begin") {
steps {
dingNotify "before"
}
}
stage('Build') {
steps {
sh "docker build . ${params.cache} -f ./Dockerfile -t $IMAGE"
sh "docker push $IMAGE"
}
}
}
post {
always {
dingNotify "after", "${currentBuild.currentResult}"
}
}
}
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