Commit 7655cb7a by qp65053

'cicd'

parent 8e0acaf3
Pipeline #8931 canceled with stages
stages:
- build
- make
- test
- deploy
variables:
VERSION: "3.$CI_PIPELINE_ID"
BUILDDIR: "/builds"
LOCALDIR: "/opt/gitlab-runner/builds"
NAMESPACE: "srs-prd"
projName: "offcn-live-msg-sink"
ppt-server-build:
stage: build
before_script:
- source /builds/cicd/base.sh
docker-build:
tags:
- test-ppt-server-shell
only:
- test
retry: 2
- offcn-live-msg-sink-shell
stage: build
retry: 1
script:
#- GO111MODULE=auto
#- mkdir -p ${BUILDDIR}/ppt-server
#- rm -rf ${BUILDDIR}/ppt-server/*
#- go build -o ${BUILDDIR}/ppt-server/ppt-server
#- cp -f Dockerfile ${BUILDDIR}/ppt-server/
#- cp -rf conf ${BUILDDIR}/ppt-server/
#- cd ${BUILDDIR}/ppt-server/
- docker build -t registry.cn-beijing.aliyuncs.com/offcn_llive/ppt-server:$VERSION .
- docker push registry.cn-beijing.aliyuncs.com/offcn_llive/ppt-server:$VERSION
- docker rmi registry.cn-beijing.aliyuncs.com/offcn_llive/ppt-server:$VERSION &
ppt-server-deploy:
stage: deploy
- source $PROJDIR/$projName/build.sh
k8s-deploy:
tags:
- test-ppt-server-shell
only:
- test
retry: 2
before_script:
- CLUSTER="hb2-center"
- offcn-live-msg-sink-shell
stage: deploy
retry: 1
script:
- set -x
- for cs in ${CLUSTER[@]};do \
- kubectl set image -n ${NAMESPACE} deployment/ppt-server-deployment ppt-server=registry.cn-beijing.aliyuncs.com/offcn_llive/ppt-server:$VERSION; \
- done
\ No newline at end of file
- set -xe
- source $PROJDIR/$projName/deploy.sh
FROM registry.cn-beijing.aliyuncs.com/offcn_llive/go:build as build
COPY . /tmp/develop
RUN cd /tmp/develop \
&& go build -o /tmp/ppt-server main.go
#FROM debian:buster-slim
FROM registry.cn-beijing.aliyuncs.com/offcn_llive/go:runtime-alpine-3.10
ENV branch test
ENV rb_host rmq-cluster-balancer
ENV rb_user video
ENV rb_pass 1fqH4WFR19uckgRyHzgISw
ENV read_sql rr-2ze1xl88115o8i2umlo.mysql.rds.aliyuncs.com
ENV read_user video
ENV read_pass 'vlty&AxMwT$lmLv6bN8dkDuBYlh%N5pe'
ENV write_sql rm-2zevlk47ul0ovuci80o.mysql.rds.aliyuncs.com
ENV write_user video
ENV write_pass 'vlty&AxMwT$lmLv6bN8dkDuBYlh%N5pe'
COPY --chown=1000:1000 --from=build /tmp/ppt-server /src/ppt-server/
COPY --chown=1000:1000 conf/ /src/ppt-server/conf
RUN chmod +x /src/ppt-server/ppt-server
WORKDIR /src/ppt-server/
CMD ["./ppt-server"]
\ 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