Skip to content

Commit 9320f85

Browse files
committed
Merge pull request #1460 from shapeblue/jsb/jenv-pyenv
CLOUDSTACK-9334: Support jenv and pyenv to manage Java and Python versions * Adds .java-version to specify Java 1.7 as the JDK version to use for CloudStack development. jenv does not support comments in this file. Therefore, no license header is present. * Adds .python-vresion to specify Python 2.7.11 as the Python to use for CloudStack development. pyenv does not support comments in this file. Therefore, no license header is present. * Adds requirements.txt to specify the default dependencies used for CloudStack development. It does not include Marvin's dependencies because it's bundle already defines the dependencies which are installed with Marvin. * Updates INSTALL.md to explain how to utilize jenv and pyenv for CloudStack development * pr/1460: CLOUDSTACK-9334: Support jenv and pyenv to manage Java and Python versions Signed-off-by: Will Stevens <[email protected]>
2 parents 8c3722d + 7add16d commit 9320f85

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.7

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cloudstack

INSTALL.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,23 @@ Start the MySQL service:
3838

3939
$ service mysqld start
4040

41+
### Using jenv and/or pyenv for Version Management
42+
43+
CloudStack is built using Java and Python. To make selection of these tools versions more consistent and ease installation for developers, optional support for [jenv](http://www.jenv.be/) and [pyenv](https://github.com/yyuu/pyenv) with [virtualenv]|(https://github.com/yyuu/pyenv-virtualenv) is provided. jenv installation instructions are available here and pyenv installation instructions are available here. For users of [oh-my-zsh](http://ohmyz.sh/) there is a pyenv plugin available to trigger configuration of pyenv in a shell session.
44+
45+
Following installation, execute the following commands to configure jenv and pyenv for use with CloudStack development:
46+
47+
'''
48+
# pyenv install 2.7.11 # Install Python 2.7.11
49+
# pyenv virtualenv 2.7.11 cloudstack # Create a cloidstack virtualenv using Python 2.7.11
50+
# pip install -r <root CloudStack source tree>/requirements.txt # Install cloudstack Python dependencies
51+
# jenv add <path to JDK 1.7 installation> # Add Java7 to jenv
52+
'''
53+
54+
*N.B.* If you are running Linux, you may need to install additional packages to allow pyenv to build Python.
55+
56+
Following these steps, jenv and pyenv will use .java-version and .python-version files in the root of the CloudStack source tree to switch to the correct Java version and the cloudstack Python virtualenv for CloudStack development.
57+
4158
## Getting the Source Code
4259

4360
You may get the source code from the repository hosted on Apache:

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,8 @@
797797
<exclude>CONTRIBUTING.md</exclude>
798798
<exclude>tools/docker/Dockerfile</exclude>
799799
<exclude>tools/docker/supervisord.conf</exclude>
800+
<exclude>.java-version</exclude>
801+
<exclude>.python-version</exclude>
800802
<exclude>.idea/</exclude>
801803
<exclude>**/*.log</exclude>
802804
<exclude>**/*.patch</exclude>

requirements.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# Install the latest version of cloudmonkey
19+
cloudmonkey
20+
21+
# Marvin dependencies are installed via its bundle

0 commit comments

Comments
 (0)