@@ -56,14 +56,6 @@ echo "Building Nudge"
56
56
$XCODE_BUILD -project " $TOOLSDIR /Nudge.xcodeproj" CODE_SIGN_IDENTITY=$APP_SIGNING_IDENTITY OTHER_CODE_SIGN_FLAGS=" --timestamp"
57
57
check_exit_code " $? " " Error running xcodebuild"
58
58
59
- # Setup notary item
60
- $XCODE_NOTARY_PATH store-credentials --apple-id
" [email protected] " --team-id
" T4SK8ZXCXG" --password
" $2 " nudge
61
-
62
- # Zip application for notary
63
- # /usr/bin/ditto -c -k --keepParent "${BUILDSDIR}/Release/Nudge.app" "${BUILDSDIR}/Release/Nudge.zip"
64
- # Notarize nudge application
65
- # $XCODE_NOTARY_PATH submit "${BUILDSDIR}/Release/Nudge.zip" --keychain-profile "nudge" --wait
66
-
67
59
# Create outputs folder
68
60
if [ -e $OUTPUTSDIR ]; then
69
61
/bin/rm -rf $OUTPUTSDIR
73
65
if ! [ -n " $1 " ]; then
74
66
echo " Did not pass option to create package"
75
67
# Move notarized zip to outputs folder
68
+ /usr/bin/ditto -c -k --keepParent " ${BUILDSDIR} /Release/Nudge.app" " ${BUILDSDIR} /Release/Nudge.zip"
76
69
/bin/mv " ${BUILDSDIR} /Release/Nudge.zip" " $OUTPUTSDIR "
77
70
exit 0
78
71
fi
@@ -125,15 +118,7 @@ python3 "${MP_BINDIR}/munki-pkg-${MP_SHA}/munkipkg" "$NUDGE_PKG_PATH"
125
118
PKG_RESULT=" $? "
126
119
check_exit_code " $? " " Could not sign package: Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
127
120
128
- # Notarize nudge package
129
- $XCODE_NOTARY_PATH submit " $NUDGE_PKG_PATH /build/Nudge-$AUTOMATED_NUDGE_BUILD .pkg" --keychain-profile " nudge" --wait
130
- check_exit_code " $? " " Could not notarize package: Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
131
- $XCODE_STAPLER_PATH staple " $NUDGE_PKG_PATH /build/Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
132
- check_exit_code " $? " " Could not staple package: Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
133
- # Move the signed pkg
134
- /bin/mv " $NUDGE_PKG_PATH /build/Nudge-$AUTOMATED_NUDGE_BUILD .pkg" " $OUTPUTSDIR "
135
-
136
- # move the la to the payload folder
121
+ # move the LaunchAgent to the payload folder
137
122
echo " Moving LaunchAgent to payload folder"
138
123
NUDGE_LA_PKG_PATH=" $TOOLSDIR /NudgePkgLA"
139
124
if [ -e $NUDGE_LA_PKG_PATH ]; then
@@ -165,19 +150,11 @@ echo "Moving postinstall to scripts folder"
165
150
}
166
151
SIGNED_JSONFILE
167
152
168
- # Create the signed pkg
153
+ # Create the LaunchAgent signed pkg
169
154
python3 " ${MP_BINDIR} /munki-pkg-${MP_SHA} /munkipkg" " $NUDGE_LA_PKG_PATH "
170
155
check_exit_code " $? " " Could not sign package: Nudge_LaunchAgent-1.0.1.pkg"
171
156
172
- # Notarize launchagent package
173
- $XCODE_NOTARY_PATH submit " $NUDGE_LA_PKG_PATH /build/Nudge_LaunchAgent-1.0.1.pkg" --keychain-profile " nudge" --wait
174
- check_exit_code " $? " " Could not notarize package: Nudge_LaunchAgent-1.0.1.pkg"
175
- $XCODE_STAPLER_PATH staple " $NUDGE_LA_PKG_PATH /build/Nudge_LaunchAgent-1.0.1.pkg"
176
- check_exit_code " $? " " Could not staple package: Nudge_LaunchAgent-1.0.1.pkg"
177
- # Move the signed pkg
178
- /bin/mv " $NUDGE_LA_PKG_PATH /build/Nudge_LaunchAgent-1.0.1.pkg" " $OUTPUTSDIR "
179
-
180
- # move the ld to the payload folder
157
+ # move the Logger to the payload folder
181
158
echo " Moving LaunchDaemon to logging payload folder"
182
159
NUDGE_LD_PKG_PATH=" $TOOLSDIR /NudgePkgLogger"
183
160
if [ -e $NUDGE_LD_PKG_PATH ]; then
@@ -191,7 +168,7 @@ echo "Moving LaunchDaemon to logging payload folder"
191
168
echo " Moving postinstall to scripts folder"
192
169
/bin/cp " ${TOOLSDIR} /build_assets/postinstall-logger" " $NUDGE_LD_PKG_PATH /scripts/postinstall"
193
170
194
- # Create the json file for the signed munkipkg LaunchAgent pkg
171
+ # Create the json file for the signed munkipkg Logger pkg
195
172
/bin/cat << SIGNED_JSONFILE > "$NUDGE_LD_PKG_PATH /build-info.json"
196
173
{
197
174
"distribution_style": true,
@@ -213,14 +190,6 @@ SIGNED_JSONFILE
213
190
python3 " ${MP_BINDIR} /munki-pkg-${MP_SHA} /munkipkg" " $NUDGE_LD_PKG_PATH "
214
191
check_exit_code " $? " " Could not sign package: Nudge_Logger-1.0.1.pkg"
215
192
216
- # Notarize logger package
217
- $XCODE_NOTARY_PATH submit " $NUDGE_LD_PKG_PATH /build/Nudge_Logger-1.0.1.pkg" --keychain-profile " nudge" --wait
218
- check_exit_code " $? " " Could not notarize package: Nudge_Logger-1.0.1.pkg"
219
- $XCODE_STAPLER_PATH staple " $NUDGE_LD_PKG_PATH /build/Nudge_Logger-1.0.1.pkg"
220
- check_exit_code " $? " " Could not staple package: Nudge_Logger-1.0.1.pkg"
221
- # Move the signed pkg
222
- /bin/mv " $NUDGE_LD_PKG_PATH /build/Nudge_Logger-1.0.1.pkg" " $OUTPUTSDIR "
223
-
224
193
# Create the Essentials package
225
194
echo " Moving Nudge.app to payload folder"
226
195
ESSENTIALS_PKG_PATH=" $TOOLSDIR /NudgePkgEssentials"
@@ -259,14 +228,6 @@ SIGNED_JSONFILE
259
228
python3 " ${MP_BINDIR} /munki-pkg-${MP_SHA} /munkipkg" " $ESSENTIALS_PKG_PATH "
260
229
check_exit_code " $? " " Could not sign package: Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
261
230
262
- # Notarize Nudge Essentials package
263
- $XCODE_NOTARY_PATH submit " $ESSENTIALS_PKG_PATH /build/Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg" --keychain-profile " nudge" --wait
264
- check_exit_code " $? " " Could not notarize package: Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
265
- $XCODE_STAPLER_PATH staple " $ESSENTIALS_PKG_PATH /build/Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
266
- check_exit_code " $? " " Could not staple package: Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
267
- # Move the Nudge Essentials signed/notarized pkg
268
- /bin/mv " $ESSENTIALS_PKG_PATH /build/Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg" " $OUTPUTSDIR "
269
-
270
231
# Create the Suite package
271
232
echo " Moving Nudge.app to payload folder"
272
233
SUITE_PKG_PATH=" $TOOLSDIR /NudgePkgSuite"
@@ -308,6 +269,50 @@ SIGNED_JSONFILE
308
269
python3 " ${MP_BINDIR} /munki-pkg-${MP_SHA} /munkipkg" " $SUITE_PKG_PATH "
309
270
check_exit_code " $? " " Could not sign package: Nudge_Suite-$AUTOMATED_NUDGE_BUILD .pkg"
310
271
272
+
273
+ # Notarize packages
274
+ if ! [ -n " $2 " ]; then
275
+ echo " Did not pass option to notarize packages"
276
+ # Move notarized zip to outputs folder
277
+ /bin/mv " ${BUILDSDIR} /Release/Nudge.zip" " $OUTPUTSDIR "
278
+ exit 0
279
+ fi
280
+
281
+ # Setup notary item
282
+ $XCODE_NOTARY_PATH store-credentials --apple-id
" [email protected] " --team-id
" T4SK8ZXCXG" --password
" $2 " nudge
283
+
284
+ # Notarize Nudge package
285
+ $XCODE_NOTARY_PATH submit " $NUDGE_PKG_PATH /build/Nudge-$AUTOMATED_NUDGE_BUILD .pkg" --keychain-profile " nudge" --wait
286
+ check_exit_code " $? " " Could not notarize package: Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
287
+ $XCODE_STAPLER_PATH staple " $NUDGE_PKG_PATH /build/Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
288
+ check_exit_code " $? " " Could not staple package: Nudge-$AUTOMATED_NUDGE_BUILD .pkg"
289
+ # Move the Nudge signed/notarized pkg
290
+ /bin/mv " $NUDGE_PKG_PATH /build/Nudge-$AUTOMATED_NUDGE_BUILD .pkg" " $OUTPUTSDIR "
291
+
292
+ # Notarize Nudge LaunchAgent package
293
+ $XCODE_NOTARY_PATH submit " $NUDGE_LA_PKG_PATH /build/Nudge_LaunchAgent-1.0.1.pkg" --keychain-profile " nudge" --wait
294
+ check_exit_code " $? " " Could not notarize package: Nudge_LaunchAgent-1.0.1.pkg"
295
+ $XCODE_STAPLER_PATH staple " $NUDGE_LA_PKG_PATH /build/Nudge_LaunchAgent-1.0.1.pkg"
296
+ check_exit_code " $? " " Could not staple package: Nudge_LaunchAgent-1.0.1.pkg"
297
+ # Move the Nudge LaunchAgent signed/notarized pkg
298
+ /bin/mv " $NUDGE_LA_PKG_PATH /build/Nudge_LaunchAgent-1.0.1.pkg" " $OUTPUTSDIR "
299
+
300
+ # Notarize Nudge Logger package
301
+ $XCODE_NOTARY_PATH submit " $NUDGE_LD_PKG_PATH /build/Nudge_Logger-1.0.1.pkg" --keychain-profile " nudge" --wait
302
+ check_exit_code " $? " " Could not notarize package: Nudge_Logger-1.0.1.pkg"
303
+ $XCODE_STAPLER_PATH staple " $NUDGE_LD_PKG_PATH /build/Nudge_Logger-1.0.1.pkg"
304
+ check_exit_code " $? " " Could not staple package: Nudge_Logger-1.0.1.pkg"
305
+ # Move the Nudge Logger signed/notarized pkg
306
+ /bin/mv " $NUDGE_LD_PKG_PATH /build/Nudge_Logger-1.0.1.pkg" " $OUTPUTSDIR "
307
+
308
+ # Notarize Nudge Essentials package
309
+ $XCODE_NOTARY_PATH submit " $ESSENTIALS_PKG_PATH /build/Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg" --keychain-profile " nudge" --wait
310
+ check_exit_code " $? " " Could not notarize package: Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
311
+ $XCODE_STAPLER_PATH staple " $ESSENTIALS_PKG_PATH /build/Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
312
+ check_exit_code " $? " " Could not staple package: Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg"
313
+ # Move the Nudge Essentials signed/notarized pkg
314
+ /bin/mv " $ESSENTIALS_PKG_PATH /build/Nudge_Essentials-$AUTOMATED_NUDGE_BUILD .pkg" " $OUTPUTSDIR "
315
+
311
316
# Notarize Nudge Suite package
312
317
$XCODE_NOTARY_PATH submit " $SUITE_PKG_PATH /build/Nudge_Suite-$AUTOMATED_NUDGE_BUILD .pkg" --keychain-profile " nudge" --wait
313
318
check_exit_code " $? " " Could not notarize package: Nudge_Suite-$AUTOMATED_NUDGE_BUILD .pkg"
0 commit comments