1 | # @atomist/sdm-pack-cloudfoundry
|
2 |
|
3 | [![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/sdm-pack-cloudfoundry/067b98ed-775a-4d34-a4a3-82837feca109)](https://app.atomist.com/workspace/T29E48P34)
|
4 | [![npm version](https://img.shields.io/npm/v/@atomist/sdm-pack-cloudfoundry.svg)](https://www.npmjs.com/package/@atomist/sdm-pack-cloudfoundry)
|
5 |
|
6 | [Atomist][atomist] software delivery machine (SDM) extension pack for
|
7 | an Atomist SDM to deploy to [Cloud Foundry][cf]. These capabilities
|
8 | will work for both open source and Pivotal Cloud Foundry.
|
9 |
|
10 | [cf]: https://www.cloudfoundry.org/ (Cloud Foundry)
|
11 |
|
12 | See the [Atomist documentation][atomist-doc] for more information on
|
13 | what SDMs are and what they can do for you using the Atomist API for
|
14 | software.
|
15 |
|
16 | [atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)
|
17 |
|
18 | ## Usage
|
19 |
|
20 | Install the dependency in your SDM project.
|
21 |
|
22 | ```
|
23 | $ npm install @atomist/sdm-pack-cloudfoundry
|
24 | ```
|
25 |
|
26 | Then use its exported method to add the functionality to your SDM in
|
27 | your machine definition.
|
28 |
|
29 | ```typescript
|
30 | import {
|
31 | SoftwareDeliveryMachine,
|
32 | SoftwareDeliveryMachineConfiguration,
|
33 | } from "@atomist/sdm";
|
34 | import {
|
35 | createSoftwareDeliveryMachine,
|
36 | } from "@atomist/sdm-core";
|
37 | import {
|
38 | CloudFoundrySupport,
|
39 | } from "@atomist/sdm-pack-cloudfoundry";
|
40 |
|
41 | export function machine(configuration: SoftwareDeliveryMachineConfiguration): SoftwareDeliveryMachine {
|
42 | const sdm = createSoftwareDeliveryMachine({
|
43 | name: "My Software Delivery Machine",
|
44 | configuration,
|
45 | });
|
46 | sdm.addExtensionPacks(SeedSupport);
|
47 | sdm.addDeployRules(
|
48 | deploy.when(IsMaven)
|
49 | .deployTo(ProductionDeploymentGoal, ProductionEndpointGoal, ProductionUndeploymentGoal)
|
50 | .using({
|
51 | deployer: new CloudFoundryBlueGreenDeployer(configuration.sdm.projectLoader),
|
52 | targeter: () => new EnvironmentCloudFoundryTarget("production"),
|
53 | }),
|
54 | );
|
55 | return sdm;
|
56 | };
|
57 | ```
|
58 |
|
59 | Finally, add the required configuration values to your client
|
60 | configuration.
|
61 |
|
62 | ```json
|
63 | {
|
64 | "sdm": {
|
65 | "cloudfoundry": {
|
66 | "user": "cf-user@atomist.com",
|
67 | "password": "cFpAsSw0rD",
|
68 | "org": "cf-organiation",
|
69 | "spaces": {
|
70 | "staging": "cf-staging-space",
|
71 | "production": "cf-production-space"
|
72 | }
|
73 | }
|
74 | }
|
75 | }
|
76 | ```
|
77 |
|
78 | ## Support
|
79 |
|
80 | General support questions should be discussed in the `#support`
|
81 | channel in the [Atomist community Slack workspace][slack].
|
82 |
|
83 | If you find a problem, please create an [issue][].
|
84 |
|
85 | [issue]: https://github.com/atomist/sdm-pack-cloudfoundry/issues
|
86 |
|
87 | ## Development
|
88 |
|
89 | You will need to install [Node.js][node] to build and test this
|
90 | project.
|
91 |
|
92 | [node]: https://nodejs.org/ (Node.js)
|
93 |
|
94 | ### Build and test
|
95 |
|
96 | Install dependencies.
|
97 |
|
98 | ```
|
99 | $ npm install
|
100 | ```
|
101 |
|
102 | Use the `build` package script to compile, test, lint, and build the
|
103 | documentation.
|
104 |
|
105 | ```
|
106 | $ npm run build
|
107 | ```
|
108 |
|
109 | ### Release
|
110 |
|
111 | Releases are handled via the [Atomist SDM][atomist-sdm]. Just press
|
112 | the 'Approve' button in the Atomist dashboard or Slack.
|
113 |
|
114 | [atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)
|
115 |
|
116 | ---
|
117 |
|
118 | Created by [Atomist][atomist].
|
119 | Need Help? [Join our Slack workspace][slack].
|
120 |
|
121 | [atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)
|
122 | [slack]: https://join.atomist.com/ (Atomist Community Slack)
|