start to refactor update-procedure
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#include <QRegularExpression>
|
||||
#include <QJsonArray>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "message_handler.h"
|
||||
#include <DeviceController/interfaces.h>
|
||||
#include "ismas/ismas_client.h"
|
||||
@@ -27,6 +29,15 @@
|
||||
#include "mainwindow.h"
|
||||
#include "utils.h"
|
||||
#include "process/command.h"
|
||||
#include "process/update_command.h"
|
||||
#include "process/check_ismas_connectivity_command.h"
|
||||
#include "process/check_update_activation_command.h"
|
||||
#include "process/check_and_fetch_customer_repository_command.h"
|
||||
#include "process/update_json_command.h"
|
||||
#include "process/update_filesystem_command.h"
|
||||
#include "process/exec_opkg_command.h"
|
||||
#include "process/update_dc_command.h"
|
||||
#include "process/show_software_status_command.h"
|
||||
|
||||
QString const Worker::UPDATE_STEP_OK ( " [ ok]");
|
||||
QString const Worker::UPDATE_STEP_DONE ( " [done]");
|
||||
@@ -181,8 +192,65 @@ Worker::Worker(int customerNr,
|
||||
, m_dcDownloadJsonFiles(new Command(
|
||||
QString("/opt/app/tools/atbupdate/ATBDownloadDCJsonFiles --set-ppid %1").arg(QCoreApplication::applicationPid())))
|
||||
//, m_withoutIsmasDirectPort(true) /* useful for testing */ {
|
||||
, m_withoutIsmasDirectPort(false) /* useful for testing */ {
|
||||
, m_withoutIsmasDirectPort(false) /* useful for testing */ {
|
||||
|
||||
// check ISMAS connectivity
|
||||
m_workList.push_back(
|
||||
std::make_unique<CheckIsmasConnectivityCommand>(
|
||||
QString("echo CheckIsmasConnectivityCommand")
|
||||
, this));
|
||||
|
||||
// check if update activated in ISMAS
|
||||
m_workList.push_back(
|
||||
std::make_unique<CheckUpdateActivationCommand>(
|
||||
QString("echo CheckUpdateActivationCommand")
|
||||
, this));
|
||||
|
||||
// check and fetch git-customer repository
|
||||
m_workList.push_back(
|
||||
std::make_unique<CheckAndFetchCustomerRepositoryCommand>(
|
||||
QString("echo CheckAndFetchCustomerRepositoryCommand")
|
||||
, this));
|
||||
|
||||
// exec opkg-commands
|
||||
// first with no action -> dry-run
|
||||
m_workList.push_back(
|
||||
std::make_unique<ExecOpkgCommand>(
|
||||
QString("echo ExecOpkgCommand")
|
||||
, this, true));
|
||||
|
||||
// exec opkg-commands
|
||||
// now with action -> no dry-run
|
||||
|
||||
// send json files down to device controller
|
||||
m_workList.push_back(
|
||||
std::make_unique<UpdateJsonCommand>(
|
||||
QString("echo UpdateJsonCommand")
|
||||
//QString("/opt/app/tools/atbupdate/ATBDownloadDCJsonFiles --set-ppid %1").arg(QCoreApplication::applicationPid())
|
||||
, this, false));
|
||||
|
||||
// sync json files in repo etc-directory with /etc fs-directory
|
||||
m_workList.push_back(
|
||||
std::make_unique<UpdateFileSystemCommand>(
|
||||
QString("echo UpdateFileSystemCommand")
|
||||
, this));
|
||||
|
||||
|
||||
// send device-controller firmware down to device-controller-hardware
|
||||
m_workList.push_back(
|
||||
std::make_unique<UpdateDCCommand>(
|
||||
QString("echo UpdateDCCommand")
|
||||
// QString("/opt/app/tools/atbupdate/ATBDownloadDCFirmware --read-dc-version true")
|
||||
, this));
|
||||
|
||||
// show/send software-status
|
||||
m_workList.push_back(
|
||||
std::make_unique<ShowSoftwareStatusCommand>(
|
||||
QString("echo ShowSoftwareStatusCommand")
|
||||
, this));
|
||||
|
||||
// reboot machine
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
m_start = QDateTime::currentDateTime();
|
||||
m_dcDownloadFirmware->setWorker(this);
|
||||
|
Reference in New Issue
Block a user