-
Notifications
You must be signed in to change notification settings - Fork 14
/
demo.sh
79 lines (55 loc) · 1.8 KB
/
demo.sh
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
echo${env.JOB_NAME}
stage('echoenv'){
steps{
echo "env.JOBNAME===>${env.JOB_NAME}"
echo "env.J0B_BASENAME二s>${env.JOB_BASENAME}"
echo "env.BUILDTAG===>${env.BUILDTAG}"
echo "env.WORKSPACE==>${env.WORKSPACE}"
echo "env.BUILDNUMBER=>${env.BUILDNUMBER}"
echo "env.BUILDID==>${env.BUILDID}"
echo "env.BUILDDISPLAYNAME==>${env.BUILDDISPLAYNAME}"
echo "env.NODENAME二:=>${env.NODE_NAME}"
echo "env.NODE_LABELS===>${env.NODELABELS}"
echo "env.JENKINSHOME>${env.JENKINSHOME}"
echo "env.JENKINSURL===>${env.JENKINS_URL}"
echo "env.BUILDURL=>${env.BUILDURL}"
echo "env.JOB_URL>${env.JOB_URL}"
}}
#start_time="2015-03-16"
#time1=$(($(date+%s-d"now")-$(date+%s-d"${start_time}")))
##echo$time1#间隔的秒
#echo "间隔的天数"
#days=$((${time1}/(3600*24)-1600))#间隔的天数
#echo$(((${time1}/(3600*24)+1)/365))#间隔的年数
#echo$(((${time1}/(3600*24)+1)/365*12))#间隔的月数
#echo "++++++++++++++++++++++++++++++++++++++++"
#dateNow=$(date-d'now')
#echo "系统当前时间:"${dateNow}""#系统当前时间
#minutes=$(date+%H-d"now")
#echo$minutes
#echo "++++++++++++++++++++++++++++++++++++++++"
#version="3.8.$days.$minutes"
#starttime=$(date+'%Y-%m-%d%H:%M:%S')
#echo${version}
#nowtime=$(date+%Y%m%d)
#echo$nowtime
#echo$start2015
#echo$((nowtime-start2015))
#执行程序
#endtime=$(date+'%Y-%m-%d%H:%M:%S')
#echo${endtime}
#start_seconds=$(date--date="$starttime"+%s)
#echo${start_seconds}
#end_seconds=$(date--date="$endtime"+%s)
#echo${end_seconds}
#echo "本次运行时间:"$((end_seconds-start_seconds))"s"
#echo${baseDate}
#Write-Host"GeneratingBuildNumber"
#$baseDate=[datetime]"01/01/2000"
#$currentDate=$(Get-Date)
#$interval=NEW-TIMESPAN–Start$baseDate–End$currentDate
#$days=$interval.Days-7200
#$minutes=$interval.Minutes
#$version="3.8.$days.$minutes"
#Write-Host"$version"