Project

General

Profile

« Previous | Next » 

Revision 032171ee

Added by Renato Botelho almost 10 years ago

Create snapshot_update_status()

View differences:

tools/build_snapshots.sh
77 77
# Global variable used to control SIGINFO action
78 78
export _sleeping=0
79 79

  
80
snapshot_update_statu() {
81
	${BUILDER_ROOT}/build.sh --snapshot-update-status "${1}"
82
}
83

  
80 84
git_last_commit() {
81
	${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> Updating ${PRODUCT_NAME} repository."
85
	snapshot_update_status ">>> Updating ${PRODUCT_NAME} repository."
82 86
	[ -z "${NO_RESET}" ] \
83 87
		&& git -C "${BUILDER_ROOT}" reset --hard >/dev/null 2>&1
84 88
	git -C "${BUILDER_ROOT}" pull -q
......
88 92

  
89 93
restart_build() {
90 94
	if [ ${_sleeping} -ne 0 ]; then
91
		${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> SIGNINFO received, restarting build"
95
		snapshot_update_status ">>> SIGNINFO received, restarting build"
92 96
		COUNTER=$((maxsleepvalue + 60))
93 97
	fi
94 98
}
......
104 108
	[ -z "${LAST_COMMIT}" ] \
105 109
		&& export LAST_COMMIT=${CURRENT_COMMIT}
106 110

  
107
	${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> Sleeping for at least $minsleepvalue, at most $maxsleepvalue in between snapshot builder runs."
108
	${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> Last known commit: ${LAST_COMMIT}"
109
	${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> Freezing build process at $(date)"
111
	snapshot_update_status ">>> Sleeping for at least $minsleepvalue, at most $maxsleepvalue in between snapshot builder runs."
112
	snapshot_update_status ">>> Last known commit: ${LAST_COMMIT}"
113
	snapshot_update_status ">>> Freezing build process at $(date)"
110 114
	echo ">>> Press ctrl+T to start a new build"
111 115
	COUNTER=0
112 116
	_sleeping=1
......
116 120
	done
117 121

  
118 122
	if [ ${COUNTER} -lt ${maxsleepvalue} ]; then
119
		${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> Thawing build process and resuming checks for pending commits at $(date)."
123
		snapshot_update_status ">>> Thawing build process and resuming checks for pending commits at $(date)."
120 124
		echo ">>> Press ctrl+T to start a new build"
121 125
	fi
122 126

  
......
126 130
		if [ "$((${COUNTER} % 60))" = "0" ]; then
127 131
			git_last_commit
128 132
			if [ "${LAST_COMMIT}" != "${CURRENT_COMMIT}" ]; then
129
				${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> New commit: $CURRENT_AUTHOR - $CURRENT_COMMIT .. No longer sleepy."
133
				snapshot_update_status ">>> New commit: $CURRENT_AUTHOR - $CURRENT_COMMIT .. No longer sleepy."
130 134
				COUNTER=$(($maxsleepvalue + 60))
131 135
				export LAST_COMMIT="${CURRENT_COMMIT}"
132 136
			fi
......
136 140
	_sleeping=0
137 141

  
138 142
	if [ $COUNTER -ge $maxsleepvalue ]; then
139
		${BUILDER_ROOT}/build.sh --snapshot-update-status ">>> Sleep timer expired. Restarting build."
143
		snapshot_update_status ">>> Sleep timer expired. Restarting build."
140 144
		COUNTER=0
141 145
	fi
142 146

  
......
150 154
	git_last_commit
151 155

  
152 156
	(${BUILDER_ROOT}/build.sh --clean-builder 2>&1) | while read -r LINE; do
153
		${BUILDER_ROOT}/build.sh --snapshot-update-status "${LINE}"
157
		snapshot_update_status "${LINE}"
154 158
	done
155 159

  
156 160
	(${BUILDER_ROOT}/build.sh ${NO_UPLOAD} --flash-size '1g 2g 4g' --snapshots 2>&1) | while read -r LINE; do
157
		${BUILDER_ROOT}/build.sh --snapshot-update-status "${LINE}"
161
		snapshot_update_status "${LINE}"
158 162
	done
159 163

  
160 164
	if [ -z "${LOOPED_SNAPSHOTS}" ]; then

Also available in: Unified diff