This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 1d2e3fe24d3e486387cab7246dad3ab86945b003
Merge: fb4f6a334d7 74a414e76fe
Author: Rohit Yadav <[email protected]>
AuthorDate: Thu Mar 16 13:19:20 2023 +0530

    Merge remote-tracking branch 'origin/4.18'
    
    Fix 4.19/main build and add upgrade path from 4.18.1.0->4.19.0.0
    
    Signed-off-by: Rohit Yadav <[email protected]>

 .../com/cloud/upgrade/DatabaseUpgradeChecker.java  |  4 +
 .../com/cloud/upgrade/dao/Upgrade41800to41810.java | 85 ++++++++++++++++++++++
 .../com/cloud/upgrade/dao/Upgrade41810to41900.java | 85 ++++++++++++++++++++++
 .../META-INF/db/schema-41800to41810-cleanup.sql    | 20 +++++
 .../resources/META-INF/db/schema-41800to41810.sql  | 21 ++++++
 .../META-INF/db/schema-41810to41900-cleanup.sql    | 20 +++++
 .../resources/META-INF/db/schema-41810to41900.sql  | 21 ++++++
 tools/checkstyle/pom.xml                           |  2 +-
 tools/docker/Dockerfile                            |  2 +-
 tools/docker/Dockerfile.marvin                     |  2 +-
 tools/marvin/setup.py                              |  2 +-
 11 files changed, 260 insertions(+), 4 deletions(-)

diff --cc 
engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
index 2d3665b149e,932dc71f4b0..17cdee90d04
--- a/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@@ -80,6 -80,7 +80,8 @@@ import com.cloud.upgrade.dao.Upgrade416
  import com.cloud.upgrade.dao.Upgrade41700to41710;
  import com.cloud.upgrade.dao.Upgrade41710to41720;
  import com.cloud.upgrade.dao.Upgrade41720to41800;
+ import com.cloud.upgrade.dao.Upgrade41800to41810;
++import com.cloud.upgrade.dao.Upgrade41810to41900;
  import com.cloud.upgrade.dao.Upgrade420to421;
  import com.cloud.upgrade.dao.Upgrade421to430;
  import com.cloud.upgrade.dao.Upgrade430to440;
@@@ -216,6 -217,7 +218,8 @@@ public class DatabaseUpgradeChecker imp
                  .next("4.17.0.1", new Upgrade41700to41710())
                  .next("4.17.1.0", new Upgrade41710to41720())
                  .next("4.17.2.0", new Upgrade41720to41800())
+                 .next("4.18.0.0", new Upgrade41800to41810())
++                .next("4.18.1.0", new Upgrade41810to41900())
                  .build();
      }
  
