diff --git a/pom.xml b/pom.xml index bfdd152a2a0..fbd3b25dc38 100644 --- a/pom.xml +++ b/pom.xml @@ -1005,33 +1005,7 @@ tools/ngui/static/bootstrap/* tools/ngui/static/js/lib/* tools/transifex/.tx/config - ui/legacy/css/src/scss/components/token-input-facebook.scss - ui/l10n/* - ui/legacy/lib/flot/jquery.colorhelpers.js - ui/legacy/lib/flot/jquery.flot.crosshair.js - ui/legacy/lib/flot/jquery.flot.fillbetween.js - ui/legacy/lib/flot/jquery.flot.image.js - ui/legacy/lib/flot/jquery.flot.js - ui/legacy/lib/flot/jquery.flot.navigate.js - ui/legacy/lib/flot/jquery.flot.pie.js - ui/legacy/lib/flot/jquery.flot.resize.js - ui/legacy/lib/flot/jquery.flot.selection.js - ui/legacy/lib/flot/jquery.flot.stack.js - ui/legacy/lib/flot/jquery.flot.symbol.js - ui/legacy/lib/flot/jquery.flot.threshold.js - ui/legacy/lib/jquery-ui/css/jquery-ui.css - ui/legacy/lib/jquery-ui/index.html - ui/legacy/lib/jquery-ui/js/jquery-ui.js - ui/legacy/lib/jquery.cookies.js - ui/legacy/lib/jquery.easing.js - ui/legacy/lib/jquery.js - ui/legacy/lib/jquery.md5.js - ui/legacy/lib/jquery.validate.js - ui/legacy/lib/jquery.tokeninput.js - ui/legacy/lib/qunit/qunit.css - ui/legacy/lib/qunit/qunit.js - ui/legacy/lib/reset.css - ui/legacy/lib/require.js + ui/* utils/testsmallfileinactive diff --git a/ui/.gitignore b/ui/.gitignore index 185e6631928..ec269fc3077 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -1,5 +1,23 @@ +# 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. + .DS_Store node_modules +coverage /dist # local env files diff --git a/ui/CONTRIBUTING.md b/ui/CONTRIBUTING.md index ba5a7fff85e..1eee366fa8f 100644 --- a/ui/CONTRIBUTING.md +++ b/ui/CONTRIBUTING.md @@ -1,10 +1,10 @@ -# Contributing to Primate +# Contributing to CloudStack UI ## Summary -This document covers how to contribute to the Primate project. Primate uses Github PRs to manage code contributions. +This document covers how to contribute to the UI project. It uses Github PRs to manage code contributions. These instructions assume you have a GitHub.com account, so if you don't have one you will have to create one. -Your proposed code changes will be published to your own fork of the Primate project and you will submit a Pull Request for your changes to be added. +Your proposed code changes will be published to your own fork of the project and you will submit a Pull Request for your changes to be added. Please refer to project [docs](docs) for reference on standard way of component configuration, development, usage, extension and testing. @@ -27,18 +27,18 @@ No back porting / cherry-picking features to existing branches! ## Forking -In your browser, navigate to: [https://github.com/apache/cloudstack-primate](https://github.com/apache/cloudstack-primate) +In your browser, navigate to: [https://github.com/apache/cloudstack](https://github.com/apache/cloudstack) Fork the repository by clicking on the 'Fork' button on the top right hand side. The fork will happen and you will be taken to your own fork of the repository. Copy the Git repository URL by clicking on the clipboard next to the URL on the right hand side of the page under '**HTTPS** clone URL'. You will paste this URL when doing the following `git clone` command. -On your workstation, follow these steps to setup a local repository for working on Primate: +On your workstation, follow these steps to setup a local repository for working on UI: ``` bash -$ git clone https://github.com/YOUR_ACCOUNT/primate.git -$ cd primate -$ git remote add upstream https://github.com/apache/cloudstack-primate.git +$ git clone https://github.com/YOUR_ACCOUNT/cloudstack.git +$ cd cloudstack/ui +$ git remote add upstream https://github.com/apache/cloudstack.git $ git checkout master $ git fetch upstream $ git rebase upstream/master @@ -48,7 +48,7 @@ $ git rebase upstream/master It is important that you create a new branch to make changes on and that you do not change the `master` branch (other than to rebase in changes from `upstream/master`). In this example I will assume you will be making your changes to a branch called `feature_x`. -This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the Primate project. +This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the UI project. It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch. @@ -101,7 +101,7 @@ Now that the `feature_x` branch has been pushed to your GitHub repository, you c To initiate the pull request, do the following: -1. In your browser, navigate to your forked repository: [https://github.com/YOUR_ACCOUNT/primate](https://github.com/YOUR_ACCOUNT/primate) +1. In your browser, navigate to your forked repository: [https://github.com/YOUR_ACCOUNT/cloudstack](https://github.com/YOUR_ACCOUNT/cloudstack) 2. Click the new button called '**Compare & pull request**' that showed up just above the main area in your forked repository 3. Validate the pull request will be into the upstream `master` and will be from your `feature_x` branch 4. Enter a detailed description of the work you have done and then click '**Send pull request**' diff --git a/ui/Dockerfile b/ui/Dockerfile index e98032f3b43..ac91fdbf698 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -15,12 +15,12 @@ # specific language governing permissions and limitations # under the License. -# Build example: docker build -t apache/cloudstack-primate:latest . +# Build example: docker build -t . FROM node:lts-stretch AS build MAINTAINER "Apache CloudStack" -LABEL Description="Apache CloudStack Primate; Modern role-base progressive UI for Apache CloudStack" +LABEL Description="Apache CloudStack UI; Modern role-base progressive UI for Apache CloudStack" LABEL Vendor="Apache.org" LABEL License=ApacheV2 LABEL Version=0.5.0 @@ -35,12 +35,12 @@ RUN npm run build FROM nginx:alpine AS runtime -LABEL org.opencontainers.image.title="Apache CloudStack Primate" \ +LABEL org.opencontainers.image.title="Apache CloudStack UI" \ org.opencontainers.image.description="A modern role-based progressive CloudStack UI" \ org.opencontainers.image.authors="Apache CloudStack Contributors" \ - org.opencontainers.image.url="https://github.com/apache/cloudstack-primate" \ - org.opencontainers.image.documentation="https://github.com/apache/cloudstack-primate/README.md" \ - org.opencontainers.image.source="https://github.com/apache/cloudstack-primate" \ + org.opencontainers.image.url="https://github.com/apache/cloudstack" \ + org.opencontainers.image.documentation="https://github.com/apache/cloudstack/blob/master/ui/README.md" \ + org.opencontainers.image.source="https://github.com/apache/cloudstack" \ org.opencontainers.image.vendor="The Apache Software Foundation" \ org.opencontainers.image.licenses="Apache-2.0" \ org.opencontainers.image.ref.name="latest" diff --git a/ui/README.md b/ui/README.md index a404d0635d3..6e02264402c 100644 --- a/ui/README.md +++ b/ui/README.md @@ -1,8 +1,8 @@ -# CloudStack Primate [![Build Status](https://travis-ci.org/apache/cloudstack-primate.svg?branch=master)](https://travis-ci.org/apache/cloudstack-primate) +# CloudStack UI A modern role-based progressive CloudStack UI based on VueJS and Ant Design. -![Primate Screenshot](docs/screenshot-dashboard.png) +![Screenshot](ui/docs/screenshot-dashboard.png) ## Getting Started @@ -25,8 +25,8 @@ Optionally, you may also install system-wide dev tools: Clone the repository: - git clone https://github.com/apache/cloudstack-primate.git - cd cloudstack-primate + git clone https://github.com/apache/cloudstack.git + cd cloudstack/ui npm install Override the default `CS_URL` to a running CloudStack management server: @@ -68,15 +68,15 @@ Fetch dependencies and build: This creates a static webpack application in `dist/`, which can then be served from any web server or CloudStack management server (jetty). -To use CloudStack management server (jetty), you may copy the built Primate build -to a new/existing webapp directory on the management server host. For example: +To use CloudStack management server (jetty), you may copy the built UI to the +webapp directory on the management server host. For example: npm install npm run build cd dist - mkdir -p /usr/share/cloudstack-management/webapp/primate - cp -vr . /usr/share/cloudstack-management/webapp/primate/ - # Use Primate at {management-server}:8080/client/primate in browser + mkdir -p /usr/share/cloudstack-management/webapp/ + cp -vr . /usr/share/cloudstack-management/webapp/ + # Access UI at {management-server}:8080/client in browser If the webapp directory is changed, please change the `webapp.dir` in the `/etc/cloudstack/management/server.properties` and restart the management server host. @@ -84,7 +84,7 @@ If the webapp directory is changed, please change the `webapp.dir` in the To use a separate webserver, note that the API server is accessed through the path `/client`, which needs be forwarded to an actual CloudStack instance. -For example, a simple way to serve Primate with nginx can be implemented with the +For example, a simple way to serve UI with nginx can be implemented with the following nginx configuration (to be put into /etc/nginx/conf.d/default.conf or similar): ```nginx @@ -92,8 +92,8 @@ server { listen 80; server_name localhost; location / { - # /src/primate/dist contains the built Primate webpack - root /src/primate/dist; + # /src/ui/dist contains the built UI webpack + root /src/ui/dist; index index.html; } location /client/ { @@ -107,18 +107,17 @@ server { ### Docker A production-ready Docker container can also be built with the provided -Dockerfile and build script. Official builds are available here: -https://hub.docker.com/r/apache/cloudstack-primate +Dockerfile and build script. Make sure Docker is installed, then run: - bash tools/docker.sh + bash docker.sh Change the example configuration in `nginx/default.conf` according to your needs. -Run Primate: +Run UI: - docker run -ti --rm -p 8080:80 -v $(pwd)/nginx:/etc/nginx/conf.d:ro cloudstack-primate:latest + docker run -ti --rm -p 8080:80 -v $(pwd)/nginx:/etc/nginx/conf.d:ro cloudstack-ui:latest ### Packaging @@ -138,13 +137,13 @@ docker container: - VueJS Guide: https://vuejs.org/v2/guide/ - Vue Ant Design: https://www.antdv.com/docs/vue/introduce/ -- Primate Developer [Docs](docs) +- UI Developer [Docs](docs) - JavaScript ES6 Reference: https://www.tutorialspoint.com/es6/ - Introduction to ES6: https://scrimba.com/g/gintrotoes6 ## Attributions -Primate uses the following: +The UI uses the following: - [VueJS](https://vuejs.org/) - [Ant Design Spec](https://ant.design/docs/spec/introduce) @@ -156,13 +155,16 @@ Primate uses the following: ## History -The project was created by [Rohit Yadav](https://rohityadav.cloud) over several -weekends during late 2018 and early 2019. During ApacheCon CCCUS19, on 9th -September 2019, Primate was introduced and demoed as part of the talk [Modern UI +The modern UI, originally called Primate, was created by [Rohit +Yadav](https://rohityadav.cloud) over several weekends during late 2018 and +early 2019. During ApacheCon CCCUS19, on 9th September 2019, Primate was +introduced and demoed as part of the talk [Modern UI for CloudStack](https://rohityadav.cloud/files/talks/cccna19-primate.pdf) ([video](https://www.youtube.com/watch?v=F2KwZhechzs)). [Primate](https://markmail.org/message/vxnskmwhfaagnm4r) was accepted by the -Apache CloudStack project on 21 Oct 2019. +Apache CloudStack project on 21 Oct 2019. The original repo was [merged with the +main apache/cloudstack](https://markmail.org/message/bgnn4xkjnlzseeuv) repo on +20 Jan 2021. ## License diff --git a/ui/tools/docker.sh b/ui/docker.sh similarity index 93% rename from ui/tools/docker.sh rename to ui/docker.sh index 6b8ecdb7830..2af7570eab3 100755 --- a/ui/tools/docker.sh +++ b/ui/docker.sh @@ -30,4 +30,4 @@ LABEL_DATE="--label \"org.opencontainers.image.created=${DATE}\"" GIT_REV="$(git rev-parse HEAD)" LABEL_GIT_REV="--label \"org.opencontainers.image.revision=${GIT_REV}\"" -docker build -t cloudstack-primate ${LABEL_DATE} ${LABEL_GIT_REV} ${LABEL_GIT_TAG} .. +docker build -t cloudstack-ui ${LABEL_DATE} ${LABEL_GIT_REV} ${LABEL_GIT_TAG} . diff --git a/ui/docs/development.md b/ui/docs/development.md index 19fcc41929d..1693307238d 100644 --- a/ui/docs/development.md +++ b/ui/docs/development.md @@ -1,6 +1,6 @@ -# Primate Development +# UI Development -Primate is a modern role-based progressive CloudStack UI based on VueJS and Ant Design.. +The modern CloudStack UI is role-based progressive app that uses VueJS and Ant Design. Javascript, VueJS references: - https://www.w3schools.com/js/ @@ -29,8 +29,8 @@ The following tree shows the basic UI codebase filesystem: Clone the repository: ``` -git clone https://github.com/apache/cloudstack-primate.git -cd cloudstack-primate +git clone https://github.com/apache/cloudstack.git +cd cloudstack/ui npm install ``` Override the default `CS_URL` to a running CloudStack management server: @@ -200,7 +200,7 @@ For example: ## Resource Detail View Customization From the List View of the resources, on can navigate to the individual - resource's detail view, which in CloudStack Primate we refer to as the + resource's detail view, which in CloudStack UI we refer to as the *Resource View* by click on the specific resource. The Resource View has 2 sections: - InfoCard to the left that has basic / minimal details of that resource along @@ -229,4 +229,4 @@ For example, ] ``` -Additional tabs can be defined by adding on to the tabs section. \ No newline at end of file +Additional tabs can be defined by adding on to the tabs section. diff --git a/ui/packaging/debian/cloudstack-primate.install b/ui/nginx.conf similarity index 70% rename from ui/packaging/debian/cloudstack-primate.install rename to ui/nginx.conf index 34d9bcd80c1..9ba96cfbb20 100644 --- a/ui/packaging/debian/cloudstack-primate.install +++ b/ui/nginx.conf @@ -15,4 +15,16 @@ # specific language governing permissions and limitations # under the License. -/usr/share/cloudstack-management/webapp/primate/* +server { + listen 80; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html; + } + location /client/ { + # http://127.0.0.1:8080 should be replaced your CloudStack management + # Server's actual URI + proxy_pass http://127.0.0.1:8080; + } +} diff --git a/ui/package-lock.json b/ui/package-lock.json index 8ef729c3d1f..160be8c2040 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,5 +1,5 @@ { - "name": "primate", + "name": "cloudstack-ui", "version": "1.0.0", "lockfileVersion": 1, "requires": true, diff --git a/ui/package.json b/ui/package.json index 78320453006..eb92ac570c9 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,11 +1,11 @@ { - "name": "primate", + "name": "cloudstack-ui", "description": "Modern role-based Apache CloudStack UI", "version": "1.0.0", "homepage": "https://cloudstack.apache.org/", "repository": { "type": "git", - "url": "https://github.com/apache/cloudstack-primate.git" + "url": "https://github.com/apache/cloudstack.git" }, "author": { "name": "Apache CloudStack Developers", @@ -21,7 +21,7 @@ ], "bugs": { "mail": "dev@cloudstack.apache.org", - "url": "https://github.com/apache/cloudstack-primate/issues" + "url": "https://github.com/apache/cloudstack/issues" }, "scripts": { "start": "vue-cli-service lint --no-fix && vue-cli-service serve", diff --git a/ui/packaging/centos/primate.spec b/ui/packaging/centos/primate.spec deleted file mode 100644 index 094bc0d4905..00000000000 --- a/ui/packaging/centos/primate.spec +++ /dev/null @@ -1,86 +0,0 @@ -# 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. - -%define __os_install_post %{nil} -%global debug_package %{nil} - -Name: cloudstack -Summary: Modern Apache CloudStack UI - Primate -Release: %{_rel} -Version: %{_ver} -License: Apache License, Version 2 -Vendor: Apache CloudStack -Packager: Apache CloudStack -Group: System Environment/Libraries -Source0: primate-%{_ver}.tgz -BuildRoot: %{_tmppath}/%{name}-%{release}-build - -%description -Modern Apache CloudStack UI - Primate - -%package primate -Summary: Modern Apache CloudStack UI - Primate -Requires: cloudstack-management >= 4.15.0 -Group: System Environment/Libraries -%description primate -Primate - modern role-base progressive UI for Apache CloudStack - -%prep -echo "Starting Primate build..." - -%setup -q -n %{name} - -%build - -echo "Executing npm build..." -rm -fr node_modules -npm install -npm run build - -%install -echo "Installing Primate" -ls -lahi -[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} -mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/cloudstack-management/webapp/primate -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cloudstack/primate -mkdir -p ${RPM_BUILD_ROOT}%{_bindir}/ - -ls -cp -vr dist/* ${RPM_BUILD_ROOT}%{_datadir}/cloudstack-management/webapp/primate/ -# copy config to ${RPM_BUILD_ROOT}%{_sysconfdir}/cloudstack/primate - -%clean -[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf ${RPM_BUILD_ROOT} - -%preun primate -echo "Running through the pre-uninstall cloudstack-primate" - -%pre primate -echo "Running through pre-install cloudstack-primate" - -%post primate -echo "Running through post-install cloudstack-primate" - -%postun primate -echo "Running through the post-uninstall cloudstack-primate" - -%files primate -%defattr(-,root,root,-) -%{_datadir}/cloudstack-management/webapp/primate/* -%changelog -* Thu Feb 27 2020 Rohit Yadav 0.1.0 -- CloudStack Primate RPM diff --git a/ui/packaging/debian/changelog b/ui/packaging/debian/changelog deleted file mode 100644 index 8346c4522ce..00000000000 --- a/ui/packaging/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -cloudstack-primate (VERSION) unstable; urgency=low - - * CloudStack Primate version VERSION - - -- Rohit Yadav Thu, 27 Feb 2020 12:00:00 +0530 diff --git a/ui/packaging/debian/compat b/ui/packaging/debian/compat deleted file mode 100644 index ec635144f60..00000000000 --- a/ui/packaging/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/ui/packaging/debian/control b/ui/packaging/debian/control deleted file mode 100644 index 9115ca8ecbc..00000000000 --- a/ui/packaging/debian/control +++ /dev/null @@ -1,13 +0,0 @@ -Source: cloudstack-primate -Section: libs -Priority: extra -Maintainer: Apache CloudStack -Build-Depends: debhelper (>= 7), npm, nodejs -Standards-Version: 3.8.1 -Homepage: https://cloudstack.apache.org/ - -Package: cloudstack-primate -Architecture: all -Depends: cloudstack-management (>= 4.15.0) -Description: CloudStack Primate - The modern CloudStack UI - Primate diff --git a/ui/packaging/debian/copyright b/ui/packaging/debian/copyright deleted file mode 100644 index 13a83393a91..00000000000 --- a/ui/packaging/debian/copyright +++ /dev/null @@ -1,16 +0,0 @@ -# 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. diff --git a/ui/packaging/debian/rules b/ui/packaging/debian/rules deleted file mode 100755 index 92e336ca50b..00000000000 --- a/ui/packaging/debian/rules +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -DEBVERS := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') -PACKAGE = $(shell dh_listpackages|head -n 1|cut -d '-' -f 1) -CLOUDSTACK = "cloudstack" -SYSCONFDIR = "/etc" -USRBINDIR = "/usr/bin" -DESTDIR = "debian/tmp" - -# Uncomment this to turn on verbose mode. -export DH_VERBOSE=1 - -# This has to be exported to make some magic below work. -export DH_OPTIONS - -configure: configure-stamp -configure-stamp: - dh_testdir - -build: build-indep - -build-indep: build-indep-stamp - -build-indep-stamp: configure - cd .. && npm install && npm run build - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-arch-stamp build-indep-stamp - dh_clean - -install: - dh_testdir - dh_testroot - dh_prep -s - - # cloudstack-primate - mkdir -p $(DESTDIR)/usr/share/$(CLOUDSTACK)-management/webapp/primate - cp -vr ../dist/* $(DESTDIR)/usr/share/$(CLOUDSTACK)-management/webapp/primate/ - - dh_installdirs - dh_install - -binary: install - dh_install - dh_installchangelogs - dh_installman - dh_link - dh_strip - dh_compress - dh_fixperms - dh_makeshlibs - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb diff --git a/ui/packaging/package.sh b/ui/packaging/package.sh deleted file mode 100644 index 1160de44f32..00000000000 --- a/ui/packaging/package.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# 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. - -set -e -set -x - -ROOT=$PWD - -function package_deb() { - sed -i "s/VERSION/$VERSION-$DATE/g" debian/changelog - dpkg-buildpackage -uc -us - $(cd ../; tar czf cloudstack-primate-$VERSION-$DATE.tar.gz dist --transform s/dist/primate/) -} - -function package_rpm() { - CWD=`pwd` - RPMDIR=$CWD/../build - - REALVER=`echo $VERSION` - DEFVER="-D_ver $REALVER" - DEFREL="-D_rel $DATE" - - echo Preparing to package CloudStack Primate ${VERSION} - - mkdir -p $RPMDIR/SPECS - mkdir -p $RPMDIR/BUILD - mkdir -p $RPMDIR/RPMS - mkdir -p $RPMDIR/SRPMS - mkdir -p $RPMDIR/SOURCES/cloudstack - - echo ". preparing source tarball" - (cd ../; tar -c --exclude .git --exclude build . | tar -C $RPMDIR/SOURCES/cloudstack -x ) - (cd $RPMDIR/SOURCES/; tar -czf primate-$VERSION.tgz cloudstack) - - echo ". executing rpmbuild" - cp centos/primate.spec $RPMDIR/SPECS - - (cd $RPMDIR; rpmbuild --define "_topdir $RPMDIR" "${DEFVER}" "${DEFREL}" ${DEFPRE+"${DEFPRE}"} -bb SPECS/primate.spec) - - if [ $? -ne 0 ]; then - echo "RPM Build Failed " - exit 1 - else - echo "RPM Build Done" - fi -} - -DATE=$(date +"%Y%m%d") -VERSION=$(grep -Po '"version": "\K[^"]*' ../package.json) -sed -i "s/\"version\":.*/\"version\": \"$VERSION$DATE\",/g" ../package.json - -case "$1" in - deb ) package_deb - ;; - rpm ) package_rpm - ;; - * ) package_rpm - package_deb - ;; -esac diff --git a/ui/public/index.html b/ui/public/index.html index 44da6b79586..75896b4b583 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -30,7 +30,7 @@
diff --git a/ui/tools/api/apis.old b/ui/tools/api/apis.old deleted file mode 100644 index 661c8a1423b..00000000000 --- a/ui/tools/api/apis.old +++ /dev/null @@ -1,461 +0,0 @@ -activateProject -addAccountToProject -addBaremetalDhcp -addBaremetalPxeKickStartServer -addBaremetalRct -addCiscoAsa1000vResource -addCiscoVnmcResource -addCluster -addHost -addImageStore -addIpToNic -addLdapConfiguration -addNetscalerLoadBalancer -addNetworkServiceProvider -addNicToVirtualMachine -addRegion -addResourceDetail -addTrafficType -addUcsManager -addVmwareDc -addVpnUser -archiveAlerts -archiveEvents -assignCertToLoadBalancer -assignToGlobalLoadBalancerRule -assignToLoadBalancerRule -assignVirtualMachine -associateIpAddress -attachIso -attachVolume -authorizeSamlSso -authorizeSecurityGroupEgress -authorizeSecurityGroupIngress -cancelHostMaintenance -cancelStorageMaintenance -changeOutOfBandManagementPassword -cloudianIsEnabled -cloudianSsoLogin -configureHAForHost -configureInternalLoadBalancerElement -configureOutOfBandManagement -configureOvsElement -configureVirtualRouterElement -copyIso -copyTemplate -createAccount -createAffinityGroup -createAutoScalePolicy -createAutoScaleVmGroup -createAutoScaleVmProfile -createCondition -createDiskOffering -createDomain -createEgressFirewallRule -createFirewallRule -createGlobalLoadBalancerRule -createLBHealthCheckPolicy -createLBStickinessPolicy -createLoadBalancer -createLoadBalancerRule -createManagementNetworkIpRange -createNetwork -createNetworkACL -createNetworkACLList -createNetworkOffering -createPhysicalNetwork -createPod -createPortableIpRange -createPortForwardingRule -createPrivateGateway -createProject -createRemoteAccessVpn -createRole -createRolePermission -createSecondaryStagingStore -createSecurityGroup -createServiceOffering -createSnapshot -createSnapshotFromVMSnapshot -createSnapshotPolicy -createSSHKeyPair -createStaticRoute -createStorageNetworkIpRange -createStoragePool -createTags -createTemplate -createUser -createVlanIpRange -createVMSnapshot -createVolume -createVPC -createVPCOffering -createVpnConnection -createVpnCustomerGateway -createVpnGateway -createZone -dedicateCluster -dedicateGuestVlanRange -dedicateHost -dedicatePod -dedicatePublicIpRange -dedicateZone -deleteAccount -deleteAccountFromProject -deleteAffinityGroup -deleteAlerts -deleteBaremetalRct -deleteBigSwitchBcfDevice -deleteBrocadeVcsDevice -deleteCiscoAsa1000vResource -deleteCiscoNexusVSM -deleteCiscoVnmcResource -deleteCluster -deleteCondition -deleteDiskOffering -deleteDomain -deleteEgressFirewallRule -deleteEvents -deleteF5LoadBalancer -deleteFirewallRule -deleteGlobalLoadBalancerRule -deleteHost -deleteImageStore -deleteIso -deleteLBHealthCheckPolicy -deleteLBStickinessPolicy -deleteLdapConfiguration -deleteLoadBalancer -deleteLoadBalancerRule -deleteManagementNetworkIpRange -deleteNetscalerControlCenter -deleteNetscalerLoadBalancer -deleteNetwork -deleteNetworkACL -deleteNetworkACLList -deleteNetworkOffering -deleteNetworkServiceProvider -deleteNiciraNvpDevice -deleteOpenDaylightController -deletePaloAltoFirewall -deletePhysicalNetwork -deletePod -deletePortableIpRange -deletePortForwardingRule -deletePrivateGateway -deleteProject -deleteProjectInvitation -deleteRemoteAccessVpn -deleteRole -deleteRolePermission -deleteSecondaryStagingStore -deleteSecurityGroup -deleteServiceOffering -deleteSnapshot -deleteSnapshotPolicies -deleteSrxFirewall -deleteSSHKeyPair -deleteSslCert -deleteStaticRoute -deleteStorageNetworkIpRange -deleteStoragePool -deleteTags -deleteTemplate -deleteUcsManager -deleteUser -deleteVlanIpRange -deleteVMSnapshot -deleteVolume -deleteVPC -deleteVPCOffering -deleteVpnConnection -deleteVpnCustomerGateway -deleteVpnGateway -deleteZone -deployVirtualMachine -destroyRouter -destroySystemVm -destroyVirtualMachine -detachIso -detachVolume -disableAccount -disableAutoScaleVmGroup -disableCiscoNexusVSM -disableHAForCluster -disableHAForHost -disableHAForZone -disableOutOfBandManagementForCluster -disableOutOfBandManagementForHost -disableOutOfBandManagementForZone -disableStaticNat -disableUser -disassociateIpAddress -disassociateUcsProfileFromBlade -enableAccount -enableAutoScaleVmGroup -enableCiscoNexusVSM -enableHAForCluster -enableHAForHost -enableHAForZone -enableOutOfBandManagementForCluster -enableOutOfBandManagementForHost -enableOutOfBandManagementForZone -enableStaticNat -enableStorageMaintenance -enableUser -expungeVirtualMachine -extractIso -extractTemplate -extractVolume -findHostsForMigration -findStoragePoolsForMigration -getUploadParamsForIso -getUploadParamsForTemplate -getUploadParamsForVolume -getUserKeys -importLdapUsers -instantiateUcsTemplateAndAssocaciateToBlade -issueOutOfBandManagementPowerAction -ldapCreateAccount -linkDomainToLdap -listAccounts -listAffinityGroups -listAffinityGroupTypes -listAlerts -listAndSwitchSamlAccount -listApis -listAutoScaleVmGroups -listAutoScaleVmProfiles -listBaremetalDhcp -listBaremetalPxeServers -listBaremetalRct -listBigSwitchBcfDevices -listBrocadeVcsDevices -listCapabilities -listCapacity -listCiscoAsa1000vResources -listCiscoNexusVSMs -listCiscoVnmcResources -listClusters -listClustersMetrics -listConfigurations -listCounters -listDedicatedClusters -listDedicatedGuestVlanRanges -listDedicatedHosts -listDedicatedPods -listDedicatedZones -listDeploymentPlanners -listDetailOptions -listDiskOfferings -listDomainChildren -listDomains -listEgressFirewallRules -listEvents -listF5LoadBalancers -listFirewallRules -listGlobalLoadBalancerRules -listHostHAProviders -listHosts -listHostsMetrics -listHostTags -listHypervisorCapabilities -listHypervisors -listIdps -listImageStores -listInfrastructure -listInternalLoadBalancerElements -listInternalLoadBalancerVMs -listIsos -listLBHealthCheckPolicies -listLBStickinessPolicies -listLdapConfigurations -listLdapUsers -listLoadBalancerRuleInstances -listLoadBalancerRules -listLoadBalancers -listManagementServers -listNetscalerControlCenter -listNetscalerLoadBalancers -listNetworkACLLists -listNetworkACLs -listNetworkOfferings -listNetworks -listNetworkServiceProviders -listNiciraNvpDevices -listNics -listOpenDaylightControllers -listOsCategories -listOsTypes -listOvsElements -listPaloAltoFirewalls -listPhysicalNetworks -listPods -listPortableIpRanges -listPortForwardingRules -listPrivateGateways -listProjectAccounts -listProjectInvitations -listProjects -listPublicIpAddresses -listRegions -listRegisteredServicePackages -listRemoteAccessVpns -listResourceLimits -listRolePermissions -listRoles -listRouters -listSamlAuthorization -listSecondaryStagingStores -listSecurityGroups -listServiceOfferings -listSnapshotPolicies -listSnapshots -listSrxFirewalls -listSSHKeyPairs -listSslCerts -listStaticRoutes -listStorageNetworkIpRange -listStoragePools -listStoragePoolsMetrics -listStorageProviders -listStorageTags -listSupportedNetworkServices -listSystemVms -listTags -listTemplateOvfProperties -listTemplatePermissions -listTemplates -listTrafficTypes -listUcsBlades -listUcsManagers -listUcsTemplates -listUsers -listVirtualMachines -listVirtualMachinesMetrics -listVirtualRouterElements -listVlanIpRanges -listVMSnapshot -listVmwareDcs -listVolumes -listVolumesMetrics -listVPCOfferings -listVPCs -listVpnConnections -listVpnCustomerGateways -listVpnGateways -listVpnUsers -listZones -listZonesMetrics -migrateSystemVm -migrateVirtualMachine -migrateVirtualMachineWithVolume -migrateVolume -moveNetworkAclItem -prepareHostForMaintenance -provisionCertificate -queryAsyncJobResult -quotaBalance -quotaCredits -quotaEmailTemplateList -quotaEmailTemplateUpdate -quotaIsEnabled -quotaStatement -quotaSummary -quotaTariffList -quotaTariffUpdate -rebootRouter -rebootSystemVm -rebootVirtualMachine -reconnectHost -recoverVirtualMachine -refreshUcsBlades -registerIso -registerNetscalerControlCenter -registerSSHKeyPair -registerTemplate -registerUserKeys -releaseDedicatedCluster -releaseDedicatedGuestVlanRange -releaseDedicatedHost -releaseDedicatedPod -releaseDedicatedZone -releasePublicIpRange -removeFromGlobalLoadBalancerRule -removeFromLoadBalancerRule -removeIpFromNic -removeNicFromVirtualMachine -removeRegion -removeVmwareDc -removeVpnUser -replaceNetworkACLList -resetPasswordForVirtualMachine -resetSSHKeyForVirtualMachine -resetVpnConnection -resizeVolume -restartNetwork -restartVPC -restoreVirtualMachine -revertSnapshot -revertToVMSnapshot -revokeSecurityGroupEgress -revokeSecurityGroupIngress -runDiagnostics -scaleSystemVm -scaleVirtualMachine -startInternalLoadBalancerVM -startRouter -startSystemVm -startVirtualMachine -stopInternalLoadBalancerVM -stopRouter -stopSystemVm -stopVirtualMachine -suspendProject -updateAccount -updateAutoScalePolicy -updateAutoScaleVmGroup -updateAutoScaleVmProfile -updateCluster -updateConfiguration -updateDefaultNicForVirtualMachine -updateDiskOffering -updateDomain -updateGlobalLoadBalancerRule -updateHost -updateHypervisorCapabilities -updateIso -updateIsoPermissions -updateLoadBalancerRule -updateNetwork -updateNetworkACLItem -updateNetworkACLList -updateNetworkOffering -updateNetworkServiceProvider -updatePhysicalNetwork -updatePod -updateProject -updateProjectInvitation -updateRegion -updateResourceCount -updateResourceLimit -updateRole -updateRolePermission -updateServiceOffering -updateStoragePool -updateTemplate -updateTemplatePermissions -updateTrafficType -updateUser -updateVirtualMachine -updateVMAffinityGroup -updateVmNicIp -updateVmwareDc -updateVPC -updateVPCOffering -updateVpnCustomerGateway -updateZone -upgradeRouterTemplate -uploadCustomCertificate -uploadSslCert -uploadVolume diff --git a/ui/tools/api/apis.primate.sh b/ui/tools/api/apis.primate.sh deleted file mode 100644 index 568eece6f0b..00000000000 --- a/ui/tools/api/apis.primate.sh +++ /dev/null @@ -1,14 +0,0 @@ -cd ../../src/ -rm -f apis.txt -grep api\( -R . | grep -v import | sed "s/.*api('//g" | sed "s/'.*//g" | grep -v '.vue' | sort | uniq >> apis.txt -grep api -R config | sed "s/.*api: '//g" | sed "s/'.*//g" | grep -v \.js | sort | uniq >> apis.txt -grep store.getters.apis -R . | sed "s/' in.*//g" | sed "s/').*//g" | grep "'" | sed "s/.*'//g" | grep -v ']' >> apis.txt -grep 'permission:\ \[' -R config | sed "s/.*permission: \['//g" | grep -v .js | sed "s/', '/\\n/g" | sed "s/'.*//g" >> apis.txt -cat apis.txt | sort | uniq > apis.uniq -rm -f apis.txt -mv apis.uniq ../tools/api/apis.txt -cd ../tools/api -diff -Naur apis.old apis.txt | grep ^- | grep -v "^--" | sed 's/^-//g' | grep -v -i -e cisco -e nicira -e baremetal -e srx -e f5 -e brocade -e palo -e autoscale -e counter -e condition -e ucs -e netscaler -e bigswitch -e ovs -e globalloadbalancer -e opendaylight -e region -e quota | sort | uniq > apis.remaining - -echo "$(cat apis.txt | wc -l) APIs are supported by Primate" -echo "$(cat apis.remaining | wc -l) APIs are remaining" diff --git a/ui/tools/api/apis.remaining b/ui/tools/api/apis.remaining deleted file mode 100644 index 7c92926e048..00000000000 --- a/ui/tools/api/apis.remaining +++ /dev/null @@ -1,4 +0,0 @@ -listDeploymentPlanners -listHostTags -listStorageProviders -listStorageTags diff --git a/ui/tools/git-pr b/ui/tools/git-pr deleted file mode 100755 index 612c95d0a6a..00000000000 --- a/ui/tools/git-pr +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/bash - -# 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. - -# Should we clean-up? -cleanup=1 - -clean_up_and_exit() { - if [ "${cleanup}" -eq 1 ]; then - echo - git branch -D pr/${prId} >/dev/null 2>&1 - rm ${jsonTmp} ${tmpMessageFile} >/dev/null 2>&1 - fi - exit $1 -} - -# Arguments -argument=$1 -prId=${argument} -force=0 -if [[ "${2}" == "--force" ]]; then - force=1 -fi - -# Some of us got used to a git pr alias that you had to feed with the PR url -# Let's make this script backwards compatible with the previous one. -if [[ ${argument} =~ https://github.com.* ]]; then - prId=$(echo "${argument}" | awk -F/ {'print $7'}) - echo "INFO: Found PR id ${prId} from url" -fi - -# Check the arguments -if [ -z ${prId} ]; then - echo "Usage: git pr pool-request-number [ --force ]" - echo "Works for any Apache repository mirrored on GitHub'" - echo "For instructions, see: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61311655" - clean_up_and_exit 1 -fi - -# Vars we need -jsonTmp="${PWD}/${prId}.json" -tmpMessageFile="${PWD}/.git-tmp-message.txt" -repoName=cloudstack-primate - -# We need UTF-8 to support the GitHub '...' 3-dots-in-1-char, for example. -export LANG="en_EN.UTF-8" - -if [ "${prId}" -eq "${prId}" 2>/dev/null ]; then - # Get json data from Github API - curl -s https://api.github.com/repos/apache/${repoName}/pulls/${prId} > ${jsonTmp} -else - echo "ERROR: Pull-request id must be an integer, not '${prId}'" - clean_up_and_exit 1 -fi - -# Get vars from the GitHub API and parse the returned json -prAuthor=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['user']['login'].encode('utf-8').decode('ascii','ignore') -except: - print '' -") - -prTitle=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['title'].encode('utf-8').decode('ascii','ignore') -except: - print '' -") - -prBody=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['body'].encode('utf-8').decode('ascii','ignore') -except: - print '' -") - -prOriginBranch=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['head']['label'].encode('utf-8').decode('ascii','ignore') -except: - print '' -" | sed -e "s/:/\//") - -prState=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['state'].encode('utf-8').decode('ascii','ignore') -except: - print 'Unknown' -") - -prMergeableState=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['mergeable_state'].encode('utf-8').decode('ascii','ignore') -except: - print 'Unknown' -") - -prDestinationBranch=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['base']['ref'].encode('utf-8').decode('ascii','ignore') -except: - print 'Unknown' -") - -prCommits=$(cat ${jsonTmp} | python -c " -try: - import sys, json - print json.load(sys.stdin)['commits'] -except: - print 'Unknown' -") - -# Do some sanity checking -if [ ${#prAuthor} -eq 0 ]; then - echo "ERROR: We couldn't grab the PR author. Something went wrong querying the GitHub API." - clean_up_and_exit 1 -fi - -if [ ${#prTitle} -eq 0 ]; then - echo "ERROR: We couldn't grab the PR title. Something went wrong querying the GitHub API." - clean_up_and_exit 1 -fi - -if [ ${#prOriginBranch} -eq 0 ]; then - echo "ERROR: We couldn't grab the PR branch name. Something went wrong querying the GitHub API." - clean_up_and_exit 1 -fi - -currentBranch=$(git branch | grep "^*" | sed -e "s/^[*] //") -if [ "${prDestinationBranch}" != "${currentBranch}" ] && [ ${force} -lt 1 ]; then - echo "ERROR: This PR is made against branch '${prDestinationBranch}' while your current checked out branch is '${currentBranch}'." - echo "ERROR: Please make sure you're in the right branch and run this scipt again." - clean_up_and_exit 1 -elif [ "${prDestinationBranch}" != "${currentBranch}" ] && [ ${force} -eq 1 ]; then - echo "WARNING: You used --force to merge to '${currentBranch}' while this PR is for branch '${prDestinationBranch}'." -fi - -if [ "${prState}" != "open" ] && [ ${force} -lt 1 ]; then - echo "ERROR: We couldn't merge the PR because the state is not 'open' but '${prState}'." - echo "ERROR: In general it's a bad idea to merge closed PRs!" - echo "ERROR: Run this script again with --force if you know what you're doing" - echo "ERROR: (continuing work on an abandoned PR in which case you'd merge to a branch in your fork" - echo "ERROR: and send that as a new PR). Ask for help on @dev if unsure." - clean_up_and_exit 1 -elif [ "${prState}" != "open" ] &&[ ${force} -eq 1 ]; then - echo "WARNING: You used --force to merge a PR with state '${prState}'." -fi - -if [ "${prMergeableState}" != "clean" ] && [ ${force} -lt 1 ]; then - echo "ERROR: We couldn't merge the PR because it cannot be merged 'clean' (GitHub reports '${prMergeableState}')." - echo "ERROR: This can be caused by a Travis build in progress, a failed Travis build or an unclean merge (conflicts)" - echo "ERROR: Run this script again with --force if you know what you're doing. Ask for help on @dev if unsure." - clean_up_and_exit 1 -elif [ "${prMergeableState}" != "clean" ] && [ ${force} -eq 1 ]; then - echo "WARNING: You used --force to merge a PR with non-clean merge state '${prMergeableState}'." -fi - -github_remote=$(git remote -v | grep -E "apache/${repoName}(.git)?" | head -n 1 | cut -f1) -apache_remote=$(git remote -v | grep -E "git-wip-us\.apache\.org" | head -n 1 | cut -f1) -if [ ${#github_remote} -eq 0 ]; then - echo "ERROR: We couldn't find a git remote pointing to 'apache/${repoName}.git' to merge the PR from." - echo "INFO: Currently, your configured remotes are:" - echo "INFO: ***********************************************************************************" - git remote -v - echo "INFO: ***********************************************************************************" - echo "INFO: To merge a PR, we need access to two remotes: " - echo "INFO: 1. Read-only access to GitHub mirror" - echo "INFO: 2. Read/write access to Apache git" - echo "INFO: Please add a remote like this: 'git remote add github https://github.com/apache/${repoName}.git'" - echo "INFO: For more help, visit: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61311655" - echo "INFO: Once done, run this script again." - clean_up_and_exit 1 -fi - -echo "INFO: Using remote repository '${github_remote}' to fetch PR (should point to github.com/apache/${repoName}.git)" -echo "INFO: PR #${prId} against branch '${prDestinationBranch}' from '${prAuthor}': '${prTitle}'" -echo "INFO: has state '${prState}' and mergable state '${prMergeableState}', about to be merged in branch '${currentBranch}'." - -# Construct commit merge message -echo "Merge pull request #${prId} from ${prOriginBranch}" > ${tmpMessageFile} -echo "" >> ${tmpMessageFile} -echo "${prTitle}${prBody}" >> ${tmpMessageFile} - -# Are you sure? -echo "ATTENTION: Merging pull request #${prId} from ${prOriginBranch} into '${currentBranch}' branch in 5 seconds. CTRL+c to abort.." -sec=5 -while [ $sec -ge 0 ]; do - printf "${sec} " - sec=$((sec-1)) - sleep 1 -done -echo -echo "INFO: Executing the merge now.. Git output below:" -echo "INFO: ***********************************************************************************" - -# Do the actual merge -git fetch ${github_remote} pull/${prId}/head:pr/${prId} -git merge --no-ff --log -m "$(cat ${tmpMessageFile})" pr/${prId} -if [ $? -eq 0 ]; then - git commit --amend -s --allow-empty-message -m '' -else - echo "ERROR: Merge failed, aborting." - git merge --abort - clean_up_and_exit 1 -fi - -# What's next -echo "INFO: ***********************************************************************************" -echo "INFO: Merged successfully! Please double check using 'git log -p' and 'git push' when you're sure." -echo "INFO: About commits: there should be ${prCommits} from the PR plus 1 merge commit." -echo "INFO: Actual diff in commits is: (running git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch})" -echo -git log --pretty=oneline --abbrev-commit ${apache_remote}/${currentBranch}..${currentBranch} - -clean_up_and_exit 0 diff --git a/ui/tools/performrelease.sh b/ui/tools/performrelease.sh deleted file mode 100755 index 13354008814..00000000000 --- a/ui/tools/performrelease.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -# 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. - -version='TESTBUILD' -sourcedir=~/cloudstack-primate -outputdir=/tmp/cloudstack-primate-build/ -branch='master' -tag='no' -certid='X' -committosvn='X' - -usage(){ - echo "usage: $0 -v version [-b branch] [-s source dir] [-o output dir] [-t] [-u] [-c] [-h]" - echo " -v sets the version" - echo " -b sets the branch (defaults to 'master')" - echo " -s sets the source directory (defaults to $sourcedir)" - echo " -o sets the output directory (defaults to $outputdir)" - echo " -t tags the git repo with the version" - echo " -u sets the certificate ID to sign with (if not provided, the default key is attempted)" - echo " -c commits build artifacts to cloudstack dev dist dir in svn" - echo " -h" -} - -while getopts v:s:o:b:u:tch opt -do - case "$opt" in - v) version="$OPTARG";; - s) sourcedir="$OPTARG";; - o) outputdir="$OPTARG";; - b) branch="$OPTARG";; - t) tag="yes";; - u) certid="$OPTARG";; - c) committosvn="yes";; - h) usage - exit 0;; - /?) # unknown flag - usage - exit 1;; - esac -done -shift `expr $OPTIND - 1` - -if [ $version == "TESTBUILD" ]; then - echo >&2 "A version must be specified with the -v option: $0 -v 1.0.0.RC1" - exit 1 -fi - -echo "Using version: $version" -echo "Using source directory: $sourcedir" -echo "Using output directory: $outputdir" -echo "Using branch: $branch" -if [ "$tag" == "yes" ]; then - if [ "$certid" == "X" ]; then - echo "Tagging the branch with the version number, and signing the branch with your default certificate." - else - echo "Tagging the branch with the version number, and signing the branch with certificate ID $certid." - fi -else - echo "The branch will not be tagged. You should consider doing this." -fi - -echo $PWD - -exit - -if [ -d "$outputdir" ]; then - rm -r $outputdir/* -else - mkdir $outputdir -fi - -cd $sourcedir - -echo 'checking out correct branch' -git checkout $branch - -git clean -f - -export commitsh=`git show HEAD | head -n 1 | cut -d ' ' -f 2` -echo "releasing as $commitsh" - -echo 'archiving' -git archive --format=tar --prefix=apache-cloudstack-primate-$version-src/ $branch > $outputdir/apache-cloudstack-primate-$version-src.tar -bzip2 $outputdir/apache-cloudstack-primate-$version-src.tar - -cd $outputdir -echo 'armor' -if [ "$certid" == "X" ]; then - gpg -v --armor --output apache-cloudstack-primate-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-primate-$version-src.tar.bz2 -else - gpg -v --default-key $certid --armor --output apache-cloudstack-primate-$version-src.tar.bz2.asc --detach-sig apache-cloudstack-primate-$version-src.tar.bz2 -fi - -echo 'md5' -gpg -v --print-md MD5 apache-cloudstack-primate-$version-src.tar.bz2 > apache-cloudstack-primate-$version-src.tar.bz2.md5 - -echo 'sha512' -gpg -v --print-md SHA512 apache-cloudstack-primate-$version-src.tar.bz2 > apache-cloudstack-primate-$version-src.tar.bz2.sha512 - -echo 'verify' -gpg -v --verify apache-cloudstack-primate-$version-src.tar.bz2.asc apache-cloudstack-primate-$version-src.tar.bz2 - -if [ "$tag" == "yes" ]; then - echo 'tag' - cd $sourcedir - if [ "$certid" == "X" ]; then - git tag -s $version -m "Tagging release $version on branch $branch." - else - git tag -u $certid -s $version -m "Tagging release $version on branch $branch." - fi -fi - -if [ "$committosvn" == "yes" ]; then - echo 'committing artifacts to svn' - rm -Rf /tmp/cloudstack-dev-dist - cd /tmp - svn co https://dist.apache.org/repos/dist/dev/cloudstack/ cloudstack-dev-dist - cd cloudstack-dev-dist - if [ -d "primate-$version" ]; then - cd primate-$version - svn rm * - else - mkdir primate-$version - svn add primate-$version - cd primate-$version - fi - cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2 . - cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2.asc . - cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2.md5 . - cp $outputdir/apache-cloudstack-primate-$version-src.tar.bz2.sha512 . - svn add apache-cloudstack-primate-$version-src.tar.bz2 - svn add apache-cloudstack-primate-$version-src.tar.bz2.asc - svn add apache-cloudstack-primate-$version-src.tar.bz2.md5 - svn add apache-cloudstack-primate-$version-src.tar.bz2.sha512 - svn commit -m "Committing release candidate artifacts for $version to dist/dev/cloudstack in preparation for release vote" -fi - -echo "completed. use commit-sh of $commitsh when starting the VOTE thread"