https://github.com/globocom/swiftsuru
Swift service for Tsuru PaaS
https://github.com/globocom/swiftsuru
Last synced: 10 months ago
JSON representation
Swift service for Tsuru PaaS
- Host: GitHub
- URL: https://github.com/globocom/swiftsuru
- Owner: globocom
- Created: 2014-10-24T17:23:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-06-15T17:09:57.000Z (about 8 years ago)
- Last Synced: 2025-04-06T08:36:39.612Z (over 1 year ago)
- Language: Python
- Size: 88.9 KB
- Stars: 5
- Watchers: 21
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
API for adding Swift as a service in Tsuru, implemented using Flask (Python).
##User
Considering you are using a pre-configured Tsuru cloud and that Swiftsuru is already available, you will be able to:
###Check which Swift plans are available
tsuru service-info swift
###Create a new Swift instance
tsuru service-add swift
###Bind your swift instance to an existing app
tsuru bind --app
After binding, the following environment variables will be available at your App units:
* SWIFT\_ADMIN\_URL
* SWIFT\_AUTH\_URL
* SWIFT\_CONTAINER
* SWIFT\_INTERNAL\_URL
* SWIFT\_PASSWORD
* SWIFT\_PUBLIC\_URL
* SWIFT\_TENANT
* SWIFT\_USER
There are some possible use cases to integrate your App with Swift. The most common use case is deploy/serve the static file of your application. To easily do this, we recommend [simple-swifclient](https://github.com/globocom/simple-swiftclient).
Example of deploy hook of a Django App.
tsuru.yml
```
hooks:
build:
- bash /home/application/current/static-deploy-hook.sh
```
static-deploy-hook.sh
```
#!/bin/bash
python manage.py collectstatic --noinput && \
cd /home/application/current && \
simpleswift --os-auth-url $SWIFT_AUTH_URL \
--os-username $SWIFT_USER \
--os-password $SWIFT_PASSWORD \
--os-tenant-name $SWIFT_TENANT \
upload $SWIFT_CONTAINER
```
##Developers
###How to run
In order to install dependencies and run the Swiftsuru API locally, do:
```
make setup
make run
```
###How to run tests
make tests