Compare commits
8 Commits
9a9480035b
...
v1.4.0
Author | SHA1 | Date | |
---|---|---|---|
7578746d2f | |||
0b1ed62df1 | |||
76ec41c291 | |||
630cd36f13 | |||
cbe8bb7aeb | |||
e04636e3f7 | |||
728185ddb9 | |||
aaa485e2fc |
@@ -95,10 +95,14 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# 1.4.0 : Start with version at 1.4.0 (mainly to see a difference with Szeged)
|
||||
# Set hash-value in EVENT-objects. Set location (project), version
|
||||
# and info in send-last-version.
|
||||
# Check the ISMAS update-trigger as very first step.
|
||||
# If the customer repository does not exist, then do not check the
|
||||
# ISMAS trigger, but proceed with the update procedure. Otherwise,
|
||||
# check the ISMAS update-trigger as first step.
|
||||
# If the current time is between 0.00 - 4.00 o'clock, then a wrong
|
||||
# trigger-value wil result in an UPDATE_STEP_NOT_NECESSARY.
|
||||
# trigger-value will result in an UPDATE_STEP_NOT_NECESSARY.
|
||||
# Move final processing to subclass UpdateProcessRunning.
|
||||
# Disable EXIT-button for the whole update-process, except for the
|
||||
# checking of the ISMAS-trigger-button (aka WAIT-button).
|
||||
VERSION="1.4.0"
|
||||
|
||||
# PLANNED TODOS:
|
||||
|
20
update.cpp
20
update.cpp
@@ -605,19 +605,19 @@ bool Update::doUpdate(int &displayIndex, QStringList const &filesToWorkOn) {
|
||||
|
||||
// CONSOLE()
|
||||
|
||||
m_hw->dc_autoRequest(false);// default: turn auto-request setting off
|
||||
QThread::sleep(1); // wait to be sure that there are no more
|
||||
// commands sent to dc-hardware
|
||||
|
||||
if ((updateBinaryRes = updateBinary(fToWorkOn)) == true) {
|
||||
// m_hw->dc_autoRequest(false);// default: turn auto-request setting off
|
||||
// QThread::sleep(1); // wait to be sure that there are no more
|
||||
// // commands sent to dc-hardware
|
||||
|
||||
// if ((updateBinaryRes = updateBinary(fToWorkOn)) == true) {
|
||||
//
|
||||
// qCritical() << "downloaded binary" << fToWorkOn;
|
||||
|
||||
++displayIndex;
|
||||
emit m_worker->appendText(QString("\n(") + QString("%1").arg(displayIndex).rightJustified(2, ' ') + QString(")")
|
||||
+ QString(" Update ") + QFileInfo(fToWorkOn).fileName(),
|
||||
Worker::UPDATE_STEP_DONE);
|
||||
}
|
||||
// ++displayIndex;
|
||||
// emit m_worker->appendText(QString("\n(") + QString("%1").arg(displayIndex).rightJustified(2, ' ') + QString(")")
|
||||
// + QString(" Update ") + QFileInfo(fToWorkOn).fileName(),
|
||||
// Worker::UPDATE_STEP_DONE);
|
||||
//}
|
||||
|
||||
m_hw->dc_autoRequest(true); // turn auto-request setting on
|
||||
|
||||
|
32
worker.cpp
32
worker.cpp
@@ -272,22 +272,41 @@ void Worker::privateUpdate() {
|
||||
m_ismasTriggerActive = false;
|
||||
m_updateNotNecessary = false;
|
||||
|
||||
QDateTime const ¤t = QDateTime::currentDateTime();
|
||||
m_automaticUpdate = (current.time().hour() < 4);
|
||||
|
||||
m_ismasTriggerActive = updateTriggerSet();
|
||||
if (m_ismasTriggerActive == false) {
|
||||
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
|
||||
if (QDir(m_customerRepository).exists()) { // ignore a possibly corrupted repository
|
||||
m_ismasTriggerActive = updateTriggerSet();
|
||||
if (m_ismasTriggerActive == false) {
|
||||
QDateTime const ¤t = QDateTime::currentDateTime();
|
||||
m_automaticUpdate = (current.time().hour() < 4);
|
||||
m_versionInfo = m_gc.gitShowReason(m_branchName);
|
||||
|
||||
qCritical() << "***";
|
||||
qCritical() << "privateUpdate ............. m_versionInfo:" << m_versionInfo;
|
||||
qCritical() << "privateUpdate ......... m_automaticUpdate:" << m_automaticUpdate;
|
||||
|
||||
if (m_automaticUpdate) { // update has been triggered within [00:00:00, 00:03:59]
|
||||
m_updateNotNecessary = true;
|
||||
m_ismasTriggerStatusMessage = QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
|
||||
|
||||
qCritical() << "privateUpdate m_ismasTriggerStatusMessage:" << QStringList(QString("NO UPDATE NECESSARY (%1)").arg(current.toString(Qt::ISODate)));
|
||||
qCritical() << "***";
|
||||
|
||||
// the customer-repository does exist, but the ISMAS-trigger is
|
||||
// *NOT* "WAIT", but from 00:00:00 - 00:03:59 this counts as an
|
||||
// automatic update
|
||||
|
||||
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
|
||||
return;
|
||||
}
|
||||
|
||||
qCritical() << "***";
|
||||
|
||||
// the customer-repository does exist, but the ISMAS-trigger is
|
||||
// *NOT* "WAIT", so STOP the update procedure
|
||||
return;
|
||||
}
|
||||
// the customer-repository does exist, and the ISMAS-trigger is "WAIT",
|
||||
// so continue the update procedure
|
||||
} else {
|
||||
// the customer-repository does not exist, so PROCEED with the
|
||||
// update procedure, even if ISMAS-trigger is not correctly set ("WAIT")
|
||||
}
|
||||
@@ -481,6 +500,7 @@ void Worker::privateUpdate() {
|
||||
setProgress(_SAVE_LOGS_SUCCESS);
|
||||
|
||||
// final messages: see destructor of UpdateProcessRunning subclass
|
||||
m_lastFailedUpdateStep = UPDATE_STEP::NONE;
|
||||
}
|
||||
|
||||
bool Worker::updateTriggerSet() {
|
||||
|
72
worker.h
72
worker.h
@@ -714,21 +714,73 @@ private:
|
||||
case UPDATE_STEP::CHECK_REPOSITORY:
|
||||
ismasClient.setProgressInPercent(_CHECK_REPOSITORY);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS:
|
||||
case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS: {
|
||||
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_SUCCESS);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE:
|
||||
QString const &ismasUpdateNews =
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
ismasClient.updateNewsToIsmas(
|
||||
"U0010",
|
||||
_CHECKOUT_REPOSITORY_SUCCESS,
|
||||
IsmasClient::RESULT_CODE::SUCCESS,
|
||||
smap[UPDATE_STEP::CHECK_REPOSITORY],
|
||||
QString("REPOSITORY %1 AND BRANCH %2 OK")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()).toStdString().c_str(),
|
||||
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
|
||||
ismasClient.sendRequestReceiveResponse(
|
||||
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
|
||||
} break;
|
||||
case UPDATE_STEP::CHECK_REPOSITORY_FAILURE: {
|
||||
ismasClient.setProgressInPercent(_CHECK_REPOSITORY_FAILURE);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_SANITY:
|
||||
QString const &ismasUpdateNews =
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
ismasClient.updateNewsToIsmas(
|
||||
"U0010",
|
||||
_CHECKOUT_REPOSITORY_FAILURE,
|
||||
IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
smap[UPDATE_STEP::CHECKOUT_REPOSITORY],
|
||||
QString("REPOSITORY %1 and BRANCH %2 ***NOT OK***")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()).toStdString().c_str(),
|
||||
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
|
||||
ismasClient.sendRequestReceiveResponse(
|
||||
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
|
||||
} break;
|
||||
case UPDATE_STEP::CHECK_SANITY: {
|
||||
ismasClient.setProgressInPercent(_CHECK_SANITY);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_SANITY_SUCCESS:
|
||||
} break;
|
||||
case UPDATE_STEP::CHECK_SANITY_SUCCESS: {
|
||||
ismasClient.setProgressInPercent(_CHECK_SANITY_SUCCESS);
|
||||
break;
|
||||
case UPDATE_STEP::CHECK_SANITY_FAILURE:
|
||||
QString const &ismasUpdateNews =
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
ismasClient.updateNewsToIsmas(
|
||||
"U0010",
|
||||
_CHECK_SANITY_SUCCESS,
|
||||
IsmasClient::RESULT_CODE::SUCCESS,
|
||||
smap[UPDATE_STEP::CHECK_SANITY],
|
||||
QString("SANITY OF %1 (BRANCH %2) OK")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()).toStdString().c_str(),
|
||||
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
|
||||
ismasClient.sendRequestReceiveResponse(
|
||||
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
|
||||
} break;
|
||||
case UPDATE_STEP::CHECK_SANITY_FAILURE: {
|
||||
ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE);
|
||||
break;
|
||||
QString const &ismasUpdateNews =
|
||||
QString("#M=APISM#C=CMD_EVENT#J=") +
|
||||
ismasClient.updateNewsToIsmas(
|
||||
"U0010",
|
||||
_CHECK_SANITY_FAILURE,
|
||||
IsmasClient::RESULT_CODE::INSTALL_ERROR,
|
||||
smap[UPDATE_STEP::CHECK_SANITY],
|
||||
QString("SANITY OF %1 and BRANCH %2 ***NOT*** OK")
|
||||
.arg(instance->m_customerRepository)
|
||||
.arg(instance->m_gc.branchName()).toStdString().c_str(),
|
||||
instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A");
|
||||
ismasClient.sendRequestReceiveResponse(
|
||||
IsmasClient::APISM::DB_PORT, ismasUpdateNews);
|
||||
} break;
|
||||
case UPDATE_STEP::REPOSITORY_RECOVERED_SUCCESS:
|
||||
ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_SUCCESS);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user