diff --cc 
engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41810to41900.java
index 00000000000,00000000000..b7c4d6fb9f3
new file mode 100644
--- /dev/null
+++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41810to41900.java
@@@ -1,0 -1,0 +1,85 @@@
++// Licensed to the Apache Software Foundation (ASF) under one
++// or more contributor license agreements.  See the NOTICE file
++// distributed with this work for additional information
++// regarding copyright ownership.  The ASF licenses this file
++// to you under the Apache License, Version 2.0 (the
++// "License"); you may not use this file except in compliance
++// with the License.  You may obtain a copy of the License at
++//
++//   http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing,
++// software distributed under the License is distributed on an
++// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++// KIND, either express or implied.  See the License for the
++// specific language governing permissions and limitations
++// under the License.
++package com.cloud.upgrade.dao;
++
++import com.cloud.upgrade.SystemVmTemplateRegistration;
++import com.cloud.utils.exception.CloudRuntimeException;
++import org.apache.log4j.Logger;
++
++import java.io.InputStream;
++import java.sql.Connection;
++
++public class Upgrade41810to41900 implements DbUpgrade, 
DbUpgradeSystemVmTemplate {
++    final static Logger LOG = Logger.getLogger(Upgrade41810to41900.class);
++    private SystemVmTemplateRegistration systemVmTemplateRegistration;
++
++    @Override
++    public String[] getUpgradableVersionRange() {
++        return new String[] {"4.18.1.0", "4.19.0.0"};
++    }
++
++    @Override
++    public String getUpgradedVersion() {
++        return "4.19.0.0";
++    }
++
++    @Override
++    public boolean supportsRollingUpgrade() {
++        return false;
++    }
++
++    @Override
++    public InputStream[] getPrepareScripts() {
++        final String scriptFile = "META-INF/db/schema-41800to41810.sql";
++        final InputStream script = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
++        if (script == null) {
++            throw new CloudRuntimeException("Unable to find " + scriptFile);
++        }
++
++        return new InputStream[] {script};
++    }
++
++    @Override
++    public void performDataMigration(Connection conn) {
++    }
++
++    @Override
++    public InputStream[] getCleanupScripts() {
++        final String scriptFile = 
"META-INF/db/schema-41800to41810-cleanup.sql";
++        final InputStream script = 
Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
++        if (script == null) {
++            throw new CloudRuntimeException("Unable to find " + scriptFile);
++        }
++
++        return new InputStream[] {script};
++    }
++
++    private void initSystemVmTemplateRegistration() {
++        systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
++    }
++
++    @Override
++    public void updateSystemVmTemplates(Connection conn) {
++        LOG.debug("Updating System Vm template IDs");
++        initSystemVmTemplateRegistration();
++        try {
++            systemVmTemplateRegistration.updateSystemVmTemplates(conn);
++        } catch (Exception e) {
++            throw new CloudRuntimeException("Failed to find / register 
SystemVM template(s)");
++        }
++    }
++}
diff --cc 
engine/schema/src/main/resources/META-INF/db/schema-41810to41900-cleanup.sql
index 00000000000,00000000000..ff0e78095ec
new file mode 100644
--- /dev/null
+++ 
b/engine/schema/src/main/resources/META-INF/db/schema-41810to41900-cleanup.sql
@@@ -1,0 -1,0 +1,20 @@@
++-- Licensed to the Apache Software Foundation (ASF) under one
++-- or more contributor license agreements.  See the NOTICE file
++-- distributed with this work for additional information
++-- regarding copyright ownership.  The ASF licenses this file
++-- to you under the Apache License, Version 2.0 (the
++-- "License"); you may not use this file except in compliance
++-- with the License.  You may obtain a copy of the License at
++--
++--   http://www.apache.org/licenses/LICENSE-2.0
++--
++-- Unless required by applicable law or agreed to in writing,
++-- software distributed under the License is distributed on an
++-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++-- KIND, either express or implied.  See the License for the
++-- specific language governing permissions and limitations
++-- under the License.
++
++--;
++-- Schema upgrade cleanup from 4.18.1.0 to 4.19.0.0
++--;
diff --cc engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
index 00000000000,00000000000..5e13b1c0157
new file mode 100644
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41810to41900.sql
@@@ -1,0 -1,0 +1,21 @@@
++-- Licensed to the Apache Software Foundation (ASF) under one
++-- or more contributor license agreements.  See the NOTICE file
++-- distributed with this work for additional information
++-- regarding copyright ownership.  The ASF licenses this file
++-- to you under the Apache License, Version 2.0 (the
++-- "License"); you may not use this file except in compliance
++-- with the License.  You may obtain a copy of the License at
++--
++--   http://www.apache.org/licenses/LICENSE-2.0
++--
++-- Unless required by applicable law or agreed to in writing,
++-- software distributed under the License is distributed on an
++-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++-- KIND, either express or implied.  See the License for the
++-- specific language governing permissions and limitations
++-- under the License.
++
++--;
++-- Schema upgrade from 4.18.1.0 to 4.19.0.0
++--;
++
diff --cc tools/checkstyle/pom.xml
index 065962dc044,d5ea235b3b2..bef394c72ae
--- a/tools/checkstyle/pom.xml
+++ b/tools/checkstyle/pom.xml
@@@ -22,7 -22,7 +22,7 @@@
      <name>Apache CloudStack Developer Tools - Checkstyle Configuration</name>
      <groupId>org.apache.cloudstack</groupId>
      <artifactId>checkstyle</artifactId>
-     <version>4.18.0.0</version>
 -    <version>4.18.1.0-SNAPSHOT</version>
++    <version>4.19.0.0-SNAPSHOT</version>
  
      <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
diff --cc tools/docker/Dockerfile
index 79b35af678f,5b132f2a0ab..9c135b0e1ad
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@@ -20,7 -20,7 +20,7 @@@
  FROM ubuntu:22.04
  
  MAINTAINER "Apache CloudStack" <[email protected]>
- LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.0.0"
 -LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.1.0"
++LABEL Vendor="Apache.org" License="ApacheV2" Version="4.19.0.0"
  
  ARG DEBIAN_FRONTEND=noninteractive
  
diff --cc tools/docker/Dockerfile.marvin
index 4c64e7e1772,f0329facc79..3faf7218e43
--- a/tools/docker/Dockerfile.marvin
+++ b/tools/docker/Dockerfile.marvin
@@@ -20,7 -20,7 +20,7 @@@
  FROM python:2
  
  MAINTAINER "Apache CloudStack" <[email protected]>
- LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.0.0"
 -LABEL Vendor="Apache.org" License="ApacheV2" Version="4.18.1.0"
++LABEL Vendor="Apache.org" License="ApacheV2" Version="4.19.0.0"
  
  ENV WORK_DIR=/marvin
  
diff --cc tools/marvin/setup.py
index 33f22ebea6b,3ceb2754cc0..e96065f96d0
--- a/tools/marvin/setup.py
+++ b/tools/marvin/setup.py
@@@ -27,7 -27,7 +27,7 @@@ except ImportError
          raise RuntimeError("python setuptools is required to build Marvin")
  
  
- VERSION = "4.18.0.0"
 -VERSION = "4.18.1.0"
++VERSION = "4.19.0.0"
  
  setup(name="Marvin",
        version=VERSION,

Reply via email to