Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
唐文
/
AiyoZhuaWaWa
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bb8f8d01
authored
Nov 30, 2017
by
chengfengpiaopiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jenkins bat脚本
parent
2e613d45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
11 deletions
app/build.gradle
jiagubao-walle.bat
shell.sh
app/build.gradle
View file @
bb8f8d01
...
...
@@ -47,7 +47,7 @@ def env = ENVIRONMENT
def
packTime
=
getDate
()
def
is_jenkins
=
IS_JENKINS
def
projectNameLowerCase
=
projectName
.
toLowerCase
()
def
fileToJiaGuBaoWalle
android
{
compileSdkVersion
rootProject
.
ext
.
compileSdkVersion
...
...
@@ -120,6 +120,7 @@ android {
}
else
{
channelName
=
PRODUCT_FLAAVOR_BUILD
//outputFile = "/vagrant/jenkins/jenkins-workspace/walleApps/${projectName}"
//path="/var/jenkins_home/walleApps/${projectName}/${env}/${projectNameLowerCase}_${flavorName}_v${appVersion}_${env}_${packTime}.apk"
outputFile
=
"/var/jenkins_home/walleApps/${projectName}"
if
(
"release"
.
equals
(
env
))
{
fileName
=
"${projectNameLowerCase}_${channelName}_v${defaultConfig.versionName}_${env}_${packTime}.apk"
...
...
@@ -131,6 +132,7 @@ android {
}
createFile
(
outputFile
);
println
(
"outputFileFinally ---> "
+
outputFile
);
fileToJiaGuBaoWalle
=
outputFile
output
.
outputFile
=
new
File
(
outputFile
,
fileName
)
}
}
...
...
@@ -182,4 +184,38 @@ task startApp(type: Exec){
task
->
workingDir
'.'
commandLine
'cd'
}
\ No newline at end of file
}
task
upper
<<
{
String
someString
=
'mY_nAmE'
println
"Original: "
+
someString
println
"Upper case: "
+
someString
.
toUpperCase
()
}
task
count
<<
{
4
.
times
{
print
"$it "
}
}
//String cmd = 'explorer .'
//task hello2(){
// println "hello start"
// def cmdResult = cmd.execute().text.trim()
// println cmdResult
// println "hello end"
//}
def
gitVersionCode
()
{
def
cmd
=
'git rev-list HEAD --first-parent --count'
cmd
.
execute
().
text
.
trim
().
toInteger
()
}
///jiagubao-walle.bat 1 2
def
cmd
=
"jiagubao-walle.bat "
+
fileToJiaGuBaoWalle
task
shellTest
<<
{
String
date
=
cmd
.
execute
().
text
.
trim
().
toString
()
//带返回值
print
date
//打印系统日期
}
jiagubao-walle.bat
0 → 100644
View file @
bb8f8d01
echo "Hello jiagubao-walle"
echo param[0] = %0
echo param[1] = %1
\ No newline at end of file
shell.sh
View file @
bb8f8d01
VARIABLE
=
"DuoBaoJingCai"
projectName
=
$(
echo
$VARIABLE
| tr
'[A-Z]'
'[a-z]'
)
echo
$projectName
path
=
"/var/
${
projectName
}
"
path
=
"/var/
${
projectName
}
"
+
"test"
echo
$path
packTime
=
$(
date +%Y%m%d
)
echo
$packTime
#typeset -u VARIABLE
#VARIABLE="True"
#data=$VARIABLE
#echo $data
#!/usr/bin/env bash
#从build.gradle中传入的两个参数
jenkinsJobName
=
$1
jenkinsBuild
=
$2
echo
"jenkinsJobName=
$jenkinsJobName
"
echo
"jenkinsBuild=
$jenkinsBuild
"
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