diff --git a/engine/schema/pom.xml b/engine/schema/pom.xml index 6ccb8d5a906..7dabcc2c033 100644 --- a/engine/schema/pom.xml +++ b/engine/schema/pom.xml @@ -156,10 +156,10 @@ - template-create + download-kvm-systemvm-template - noredist + systemvm-kvm @@ -186,6 +186,30 @@ ${kvm.checksum} + + + + + + + download-vmware-systemvm-template + + + systemvm-vmware + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${cs.resources-plugin.version} + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.3 + download-vmware-template @@ -198,6 +222,30 @@ ${vmware.checksum} + + + + + + + download-xenserver-systemvm-template + + + systemvm-xen + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${cs.resources-plugin.version} + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.3 + download-xenserver-template @@ -215,5 +263,77 @@ + + download-ovm-systemvm-template + + + systemvm-ovm + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${cs.resources-plugin.version} + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.3 + + + download-ovm-template + + wget + + + true + https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-ovm.raw.bz2 + ${basedir}/dist/systemvm-templates/ + ${ovm.checksum} + + + + + + + + + download-hyperv-systemvm-template + + + systemvm-hyperv + + + + + + org.apache.maven.plugins + maven-resources-plugin + ${cs.resources-plugin.version} + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.3 + + + download-hyperv-template + + wget + + + true + https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-hyperv.vhd.zip + ${basedir}/dist/systemvm-templates/ + ${hyperv.checksum} + + + + + + + diff --git a/packaging/centos7/cloud.spec b/packaging/centos7/cloud.spec index 604e853e12a..d8ecf662c63 100644 --- a/packaging/centos7/cloud.spec +++ b/packaging/centos7/cloud.spec @@ -207,6 +207,11 @@ if [ "%{_sim}" == "SIMULATOR" -o "%{_sim}" == "simulator" ] ; then FLAGS="$FLAGS -Dsimulator" fi +if [ \"%{_temp}\" != "" ]; then + echo "Adding flags to package requested templates" + FLAGS="$FLAGS `rpm --eval %{?_temp}`" +fi + mvn -Psystemvm,developer $FLAGS clean package cd ui && npm install && npm run build && cd .. diff --git a/packaging/centos8/cloud.spec b/packaging/centos8/cloud.spec index cec88a20a72..e86a98781bf 100644 --- a/packaging/centos8/cloud.spec +++ b/packaging/centos8/cloud.spec @@ -200,6 +200,11 @@ if [ "%{_sim}" == "SIMULATOR" -o "%{_sim}" == "simulator" ] ; then FLAGS="$FLAGS -Dsimulator" fi +if [ \"%{_temp}\" != "" ]; then + echo "Adding flags to package requested templates" + FLAGS="$FLAGS `rpm --eval %{?_temp}`" +fi + mvn -Psystemvm,developer $FLAGS clean package cd ui && npm install && npm run build && cd .. diff --git a/packaging/package.sh b/packaging/package.sh index 380908be7ba..bf95f84a11a 100755 --- a/packaging/package.sh +++ b/packaging/package.sh @@ -36,6 +36,7 @@ Optional arguments: -s, --simulator string Build package for Simulator ("default"|"DEFAULT"|"simulator"|"SIMULATOR") (default "default") -b, --brand string Set branding to be used in package name (it will override any branding string in POM version) -T, --use-timestamp Use epoch timestamp instead of SNAPSHOT in the package name (if not provided, use "SNAPSHOT") + -t --templates Passes necessary flag to package the required templates. Comma separated string - kvm,xen,vmware,ovm,hyperv Other arguments: -h, --help Display this help message and exit @@ -44,6 +45,7 @@ Examples: package.sh --distribution centos7 package.sh --distribution centos7 --pack oss package.sh --distribution centos7 --pack noredist + package.sh --distribution centos7 --pack noredist -t "kvm,xen" package.sh --distribution centos7 --release 42 package.sh --distribution centos7 --pack noredist --release 42 @@ -143,6 +145,16 @@ function packaging() { fi fi + DEFTEMP="-D_temp ''" + if [ "$TEMPLATES" != "" ]; then + if [[ ",$TEMPLATES," = *",all,"* ]]; then + DEFTEMP="-D_temp '-Dsystemvm-kvm -Dsystemvm-xen -Dsystemvm-vmware'" + else + TEMP=-Dsystemvm-"${TEMPLATES//,/" -Dsystemvm-"}" + DEFTEMP="-D_temp ${TEMP}" + fi + fi + DEFFULLVER="-D_fullver $VERSION" DEFVER="-D_ver $REALVER" @@ -161,7 +173,7 @@ function packaging() { echo ". executing rpmbuild" cp "$PWD/$DISTRO/cloud.spec" "$RPMDIR/SPECS" - (cd "$RPMDIR"; rpmbuild --define "_topdir ${RPMDIR}" "${DEFVER}" "${DEFFULLVER}" "${DEFREL}" ${DEFPRE+"$DEFPRE"} ${DEFOSSNOSS+"$DEFOSSNOSS"} ${DEFSIM+"$DEFSIM"} -bb SPECS/cloud.spec) + (cd "$RPMDIR"; rpmbuild --define "_topdir ${RPMDIR}" "${DEFVER}" "${DEFFULLVER}" "${DEFREL}" ${DEFPRE+"$DEFPRE"} ${DEFOSSNOSS+"$DEFOSSNOSS"} ${DEFSIM+"$DEFSIM"} ${DEFTEMP+"$DEFTEMP"} -bb SPECS/cloud.spec) if [ $? -ne 0 ]; then if [ "$USE_TIMESTAMP" == "true" ]; then (cd $PWD/../; git reset --hard) @@ -246,6 +258,11 @@ while [ -n "$1" ]; do shift 1 ;; + -t | --templates) + TEMPLATES=$2 + shift 1 + ;; + -*) unrecognized_flags="${unrecognized_flags}$1 " shift 1 diff --git a/packaging/suse15/cloud.spec b/packaging/suse15/cloud.spec index 66010c50edf..d6be798e095 100644 --- a/packaging/suse15/cloud.spec +++ b/packaging/suse15/cloud.spec @@ -202,6 +202,11 @@ if [ "%{_sim}" == "SIMULATOR" -o "%{_sim}" == "simulator" ] ; then FLAGS="$FLAGS -Dsimulator" fi +if [ \"%{_temp}\" != "" ]; then + echo "Adding flags to package requested templates" + FLAGS="$FLAGS `rpm --eval %{?_temp}`" +fi + mvn -Psystemvm,developer $FLAGS clean package cd ui && npm install && npm run build && cd ..