Skip to content

Commit 765e016

Browse files
Added build instructions to README. Changed install-protoc script to clean up after itself.
1 parent 112f5f7 commit 765e016

File tree

2 files changed

+88
-3
lines changed

2 files changed

+88
-3
lines changed

README.md

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,98 @@ The library can be used by Java, Groovy, and Scala apps to interact with a Cloud
1717

1818
## cloudfoundry-maven-plugin
1919

20-
The Cloud Foundry Maven plugin is a plugin for the [Maven build tool](http://maven.apache.org/) that allows you to deploy and manage applications with Maven goals.
20+
The Cloud Foundry Maven plugin is a plugin for the [Maven build tool](http://maven.apache.org/) that allows you to
21+
deploy and manage applications with Maven goals.
2122

2223
[Read more](./cloudfoundry-maven-plugin)
2324

2425
## cloudfoundry-gradle-plugin
2526

26-
The Cloud Foundry Gradle plugin is a plugin for the [Gradle build tool](http://www.gradle.org/) that allows you to deploy and manage applications with Gradle tasks.
27+
The Cloud Foundry Gradle plugin is a plugin for the [Gradle build tool](http://www.gradle.org/) that allows you to
28+
deploy and manage applications with Gradle tasks.
2729

2830
[Read more](./cloudfoundry-gradle-plugin)
2931

32+
# Building
33+
34+
## Prerequisites
35+
36+
### Apache Maven
37+
38+
The `cloudfoundry-client-lib` and `cloudfoundry-maven-plugin` components are built with [Apache Maven](http://maven.apache.org/).
39+
40+
### Gradle
41+
42+
The `cloudfoundry-gradle-plugin` component is built with [Gradle](http://www.gradle.org/).
43+
44+
### Protocol Buffer compiler
45+
46+
The `cloudfoundry-client-lib` uses Protocol Buffers to get logs from the Cloud Foundry [loggregator](https://github.com/cloudfoundry/loggregator)
47+
component. A `protoc` Protocol Buffer compiler is required at build time to compile message specifications. `protoc` version
48+
2.5.0 is required.
49+
50+
On Linux with `apt`, run the [install-protoc.sh](./bin/install-protoc.sh) script in this repository to compile `protoc` 2.5.0 from source.
51+
52+
On OSX with [homebrew](http://brew.sh/), install `protoc` with this command:
53+
54+
```
55+
$ brew install protobuf
56+
```
57+
58+
On Windows, download the [`protoc` binary](https://code.google.com/p/protobuf/downloads/detail?name=protoc-2.5.0-win32.zip),
59+
unzip it, and put `protoc.exe` in the path.
60+
61+
After installing, run this command and check the output to make sure it is similar to the following:
62+
63+
```
64+
$ protoc --version
65+
libprotoc 2.5.0
66+
```
67+
68+
## Compiling and Packaging
69+
70+
To build `cloudfoundry-client-lib` and `cloudfoundry-maven-plugin`, run the following command from the project root directory:
71+
72+
```
73+
$ mvn clean install
74+
```
75+
76+
To build `cloudfoundry-gradle-plugin`, run the following command from the `cloudfoundry-gradle-plugin` sub-directory after
77+
building `cloudfoundry-client-lib`:
78+
79+
```
80+
$ gradle clean install
81+
```
82+
83+
## Running Integration Tests
84+
85+
`cloudfoundry-client-lib` has an extensive set of integration tests which run against a Cloud Foundry service. To execute the
86+
integration tests, run the following command from the project root directory:
87+
88+
```
89+
$ mvn -P integration-test clean install -Dccng.target=<endpoint> -Dccng.email=<username> -Dccng.passwd=<password> -Dccng.org=<organization> -Dccng.space=<space>
90+
```
91+
92+
Following is a complete list of the `-D` parameters that can be passed to the integration test:
93+
94+
| Parameter | Description | Required/Optional |
95+
| --------- | ----------- | ----------------- |
96+
| ccng.target | target Cloud Foundry endpoint (e.g. https://api.run.pivotal.io) | required |
97+
| ccng.email | Cloud Foundry username | required |
98+
| ccng.passwd | Cloud Foundry password | required |
99+
| ccng.org | Cloud Foundry organization to run tests against | required |
100+
| ccng.space | Cloud Foundry space to run tests against | required |
101+
| ccng.ssl | trust self-signed certificates from target endpoint | optional, default is `false` |
102+
| vcap.mysql.label | label of a MySQL service that can be created | optional, default is `cleardb` |
103+
| vcap.mysql.plan | plan of a MySQL service that can be created | optional, default is `spark` |
104+
| http.proxyHost | host name of an HTTP proxy | optional |
105+
| http.proxyPort | port of an HTTP proxy | optional |
106+
107+
**Important**
108+
109+
Integration tests should be run against an empty Cloud Foundry space. The integration tests are destructive,
110+
and will delete any apps, services, routes, and domains existing in the target space.
111+
30112
# Cloud Foundry Resources
31113

32114
_Cloud Foundry Open Source Platform as a Service_

bin/install-protoc.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#!/bin/sh
12
sudo apt-get -y install build-essential
23
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
34
tar xvfz protobuf-2.5.0.tar.gz
45
cd protobuf-2.5.0
56
./configure --prefix=/usr
67
make
78
sudo make install
8-
protoc --version
9+
cd ..
10+
rm protobuf-2.5.0.tar.gz
11+
rm -rf protobuf-2.5.0

0 commit comments

Comments
 (0)