Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IT-monitor
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张伯涛
IT-monitor
Commits
b28ceee9
Commit
b28ceee9
authored
May 17, 2022
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改发版配置文件
parent
08854bc7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
209 additions
and
1 deletion
+209
-1
.env.production
.env.production
+1
-1
Jenkinsfile
configuration/Jenkinsfile
+94
-0
Dockerfile
deploy/dev/Dockerfile
+9
-0
devops-rc-process-web.yaml
deploy/dev/devops-rc-process-web.yaml
+104
-0
package.json
package.json
+1
-0
No files found.
.env.production
View file @
b28ceee9
...
@@ -21,7 +21,7 @@ ENV = 'production'
...
@@ -21,7 +21,7 @@ ENV = 'production'
# 生产环境
# 生产环境
# base api
# base api
VUE_APP_BASE_API = 'http://
zt.cebitic.com:10184
'
VUE_APP_BASE_API = 'http://
117.122.212.91:32032
'
# workFlow链接地址
# workFlow链接地址
VUE_APP_WORKFLOW = 'http://zt.cebitic.com:10184/workFlow'
VUE_APP_WORKFLOW = 'http://zt.cebitic.com:10184/workFlow'
# internal链接地址
# internal链接地址
...
...
configuration/Jenkinsfile
0 → 100644
View file @
b28ceee9
pipeline
{
agent
{
node
{
label
'nodejs16'
}
}
parameters
{
string
(
name:
'TAG_NAME'
,
defaultValue:
'1.0'
,
description:
''
)
choice
(
description:
'你需要选择哪个环境进行构建?'
,
name:
'ENVIRONMENT'
,
choices:
[
'dev'
,
'test'
])
}
environment
{
DOCKER_CREDENTIAL_ID
=
'91isoft-harbor'
GITLAB_CREDENTIAL_ID
=
'91isoft-gitlab'
KUBECONFIG_CREDENTIAL_ID
=
'91isoft-kube'
REGISTRY
=
'harbor.91isoft.com:100'
HARBOR_NAMESPACE
=
'cy'
GITLAB_ACCOUNT
=
'licongyang@91isoft.com'
APP_NAME
=
'91isoft-v3-monitor-web'
GIT_LAB_PROJECT
=
'http://gitlab.91isoft.com:90/zhangbotao/it-monitor.git '
}
stages
{
stage
(
'checkout scm'
)
{
steps
{
checkout
(
scm
)
}
}
stage
(
'get dependencies'
)
{
steps
{
container
(
'nodejs16'
)
{
sh
'rm -rf node_modules'
sh
'node -v'
sh
'npm -v'
sh
'yarn -v'
sh
'yarn install'
}
}
}
stage
(
'build'
)
{
steps
{
container
(
'nodejs16'
)
{
sh
'yarn run build:$ENVIRONMENT'
}
}
}
stage
(
'push'
)
{
steps
{
container
(
'nodejs16'
)
{
sh
'cp `pwd`/deploy/$ENVIRONMENT/Dockerfile `pwd`/configuration/'
sh
'rm -rf dist/dist.tar.gz'
sh
'cd dist && tar -zcvf dist.tar.gz *'
sh
'echo `pwd`'
sh
'cd ../'
sh
'cat `pwd`/configuration/Dockerfile'
sh
'docker build --no-cache -f `pwd`/configuration/Dockerfile -t $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest .'
withCredentials
([
usernamePassword
(
passwordVariable
:
'DOCKER_PASSWORD'
,
usernameVariable
:
'DOCKER_USERNAME'
,
credentialsId
:
"$DOCKER_CREDENTIAL_ID"
)])
{
sh
'echo "$DOCKER_PASSWORD" | docker login $REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
sh
'docker push $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest'
}
}
}
}
//deploy
stage
(
'deploy'
)
{
steps
{
//input(id: 'deploy-to-test', message: 'deploy to test?')
kubernetesDeploy
(
configs:
"deploy/$ENVIRONMENT/**.yaml"
,
enableConfigSubstitution:
true
,
kubeconfigId:
"$KUBECONFIG_CREDENTIAL_ID"
)
}
}
stage
(
'push with tag'
){
when
{
expression
{
return
params
.
TAG_NAME
=~
/v.*/
}
}
steps
{
input
(
id:
'release-image-with-tag'
,
message:
'release image with tag?'
)
withCredentials
([
usernamePassword
(
credentialsId:
"$GITLAB_CREDENTIAL_ID"
,
passwordVariable:
'GIT_PASSWORD'
,
usernameVariable:
'GIT_USERNAME'
)])
{
sh
'git config --global user.email "licongyang@91isoft.com" '
sh
'git config --global user.name "cy" '
sh
'git tag -a $TAG_NAME -m "$TAG_NAME" '
sh
'git push $GIT_LAB_PROJECT --tags --ipv4'
}
sh
'docker tag $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME '
sh
'docker push $REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:$TAG_NAME '
}
}
}
}
deploy/dev/Dockerfile
0 → 100644
View file @
b28ceee9
FROM
nginx
MAINTAINER
cy "licongyang@91isoft.com"
ENV
LANG C.UTF-8
ENV
TZ=Asia/Shanghai
RUN
ln
-snf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
RUN
mkdir
-p
/usr/share/nginx/html/
ADD
dist/dist.tar.gz /usr/share/nginx/html/
EXPOSE
80
ENTRYPOINT
nginx -g "daemon off;"
deploy/dev/devops-rc-process-web.yaml
0 → 100644
View file @
b28ceee9
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
labels
:
app
:
rcisoft-monitor
component
:
rcisoft-monitor
tier
:
front
name
:
rcisoft-v2-monitor-deploy
namespace
:
rcisoft-v2
spec
:
progressDeadlineSeconds
:
600
replicas
:
1
selector
:
matchLabels
:
app
:
rcisoft-monitor
component
:
rcisoft-monitor
tier
:
front
template
:
metadata
:
labels
:
app
:
rcisoft-monitor
component
:
rcisoft-monitor
tier
:
front
spec
:
volumes
:
-
name
:
date-config
hostPath
:
path
:
/etc/localtime
type
:
File
-
name
:
nginx-config
configMap
:
name
:
nginx-conf
items
:
-
key
:
nginx-process.conf
path
:
etc/nginx/nginx.conf
defaultMode
:
420
containers
:
-
env
:
-
name
:
TZ
value
:
Asia/Shanghai
-
name
:
build-number
value
:
$BUILD_NUMBER
image
:
$REGISTRY/$HARBOR_NAMESPACE/$APP_NAME:latest
#先屏蔽健康检查
#readinessProbe:
# httpGet:
# path: /
# port: 8080
# timeoutSeconds: 10
# failureThreshold: 30
# periodSeconds: 5
name
:
rcisoft-v2-monitor
imagePullPolicy
:
Always
ports
:
-
containerPort
:
8080
protocol
:
TCP
resources
:
limits
:
cpu
:
400m
memory
:
500Mi
requests
:
cpu
:
200m
memory
:
256Mi
volumeMounts
:
-
name
:
date-config
readOnly
:
true
mountPath
:
/etc/localtime
-
name
:
nginx-config
mountPath
:
/etc/nginx/nginx.conf
subPath
:
etc/nginx/nginx.conf
terminationMessagePath
:
/dev/termination-log
terminationMessagePolicy
:
File
dnsPolicy
:
ClusterFirst
restartPolicy
:
Always
terminationGracePeriodSeconds
:
30
imagePullSecrets
:
-
name
:
91isoft-harbor
strategy
:
type
:
RollingUpdate
rollingUpdate
:
maxUnavailable
:
25%
maxSurge
:
25%
---
kind
:
Service
apiVersion
:
v1
metadata
:
name
:
rcisoft-v2-monitor-svc
namespace
:
rcisoft-v2
labels
:
app
:
rcisoft-monitor
spec
:
ports
:
-
name
:
tcp-80
protocol
:
TCP
port
:
80
targetPort
:
80
nodePort
:
30306
selector
:
app
:
rcisoft-monitor
component
:
rcisoft-monitor
tier
:
front
type
:
NodePort
package.json
View file @
b28ceee9
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
"scripts"
:
{
"scripts"
:
{
"dev"
:
"vue-cli-service serve"
,
"dev"
:
"vue-cli-service serve"
,
"build:prod"
:
"vue-cli-service build"
,
"build:prod"
:
"vue-cli-service build"
,
"build:dev"
:
"vue-cli-service build"
,
"build:stage"
:
"vue-cli-service build --mode staging"
,
"build:stage"
:
"vue-cli-service build --mode staging"
,
"build:test"
:
"vue-cli-service build --mode test"
,
"build:test"
:
"vue-cli-service build --mode test"
,
"preview"
:
"node build/index.js --preview"
,
"preview"
:
"node build/index.js --preview"
,
...
...
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