UNPKG

3.95 kBMarkdownView Raw
1<p align="center">
2 <img src="https://images.atomist.com/sdm/SDM-Logo-Dark.png">
3</p>
4
5# @atomist/sdm-pack-s3
6
7[![atomist sdm goals](http://badge.atomist.com/T29E48P34/atomist/sdm-pack-s3/24939d09-fe00-4a7a-8d52-0fc4c9672100)](https://app.atomist.com/workspace/T29E48P34)
8[![npm version](https://img.shields.io/npm/v/@atomist/sdm-pack-s3.svg)](https://www.npmjs.com/package/@atomist-seeds/sdm-pack)
9
10An extension pack for an [Atomist][atomist]
11software delivery machine (SDM). See the
12[Atomist documentation][atomist-doc] for more information on the
13concept of a software delivery machine and how to create and develop
14an SDM.
15
16Send your project's build output to S3 using this fabulous `publishToS3` goal.
17
18[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)
19
20## Using
21
22In your software delivery machine project:
23
24`npm install @atomist/sdm-pack-s3`
25
26then in your `machine.ts`:
27
28```typescript
29import { publishToS3Goal } from "@atomist/sdm-pack-s3";
30
31 const publish = publishToS3Goal({
32 bucketName: "your-bucket-name",
33 region: "us-west-2", // use your region
34 filesToPublish: ["site/**/*.html", "more/files/to/publish"],
35 pathTranslation: (filepath, inv) => filepath, // rearrange files if necessary
36 pathToIndex: "site/index.html", // index file in your project
37 });
38```
39
40If you need a build to happen before the publish, call `withProjectListener()` on that goal
41and pass a [GoalProjectListenerRegistration](https://docs.atomist.com/developer/goals-more/#prepare-the-checked-out-code).
42
43Add this publish goal to one of your goal sets.
44
45```typescript
46 const publishGoals = goals("publish static site to S3")
47 .plan(publish);
48
49 sdm.withPushRules(
50 whenPushSatisfies(requestsUploadToS3).setGoals(publishGoals),
51 );
52```
53
54## Getting started
55
56See the [Developer Quick Start][atomist-quick] to jump straight to
57creating an SDM.
58
59[atomist-quick]: https://docs.atomist.com/quick-start/ (Atomist - Developer Quick Start)
60
61## Contributing
62
63Contributions to this project from community members are encouraged
64and appreciated. Please review the [Contributing
65Guidelines](CONTRIBUTING.md) for more information. Also see the
66[Development](#development) section in this document.
67
68## Code of conduct
69
70This project is governed by the [Code of
71Conduct](CODE_OF_CONDUCT.md). You are expected to act in accordance
72with this code by participating. Please report any unacceptable
73behavior to code-of-conduct@atomist.com.
74
75## Documentation
76
77Please see [docs.atomist.com][atomist-doc] for
78[developer][atomist-doc-sdm] documentation.
79
80[atomist-doc-sdm]: https://docs.atomist.com/developer/sdm/ (Atomist Documentation - SDM Developer)
81
82## Connect
83
84Follow [@atomist][atomist-twitter] and [The Composition][atomist-blog]
85blog related to SDM.
86
87[atomist-twitter]: https://twitter.com/atomist (Atomist on Twitter)
88[atomist-blog]: https://the-composition.com/ (The Composition - The Official Atomist Blog)
89
90## Support
91
92General support questions should be discussed in the `#support`
93channel in the [Atomist community Slack workspace][slack].
94
95If you find a problem, please create an [issue][].
96
97[issue]: https://github.com/atomist-seeds/sdm-pack/issues
98
99## Development
100
101You will need to install [Node.js][node] to build and test this
102project.
103
104[node]: https://nodejs.org/ (Node.js)
105
106### Build and test
107
108Install dependencies.
109
110```
111$ npm install
112```
113
114Use the `build` package script to compile, test, lint, and build the
115documentation.
116
117```
118$ npm run build
119```
120
121### Release
122
123Releases are handled via the [Atomist SDM][atomist-sdm]. Just press
124the 'Approve' button in the Atomist dashboard or Slack.
125
126[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)
127
128---
129
130Created by [Atomist][atomist].
131Need Help? [Join our Slack workspace][slack].
132
133[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)
134[slack]: https://join.atomist.com/ (Atomist Community Slack)