add simple-ypk-packer

This commit is contained in:
CaiHQ
2022-05-26 15:33:04 +08:00
parent e1e8a393c5
commit 9eb1102a66
28 changed files with 756 additions and 50 deletions

15
docker/Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM openjdk:8
ARG GOPRIVATE=bdware.org/*
ARG GOPROXY=https://goproxy.cn
LABEL maintainer="caihuaqian@internetapi.cn"
LABEL org.bdware.version="0.5.2"
LABEL org.bdware.version.isproduction="true"
LABEL org.bdware.release-date="2022-05-25"
COPY ./output /ypk-deploy-tool
WORKDIR /ypk-deploy-tool
VOLUME /ypk-deploy-tool/input
ENTRYPOINT ["java"]
CMD ["-Dfile.encoding=UTF-8", "-cp", "./libs/*:ypk-deploy-tool.jar", "org.bdware.ypkdeploy.Entry"]

25
docker/buildDocker.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/bash
if [ $# -gt 2 ]; then
echo "too many arguments,\nusage: \$version [-,push,save] \$saveDir"
exit 1
fi
version=$(awk '/version "[0-9]/ { sub(/[^"]*"/,"") ; sub(/".*$/,""); print $0 } ' build.gradle)
cp ./docker/Dockerfile ./build/Dockerfile
cd ./build
DOCKER_CLI_EXPERIMENTAL=enabled
if [ "$1" == "push" ]; then
echo "push to docker hub"
docker buildx build --platform linux/arm64/v8,linux/amd64 -t bdware/ypk-deploy-tool:$version ./ --push
elif [ "$1" == "save" ]; then
echo "save to $2"
docker buildx build --platform linux/arm64/v8 -t bdware/ypk-deploy-tool:arm_$version ./ --load
docker save -o $2/ypk-deploy-tool-arm_$version.tar bdware/ypk-deploy-tool:arm_$version
docker buildx build --platform linux/amd64 -t bdware/ypk-deploy-tool:amd64_$version ./ --load
docker save -o $2/ypk-deploy-tool-amd64_$version.tar bdware/ypk-deploy-tool:amd64_$version
else
echo "create at local"
docker build -t bdware/ypk-deploy-tool:$version ./
docker tag bdware/ypk-deploy-tool:$version bdware/ypk-deploy-tool:latest
fi

View File

@@ -0,0 +1,14 @@
{
"generateTasks": [
{
"isBatch": true,
"dir": "./input/deploy",
"template": "example.json.template",
"commvar": "commonvar.json",
"files": "examplefiles.json"
}
],
"deployTasks": [
"./input/deploy/controlproxy/"
]
}

View File

@@ -0,0 +1,9 @@
version: "3"
services:
ypk-deploy-tool:
image: bdware/ypk-deploy-tool:0.5.2
command: "-Dfile.encoding=UTF-8 -cp ./libs/*:ypk-deploy-tool.jar org.bdware.ypkdeploy.Entry ./deployentry.json"
volumes:
- ./input:/ypk-deploy-tool/input
- ./deployentry.json:/ypk-deploy-tool/deployentry.json

View File

@@ -0,0 +1,2 @@
#! /bin/bash
docker run -v `pwd`/deployentry.json:/ypk-deploy-tool/deployentry.json bdware/ypk-deploy-tool:0.5.2

View File

@@ -0,0 +1,6 @@
{
"_YPK_": "./input/ypk/Example-1.0.6.ypk",
"___山西___": "",
"_IP0_": "39.104.201.40",
"_IP1_": "39.104.208.148"
}

View File

@@ -0,0 +1,18 @@
{
"agentAddress": "_HOST_:18010",
"privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936",
"publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27",
"ypkPath": "_AUDIT_PROXY_YPK_",
"killBeforeStart": "AutoAudit",
"createParam": {
"privateKey": "d675782acf011dbc01a73c7967ccff9564486f7c3a9f5d5de151caffaa18936",
"publicKey": "04303718771b9323c204e607639f14469f9a94e55b0964a408ad3b3864b0493b645d7070da0d550f0c54b934275a8e88dedc3024467b0566db5c1108b1baeaae27",
"repoName": "AuditProxy",
"auditURI": "tcp://_HOST_:18051",
"grafanaUrl": "jdbc:postgresql://iodlog.demo.internetapi.cn:5432/iodlog?useServerPrepStmts=true",
"grafanaUserName": "iodlog",
"grafanaPassword": "iodlog1107",
"grafanaServicePort": 18055,
"aceiServicePort": 18053
}
}

View File

@@ -0,0 +1,46 @@
[
{
"fileName": "./auditproxy/AuditProxy_shanxi.json",
"_HOST_": "_IP0_"
},
{
"fileName": "./auditproxy/AuditProxy_sx_ty.json",
"_HOST_": "_IP1_"
},
{
"fileName": "./auditproxy/AuditProxy_sx_dt.json",
"_HOST_": "_IP2_"
},
{
"fileName": "./auditproxy/AuditProxy_sx_ty_xd.json",
"_HOST_": "_IP3_"
},
{
"fileName": "./auditproxy/AuditProxy_sx_ty_yz.json",
"_HOST_": "_IP4_"
},
{
"fileName": "./auditproxy/AuditProxy_sx_dt_yg.json",
"_HOST_": "_IP5_"
},
{
"fileName": "./auditproxy/AuditProxy_sx_dt_yz.json",
"_HOST_": "_IP6_"
},
{
"fileName": "./auditproxy/AuditProxy_njust.json",
"_HOST_": "_IP7_"
},
{
"fileName": "./auditproxy/AuditProxy_bit.json",
"_HOST_": "_IP8_"
},
{
"fileName": "./auditproxy/AuditProxy_mpi.json",
"_HOST_": "_IP9_"
},
{
"fileName": "./auditproxy/AuditProxy_weixing.json",
"_HOST_": "_IP12_"
}
]

2
docker/javarun.sh Normal file
View File

@@ -0,0 +1,2 @@
#! /bin/bash
java -Dfile.encoding=UTF-8 -cp ./libs/*:ypk-deploy-tool.jar org.bdware.ypkdeploy.Entry ./deployentry.json

15
docker/prepareVersion.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
version=$(awk '/version "[0-9]/ { sub(/[^"]*"/,"") ; sub(/".*$/,""); print $0 } ' build.gradle)
echo version extract from build.gradle '-->' $version
if [ $# -gt 0 ]; then
time=$1
else
time=$(date "+%Y-%m-%d")
fi
echo time is $time
cd ./docker/
awk ' {gsub(/version=\".*\"/,"version=\"'$version'\""); print $0; } ' Dockerfile >Dockerfile.2
awk ' {gsub(/release-date=\".*\"/,"release-date=\"'$time'\""); print $0; } ' Dockerfile.2 >Dockerfile
rm Dockerfile.2