Repository navigation
Dotcloud #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Dotcloud #28
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| cctrl.egg-info/ | ||
| dotcloudng.egg-info/ | ||
| htmlcov/ | ||
| .cache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #!/usr/bin/env python | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| """ | ||
| Copyright 2014 cloudControl GmbH | ||
|
|
||
| Licensed 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. | ||
| """ | ||
|
|
||
| from cctrl.settings import Settings | ||
| from cctrl.app_commands import setup_cli | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| settings = Settings(api_url='https://api.dotcloudapp.com', ssh_forwarder_url='sshforwarder.dotcloudapp.com') | ||
| setup_cli(settings) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env python | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| """ | ||
| Copyright 2014 cloudControl GmbH | ||
|
|
||
| Licensed 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. | ||
| """ | ||
| from cctrl.settings import Settings | ||
| from cctrl.user_commands import setup_cli | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| settings = Settings(api_url='https://api.dotcloudapp.com', ssh_forwarder_url='sshforwarder.dotcloudapp.com') | ||
| setup_cli(settings) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # -*- coding: utf-8 -*- | ||
| __version__ = '1.11.1' | ||
| __version__ = '1.12.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| Continous releasing | ||
| =================== | ||
|
|
||
| This CI setup releases `cctrl` and `dotcloudng` packages on PyPI whenever a new bumped version | ||
| is pushed into master branch. | ||
|
|
||
| Requirements | ||
| ------------ | ||
|
|
||
| * Create a [PyPI account](https://pypi.python.org/pypi?%3Aaction=register_form) for jenkins user. | ||
| * Create `.pypirc` file at jenkins user's $HOME: | ||
|
|
||
| ~~~ | ||
| [distutils] | ||
| index-servers = | ||
| pypi | ||
|
|
||
| [pypi] | ||
| username:{Jenkins username at PyPI} | ||
| password:{Jenkins password at PyPI} | ||
| ~~~ | ||
|
|
||
| * Add _maintainer_ [role](https://pypi.python.org/pypi?:action=role_form&package_name=cctrl) in `cctrl` and `dotcloung` to jenkins user. | ||
|
|
||
| Build Configuration | ||
| ------------------- | ||
|
|
||
| Build configuration is basic and similar to other jenkins builds. Furthermore, | ||
| _Execute shell_ is pretty simple: | ||
|
|
||
| ci/prepare | ||
| python ci/release.py | ||
|
|
||
| Double checking | ||
| --------------- | ||
|
|
||
| When build is executed, you should find fresh new packages released under: | ||
|
|
||
| * `cctrl`: https://pypi.python.org/pypi/cctrl | ||
| * `dotcloudng`: https://pypi.python.org/pypi/dotcloudng |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash -e | ||
|
|
||
| echo "Install python tools..." | ||
| cd $WORKSPACE | ||
|
|
||
| if [ ! -d "cctrl_venv" ]; then | ||
| virtualenv --system-site-packages cctrl_venv | ||
| fi | ||
| source cctrl_venv/bin/activate | ||
| pip install -r requirements_tests.txt --upgrade | ||
|
|
||
| ./pre-commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import os | ||
| import sys | ||
| import xmlrpclib | ||
|
|
||
| from shutil import rmtree | ||
| from subprocess import check_call | ||
|
|
||
| TEMP_DIR = 'tmp' | ||
| PROJECT_NAME = 'cctrl' | ||
| DIST_DIR = os.path.join(TEMP_DIR, 'dist') | ||
|
|
||
|
|
||
| def main(): | ||
| if is_current_version(): | ||
| sys.exit("Version is not updated. Aborting release.") | ||
|
|
||
| dist() | ||
| cleanup() | ||
|
|
||
|
|
||
| def is_current_version(): | ||
| pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi') | ||
| return pypi.package_releases('cctrl')[0] == __version__ | ||
|
|
||
|
|
||
| def dist(): | ||
| try: | ||
| check_call(['python', | ||
| 'setup.py', | ||
| 'sdist', | ||
| '--dist-dir={0}'.format(DIST_DIR), | ||
| '--formats=gztar', | ||
| 'upload']) | ||
| except OSError as e: | ||
| print e | ||
|
|
||
|
|
||
| def cleanup(): | ||
| rmtree(TEMP_DIR) | ||
|
|
||
| if __name__ == '__main__': | ||
| execfile(os.path.join(PROJECT_NAME, 'version.py')) | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Building cloudControl CLI Windows installer | ||
| ============================ | ||
|
|
||
| ### PRE-INSTALLATION STEPS | ||
|
|
||
| 1. Install python 2.7.6 via msi installer: [http://www.python.org/download/releases/2.7.6/](http://www.python.org/download/releases/2.7.6/) | ||
| 2. Install setuptools: [https://bitbucket.org/pypa/setuptools#rst-header-windows](https://bitbucket.org/pypa/setuptools#rst-header-windows) | ||
| 3. Install pycrypto for python 2.7: [http://www.voidspace.org.uk/python/modules.shtml#pycrypto](http://www.voidspace.org.uk/python/modules.shtml#pycrypto) | ||
| 4. Install p2exe: [http://sourceforge.net/projects/py2exe](http://sourceforge.net/projects/py2exe) | ||
| 5. Install Inno Setup: [http://www.jrsoftware.org/isdl.php#stable](http://www.jrsoftware.org/isdl.php#stable) | ||
| 6. Install git bash: [http://msysgit.github.io/](http://msysgit.github.io/) | ||
|
|
||
| ### BUILDING CLI FOR SPECIFIC ENVIRONMENT | ||
|
|
||
| * To start build, simply execute (use git bash): | ||
|
|
||
| ~~~bash | ||
| $ win32/build_installer.sh ENV PATH_TO_CCTRL_DIR | ||
| ~~~ | ||
|
|
||
| where: | ||
|
|
||
| - `ENV` is `[cctrl|dotcloudng]` | ||
| - `PATH_TO_CCTRL_DIR` is an optional parameter specifying path to cctrl source directory. If not specified build script will clone master version. | ||
|
|
||
| Optionally, you can specify locations of `Python` and `ISCC` home directories by setting these env variables: `PYTHON_HOME` and `ISCC_HOME`. After successful build, executable file is located in `win32setup` directory. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python setup.py already provides the functionality, have a look: https://docs.python.org/2/distutils/packageindex.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scripts indeed uses setup.py.
I'm going nuts, but yesterday I read the official documentation recommending to use
twineas a recommended replacement ofsetup.py upload. Now I can't find it. Still, in the package itself states whytwineis better thansetup.py uploadhttps://pypi.python.org/pypi/twineThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After taking a look, I think I can change it back to a plane
setup.py upload, instead of using third party packages.The motivation of having a script instead of directly calling the setup.py command is that this way we can check the version and only upload when it is newer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end, as you prefer. I just know that pypi renewed their package system and I know this register/upload command from that time. If a script fits better for us, fine with me, just want to mention it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.