This workflow should work with any platform exposing the Clound Foundry API.
Note that version 2 of the API is used by this workflow.
-
Download and install Cloud-Foundry.alfred3workflow
-
Configure the endpoint and your Cloud Foundry credentials (see in the How to use section)
-
Enjoy !
Type cf to get a list of all the available commands.
When a list is presented, you can search for a specific element.
For any selected resource, press Cmd+C and get its JSON value copied in the clipboard.
A cache per resource (applications, routes, services, ...) is used to keep the resources obtained from Cloud Foundry: it is useful when you are looking for a specific resource in a list. The data in a cache expire after 15 seconds.
If you're using a proxy, configure it in the HTTP_PROXY and HTTPS_PROXY environment variables.
Under the hood, this framework uses the cf-client-python library to execute the requests to Cloud Foundry.
cf setendpoint <endpoint>
cf setcredentials <login> <password>
Note: the password is stored in the Keychain, not in clear.
Before pushing an application, a space must have been targeted.
- From the Finder
You can select a manifest file from the finder and use Alfred to push the associated application(s) in Cloud Foundry.
- From Alfred
Or you can find a manifest directly from Alfred before pushing the associated application(s).
Press Cmd and select an application to start (or stop) it depending on its state.
Note that starting an application may take a few moment so just be patient.
Press Shift and select the application to remove.
Press Ctrl and select the application to restage.
Note that this can be a lenghty operation since a droplet must be recreated on the platform.
For started applications, you can press the Alt key and press enter to retrieve its stats.
When the stats are obtained, press Cmd+C to save them in the clipboard.
For started applications, you can press the Fn key and press enter to retrieve its recent logs.
When the stats are obtained, press Cmd+C to save them in the clipboard.
Use the Shift key and select the route to remove.
List all the available services, press the Cmd key to select the service you want to create. Then, the list of available plans will be listed: select the one you want to create. Then, enter the name of the service instance and Return.
Press the Shift key and select the service instance to remove.
List the services instances and press the Cmd key to select the instance you want to bind. Then, the list of applications will be listed: just select the one you want to bind with the previous selected service instance.
Use the Shift key to select a service binding to remove.
Use the Cmd key to target a space: it will be used for push operations.
To run the unit test, execute the command:
./run-unit-tests.sh
To execute the end to end tests for this workflow:
-
Install nodejs (tested with version 8.12.0). You can eventually use nvm to manage your node version.
-
Install and run mountebank on port 2525 (which is normally the default)
npm install -g mountebank
mb
Ports 3001 and 4001 must also be available since they are used to stub UAA and the Cloud Foundry API server.
- Execute the following command:
./run-e2e.sh