Project

General

Profile

« Previous | Next » 

Revision f6c83d05

Added by Renato Botelho almost 8 years ago

Change default to never upload files and add a new option to do it

View differences:

build.sh
35 35
	echo "		--build-kernels - build all configured kernels"
36 36
	echo "		--build-kernel argument - build specified kernel. Example --build-kernel KERNEL_NAME"
37 37
	echo "		--install-extra-kernels argument - Put extra kernel(s) under /kernel image directory. Example --install-extra-kernels KERNEL_NAME_WRAP"
38
	echo "		--snapshots - Build snapshots and upload them to RSYNCIP"
38
	echo "		--snapshots - Build snapshots"
39 39
	echo "		--poudriere-snapshots - Update poudriere packages and send them to PKG_RSYNC_HOSTNAME"
40 40
	echo "		--setup-poudriere - Install poudriere and create necessary jails and ports tree"
41 41
	echo "		--create-unified-patch - Create a big patch with all changes done on FreeBSD"
42 42
	echo "		--update-poudriere-jails [-a ARCH_LIST] - Update poudriere jails using current patch versions"
43 43
	echo "		--update-poudriere-ports [-a ARCH_LIST]- Update poudriere ports tree"
44 44
	echo "		--update-pkg-repo [-a ARCH_LIST]- Rebuild necessary ports on poudriere and update pkg repo"
45
	echo "		--do-not-upload|-u - Do not upload pkgs or snapshots"
45
	echo "		--upload|-U - Upload pkgs and/or snapshots"
46 46
	echo "		-V VARNAME - print value of variable VARNAME"
47 47
	exit 1
48 48
}
......
54 54
unset _USE_OLD_DATESTRING
55 55
unset pfPORTTOBUILD
56 56
unset IMAGETYPE
57
unset DO_NOT_UPLOAD
57
unset UPLOAD
58 58
unset SNAPSHOTS
59 59
unset POUDRIERE_SNAPSHOTS
60 60
unset ARCH_LIST
......
147 147
		--update-pkg-repo)
148 148
			BUILDACTION="update_pkg_repo"
149 149
			;;
150
		--do-not-upload|-u)
151
			export DO_NOT_UPLOAD=1
150
		--upload|-U)
151
			export UPLOAD=1
152 152
			;;
153 153
		all|none|*iso*|*ova*|*memstick*|*memstickserial*|*memstickadi*)
154 154
			BUILDACTION="images"
......
243 243
		snapshots_scp_files
244 244
	;;
245 245
	update_pkg_repo)
246
		if [ -z "${DO_NOT_UPLOAD}" -a ! -f /usr/local/bin/rsync ]; then
246
		if [ -n "${UPLOAD}" -a ! -f /usr/local/bin/rsync ]; then
247 247
			echo "ERROR: rsync is not installed, aborting..."
248 248
			exit 1
249 249
		fi
......
259 259
	exit 0
260 260
fi
261 261

  
262
if [ -n "${SNAPSHOTS}" -a -z "${DO_NOT_UPLOAD}" ]; then
262
if [ -n "${SNAPSHOTS}" -a -n "${UPLOAD}" ]; then
263 263
	_required=" \
264 264
		RSYNCIP \
265 265
		RSYNCUSER \
......
436 436
fi
437 437

  
438 438
if [ -n "${SNAPSHOTS}" ]; then
439
	if [ "${IMAGETYPE}" = "none" -a -z "${DO_NOT_UPLOAD}" ]; then
439
	if [ "${IMAGETYPE}" = "none" -a -n "${UPLOAD}" ]; then
440 440
		pkg_repo_rsync "${CORE_PKG_PATH}"
441 441
	elif [ "${IMAGETYPE}" != "none" ]; then
442 442
		snapshots_create_sha256
443 443
		# SCP files to snapshot web hosting area
444
		if [ -z "${DO_NOT_UPLOAD}" ]; then
444
		if [ -n "${UPLOAD}" ]; then
445 445
			snapshots_scp_files
446 446
		fi
447 447
	fi
tools/build_snapshots.sh
24 24
	echo "	-n: Do not build images, only core pkg repo"
25 25
	echo "	-p: Update poudriere repo"
26 26
	echo "	-r: Do not reset local changes"
27
	echo "	-u: Do not upload snapshots"
27
	echo "	-U: Upload snapshots"
28 28
}
29 29

  
30 30
export BUILDER_TOOLS=$(realpath $(dirname ${0}))
......
32 32

  
33 33
IMAGES="all"
34 34
NO_RESET=""
35
NO_UPLOAD=""
35
UPLOAD=""
36 36
LOOPED_SNAPSHOTS=""
37 37
POUDRIERE_SNAPSHOTS=""
38 38

  
......
52 52
			NO_RESET=1
53 53
			;;
54 54
		u)
55
			NO_UPLOAD="-u"
55
			UPLOAD="-U"
56 56
			;;
57 57
		*)
58 58
			usage
......
76 76
export _sleeping=0
77 77

  
78 78
snapshot_update_status() {
79
	${BUILDER_ROOT}/build.sh ${NO_UPLOAD} ${POUDRIERE_SNAPSHOTS} \
79
	${BUILDER_ROOT}/build.sh ${UPLOAD} ${POUDRIERE_SNAPSHOTS} \
80 80
		--snapshot-update-status "$*"
81 81
}
82 82

  
......
189 189

  
190 190
		if [ $rc -eq 0 ]; then
191 191
			exec_and_update_status \
192
			    ${BUILDER_ROOT}/build.sh ${NO_UPLOAD} \
192
			    ${BUILDER_ROOT}/build.sh ${UPLOAD} \
193 193
			    --update-pkg-repo
194 194
			rc=$?
195 195
		fi
......
200 200

  
201 201
		if [ $rc -eq 0 ]; then
202 202
			exec_and_update_status \
203
			    ${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --snapshots \
203
			    ${BUILDER_ROOT}/build.sh ${UPLOAD} --snapshots \
204 204
			    ${IMAGES}
205 205
			rc=$?
206 206
		fi
tools/builder_common.sh
1309 1309
		fi
1310 1310
	fi
1311 1311

  
1312
	if [ -n "${DO_NOT_UPLOAD}" ]; then
1312
	if [ -z "${UPLOAD}" ]; then
1313 1313
		return
1314 1314
	fi
1315 1315

  
......
1688 1688

  
1689 1689
	LOGFILE=${BUILDER_LOGS}/poudriere.log
1690 1690

  
1691
	if [ -z "${DO_NOT_UPLOAD}" -a -z "${PKG_RSYNC_HOSTNAME}" ]; then
1691
	if [ -n "${UPLOAD}" -a -z "${PKG_RSYNC_HOSTNAME}" ]; then
1692 1692
		echo ">>> ERROR: PKG_RSYNC_HOSTNAME is not set"
1693 1693
		print_error_pfS
1694 1694
	fi

Also available in: Unified diff