Commit 7655cb7a by qp65053

'cicd'

parent 8e0acaf3
Pipeline #8931 canceled with stages
stages: stages:
- build - build
- make - test
- deploy - deploy
variables: variables:
VERSION: "3.$CI_PIPELINE_ID" projName: "offcn-live-msg-sink"
BUILDDIR: "/builds"
LOCALDIR: "/opt/gitlab-runner/builds"
NAMESPACE: "srs-prd"
ppt-server-build: before_script:
stage: build - source /builds/cicd/base.sh
docker-build:
tags: tags:
- test-ppt-server-shell - offcn-live-msg-sink-shell
only: stage: build
- test retry: 1
retry: 2
script: script:
#- GO111MODULE=auto - source $PROJDIR/$projName/build.sh
#- mkdir -p ${BUILDDIR}/ppt-server
#- rm -rf ${BUILDDIR}/ppt-server/* k8s-deploy:
#- 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
tags: tags:
- test-ppt-server-shell - offcn-live-msg-sink-shell
only: stage: deploy
- test retry: 1
retry: 2
before_script:
- CLUSTER="hb2-center"
script: script:
- set -x - set -xe
- for cs in ${CLUSTER[@]};do \ - source $PROJDIR/$projName/deploy.sh
- 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
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