Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tron-explore
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张建华@五瓣科技
tron-explore
Commits
a29fb36e
Commit
a29fb36e
authored
Dec 29, 2020
by
jianhua.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目中添加Docker部署配置文件
parent
e27a57dd
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
162 additions
and
6 deletions
+162
-6
.deploy.sh
.deploy.sh
+6
-0
Dockerfile
.deploy/Dockerfile
+12
-0
deploy.yaml
.deploy/deploy.yaml
+52
-0
.rancher-pipeline.yml
.rancher-pipeline.yml
+37
-0
CensusDataFetcher.java
.../java/com/wuban/tron/explore/fetch/CensusDataFetcher.java
+2
-2
CensusDataHandler.java
...ava/com/wuban/tron/explore/handler/CensusDataHandler.java
+6
-2
application-master.yml
src/main/resources/application-master.yml
+45
-0
application.yml
src/main/resources/application.yml
+2
-2
No files found.
.deploy.sh
0 → 100644
View file @
a29fb36e
#CGO_ENABLED=0 GOOS=linux go build -mod=readonly -o server
mvn
-Dmaven
.test.skip
=
true
clean package
#cp -r server .deploy/server
#docker build -t registry.cn-zhangjiakou.aliyuncs.com/wuban-svr/coupon-api-weixin:1.0.1 ./.deploy/.
#docker push registry.cn-zhangjiakou.aliyuncs.com/wuban-svr/coupon-api-weixin:1.0.1
#rm -r .deploy/server
\ No newline at end of file
.deploy/Dockerfile
0 → 100644
View file @
a29fb36e
# Docker image for springboot file run
# VERSION 0.0.1
# Author: sky
# 基础镜像使用java
FROM
openjdk:8-jdk-alpine
WORKDIR
/zzmg
COPY
target/tron-explore-0.0.1-SNAPSHOT.jar /zzmg/tron-explore.jar
# 运行jar包
ENTRYPOINT
["java","-Djava.security.egd=file:/dev/./urandom","-jar","/zzmg/tron-explore.jar"]
\ No newline at end of file
.deploy/deploy.yaml
0 → 100644
View file @
a29fb36e
kind
:
Service
apiVersion
:
v1
metadata
:
name
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}-r
namespace
:
zzmg-explore
spec
:
selector
:
app
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}
type
:
ClusterIP
ports
:
-
protocol
:
TCP
port
:
80
targetPort
:
8080
---
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
name
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}-r
namespace
:
zzmg-explore
labels
:
app
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}
spec
:
replicas
:
1
selector
:
matchLabels
:
app
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}
template
:
metadata
:
name
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}-r
namespace
:
zzmg-explore
labels
:
app
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}
spec
:
imagePullSecrets
:
-
name
:
aliyun-wuban
containers
:
-
name
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}-r
image
:
${CICD_IMAGE}:build${CICD_EXECUTION_SEQUENCE}
ports
:
-
containerPort
:
8080
---
apiVersion
:
serving.knative.dev/v1
kind
:
Service
metadata
:
name
:
${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}-k
namespace
:
zzmg-explore
spec
:
template
:
spec
:
containers
:
-
image
:
${CICD_IMAGE}:build${CICD_EXECUTION_SEQUENCE}
\ No newline at end of file
.rancher-pipeline.yml
0 → 100644
View file @
a29fb36e
stages
:
-
name
:
Build
steps
:
-
runScriptConfig
:
image
:
registry-vpc.cn-zhangjiakou.aliyuncs.com/wuban/java:8-zzmg1.0
shellScript
:
|-
cd `pwd`
ls
sh ./.deploy.sh
-
name
:
Publish
steps
:
-
publishImageConfig
:
dockerfilePath
:
./.deploy/Dockerfile
buildContext
:
.
tag
:
zzmg-explore-${CICD_GIT_REPO_NAME}-${CICD_GIT_BRANCH}:build${CICD_EXECUTION_SEQUENCE}
pushRemote
:
true
registry
:
registry-vpc.cn-zhangjiakou.aliyuncs.com/wuban-svr
-
name
:
Deploy
steps
:
-
applyYamlConfig
:
path
:
./.deploy/deploy.yaml
env
:
NAMESPACE
:
zzmg-explore
timeout
:
60
branch
:
include
:
-
master
-
develop
-
release
-
hotfix
notification
:
recipients
:
-
recipient
:
jianhua.zhang@wuban.net.cn
notifier
:
c-fmch6:n-2pncc
condition
:
-
Success
-
Failed
src/main/java/com/wuban/tron/explore/fetch/CensusDataFetcher.java
View file @
a29fb36e
...
@@ -41,7 +41,7 @@ public class CensusDataFetcher<T> extends AbstractJob implements ICensusDataFetc
...
@@ -41,7 +41,7 @@ public class CensusDataFetcher<T> extends AbstractJob implements ICensusDataFetc
String
blockSizeStr
=
null
;
String
blockSizeStr
=
null
;
String
transNumberStr
=
null
;
String
transNumberStr
=
null
;
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
//
for (int i = 0; i < 3; i++) {
// Redis 获取区块大小
// Redis 获取区块大小
/*blockSizeStr = this.stringRedisTemplate.opsForList().rightPop(Constant.CENSUS_BLOCK_SIZE);
/*blockSizeStr = this.stringRedisTemplate.opsForList().rightPop(Constant.CENSUS_BLOCK_SIZE);
if (blockSizeStr != null) {
if (blockSizeStr != null) {
...
@@ -57,7 +57,7 @@ public class CensusDataFetcher<T> extends AbstractJob implements ICensusDataFetc
...
@@ -57,7 +57,7 @@ public class CensusDataFetcher<T> extends AbstractJob implements ICensusDataFetc
transNumber
=
transNumber
+
Long
.
valueOf
(
transNumberStr
);
transNumber
=
transNumber
+
Long
.
valueOf
(
transNumberStr
);
blockSize
=
blockSize
+
Long
.
valueOf
(
blockSizeStr
);
blockSize
=
blockSize
+
Long
.
valueOf
(
blockSizeStr
);
}
}
}
//
}
Census
census
=
new
Census
();
Census
census
=
new
Census
();
boolean
flag
=
false
;
boolean
flag
=
false
;
...
...
src/main/java/com/wuban/tron/explore/handler/CensusDataHandler.java
View file @
a29fb36e
...
@@ -53,8 +53,12 @@ public class CensusDataHandler extends AbstractJob implements ICensusDataHandler
...
@@ -53,8 +53,12 @@ public class CensusDataHandler extends AbstractJob implements ICensusDataHandler
public
void
flush
(
List
<
Census
>
e
)
{
public
void
flush
(
List
<
Census
>
e
)
{
if
(!
CollectionUtils
.
isEmpty
(
e
))
{
if
(!
CollectionUtils
.
isEmpty
(
e
))
{
Census
census
=
e
.
get
(
0
);
Census
census
=
e
.
get
(
0
);
this
.
service
.
saveOrUpdateCensus
(
census
);
try
{
log
.
info
(
"区块大小、交易数量统计 {}"
,
census
.
toString
());
this
.
service
.
saveOrUpdateCensus
(
census
);
log
.
info
(
"区块大小、交易数量统计 {}"
,
census
.
toString
());
}
catch
(
Exception
ex
)
{
log
.
error
(
ex
.
getMessage
(),
ex
);
}
}
}
}
}
...
...
src/main/resources/application-master.yml
0 → 100644
View file @
a29fb36e
# config
tron
:
site
:
https://api.shasta.trongrid.io
contract
:
complier
:
site
:
http://47.115.200.174:8080/api/explorer/v1/compileSolidity
spring
:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://zzmg.db.wuban.net.cn:30601/zzmg?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username
:
root
password
:
^osyBXr7}duMefFb
# 初始化大小,最小,最大
initialSize
:
20
minIdle
:
5
maxActive
:
100
# 配置获取连接等待超时的时间
maxWait
:
60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
60000
# 配置一个连接在池中最小生存的时间,单位是毫秒St
minEvictableIdleTimeMillis
:
300000
testWhileIdle
:
true
testOnBorrow
:
false
testOnReturn
:
false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements
:
true
maxPoolPreparedStatementPerConnectionSize
:
20
redis
:
host
:
coupon.redis.db.wuban.net.cn
port
:
30104
jedis
:
pool
:
max-active
:
1024
max-idle
:
200
max-wait
:
10000
min-idle
:
100
timeout
:
10000
password
:
lk_2AF|;29l3qvZJ
database
:
10
\ No newline at end of file
src/main/resources/application.yml
View file @
a29fb36e
...
@@ -5,9 +5,9 @@ server:
...
@@ -5,9 +5,9 @@ server:
spring
:
spring
:
profiles
:
profiles
:
active
:
active
:
-
dev
-
master
application
:
application
:
name
:
tron
-explore
name
:
zzmg
-explore
mybatis
:
mybatis
:
mapper-locations
:
classpath:*.xml
mapper-locations
:
classpath:*.xml
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment