-
Notifications
You must be signed in to change notification settings - Fork 0
/
jenkins_build.sh
85 lines (77 loc) · 3.57 KB
/
jenkins_build.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
80
81
82
83
84
85
TIME=$(date "+%Y-%m-%d_%H:%M:%S")
WORK_SPACE=WORK_SPACE.xcworkspace
IPA_DIR=/data/env/download/download/ios/app/ipa
BUILD_DIR=$WORKSPACE/build
EXPORTPATH=$WORKSPACE/archive
IPA=Release.ipa
TEMP_NAME=${BUILD_NUMBER}_${BRANCH}_${TIME}
newIPA=$TEMP_NAME.ipa
PLIST=$EXPORTPATH/$TEMP_NAME.plist
ARCHIVEPATH=$BUILD_DIR/WORK_SPACE.xcarchive
#EXPORTOPTIONSPLIST=/Users/macmini/enterprise.plist
#chmod +x modify_project.py
#./modify_project.py
#carthage update --platform iOS --cache-builds
security unlock-keychain -p wwww /Users/liwenyou/Library/Keychains/login.keychain
DATE_ICON=$(date "+%Y/%m/%d")
TIME_ICON=$(date "+%H:%M:%S")
#ICON_PATH="${WORKSPACE}/WORK_SPACE/Images.xcassets/AppIcon.appiconset"
#convert -background '#0008' -fill white -gravity center -size 120x90 caption:"${BRANCH}\n${BUILD_NUMBER}\n${DATE_ICON}\n${TIME_ICON}" ${ICON_PATH}/[email protected] +swap -gravity south -composite ${ICON_PATH}/[email protected]
#convert -background '#0008' -fill white -gravity center -size 180x135 caption:"${BRANCH}\n${BUILD_NUMBER}\n${DATE_ICON}\n${TIME_ICON}" ${ICON_PATH}/[email protected] +swap -gravity south -composite ${ICON_PATH}/[email protected]
xcodebuild -workspace $WORK_SPACE -scheme Release -configuration Release clean
xcodebuild -workspace $WORK_SPACE -scheme Release -configuration Release -sdk iphoneos -archivePath $ARCHIVEPATH CODE_SIGN_IDENTITY="Apple Distribution: Wenyou Leo (TARPWKMCQK)" archive
xcodebuild -exportArchive -archivePath $ARCHIVEPATH -exportPath $EXPORTPATH -exportOptionsPlist ~/enterprise.plist
cp ${WORKSPACE}/build/WORK_SPACE.xcarchive/Info.plist ${EXPORTPATH}
echo ${EXPORTPATH}
#cp $EXPORTPATH/$IPA $EXPORTPATH/$newIPA
#ssh [email protected] "[ -d $IPA_DIR/$BRANCH ] && rm -fr $IPA_DIR/$BRANCH/* || mkdir -p $IPA_DIR/$BRANCH/"
#scp $EXPORTPATH/$newIPA [email protected]:$IPA_DIR/$BRANCH/
#
#
#APP_VERSION=$(/usr/libexec/PlistBuddy -c "Print :ApplicationProperties:CFBundleShortVersionString" $EXPORTPATH/Info.plist)
#
#echo "<?xml version="1.0" encoding="UTF-8"?>
#<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
#<plist version="1.0">
#<dict>
# <key>items</key>
# <array>
# <dict>
# <key>assets</key>
# <array>
# <dict>
# <key>kind</key>
# <string>software-package</string>
# <key>url</key>
# <string>https://mt01.fengjr.com/download/ios/app/ipa/$BRANCH/$newIPA</string>
# </dict>
# <dict>
# <key>kind</key>
# <string>display-image</string>
# <key>url</key>
# <string>https://mt01.fengjr.com/download/ios/app/display-image.png</string>
# </dict>
# <dict>
# <key>kind</key>
# <string>full-size-image</string>
# <key>url</key>
# <string>https://mt01.fengjr.com/download/ios/app/full-size-image.png</string>
# </dict>
# </array>
# <key>metadata</key>
# <dict>
# <key>bundle-identifier</key>
# <string>com.fengjr.mobilePrivate</string>
# <key>bundle-version</key>
# <string>$APP_VERSION</string>
# <key>kind</key>
# <string>software</string>
# <key>title</key>
# <string>凤凰金融</string>
# </dict>
# </dict>
# </array>
#</dict>
#</plist>" > $PLIST
#
#scp $PLIST [email protected]:/data/env/download/download/ios/app/ipa/$BRANCH/