jenkins自动发布之java项目

java项目 微服务 安装插件 Maven Integration Dockerfile FROM openjdk:8-jre-slim MAINTAINER yanyong ARG ACTIVE ENV JAVA_OPT="-Xms1g -Xmx1g" ENV JAVA_ARG="--spring.profiles.active=$ACTIVE" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && echo 'Asia/Shanghai' > /etc/timezone ADD target/*.jar /opt/app.jar CMD ["sh","-c","exec java $JAVA_OPT -jar /opt/app.jar $JAVA_ARG"] deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: name: megaordermiddleware-basic-gateway spec: selector: matchLabels: app: megaordermiddleware-basic-gateway replicas: 2 template: metadata: labels: app: megaordermiddleware-basic-gateway spec: containers:

jenkins自动发布之go/golang项目

go语言项目 后端API接口 beego框架 Dockerfile FROM golang:1.16-alpine as builder WORKDIR /work ENV GO111MODULE=on \ GOPROXY=https://goproxy.cn,direct COPY . . RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app . \ && mkdir run && cp -r conf app run && cp conf/app-test.conf run/conf/app.conf #FROM scratch FROM alpine RUN apk add --no-cache ca-certificates tzdata \ && ln

Docker安装jenkins

运行jenkins 1 2 3 4 5 6 7 8 9 10 11 12 13 sudo docker run \ --name jenkins-blueocean \ --env TZ='Asia/Shanghai' \ -u root \ -d \ -p 8080:8080 \ -p 50000:50000 \ --restart always \ -v /data/jenkins_home:/var/jenkins_home \ -v /var/run/docker.sock:/var/run/docker.sock \ jenkinsci/blueocean sudo docker exec jenkins-blueocean cat /var/jenkins_home/secrets/initialAdminPassword 安装插件 Publish Over SSH https://plugins.jenkins.io/publish-over-ssh/

k8s部署elasticsearch

安装ECK 1 2 kubectl create -f https://download.elastic.co/downloads/eck/2.1.0/crds.yaml kubectl apply -f https://download.elastic.co/downloads/eck/2.1.0/operator.yaml 安装Elasticsearch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 tee elasticsearch-7.16.3.yaml << EOF

nginx反向代理配置参考

参考配置 1 2 3 4 5 6 7 8 9 10 11 cd /etc/nginx sudo tar -czvf nginx_$(date +'%F_%H-%M-%S').tar.gz nginx.conf sites-available/ sites-enabled/ nginxconfig.io/ sudo tar -xzvf nginxconfig.io-example.com.tar.gz | xargs sudo chmod 0644 sudo openssl dhparam -out /etc/nginx/dhparam.pem 2048 sudo mkdir -p /var/www/_letsencrypt sudo chown www-data /var/www/_letsencrypt sudo sed -i -r 's/(listen .*443)/\1; #/g; s/(ssl_(certificate|certificate_key|trusted_certificate) )/#;#\1/g; s/(server \{)/\1\n ssl off;/g' /etc/nginx/sites-available/example.com.conf sudo sed -i -r -z 's/#?; ?#//g;