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 |
|
10 | An extension pack for an [Atomist][atomist]
|
11 | software delivery machine (SDM). See the
|
12 | [Atomist documentation][atomist-doc] for more information on the
|
13 | concept of a software delivery machine and how to create and develop
|
14 | an SDM.
|
15 |
|
16 | Send 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 |
|
22 | In your software delivery machine project:
|
23 |
|
24 | `npm install @atomist/sdm-pack-s3`
|
25 |
|
26 | then in your `machine.ts`:
|
27 |
|
28 | ```typescript
|
29 | import { 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 |
|
40 | If you need a build to happen before the publish, call `withProjectListener()` on that goal
|
41 | and pass a [GoalProjectListenerRegistration](https://docs.atomist.com/developer/goals-more/#prepare-the-checked-out-code).
|
42 |
|
43 | Add 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 |
|
56 | See the [Developer Quick Start][atomist-quick] to jump straight to
|
57 | creating an SDM.
|
58 |
|
59 | [atomist-quick]: https://docs.atomist.com/quick-start/ (Atomist - Developer Quick Start)
|
60 |
|
61 | ## Contributing
|
62 |
|
63 | Contributions to this project from community members are encouraged
|
64 | and appreciated. Please review the [Contributing
|
65 | Guidelines](CONTRIBUTING.md) for more information. Also see the
|
66 | [Development](#development) section in this document.
|
67 |
|
68 | ## Code of conduct
|
69 |
|
70 | This project is governed by the [Code of
|
71 | Conduct](CODE_OF_CONDUCT.md). You are expected to act in accordance
|
72 | with this code by participating. Please report any unacceptable
|
73 | behavior to code-of-conduct@atomist.com.
|
74 |
|
75 | ## Documentation
|
76 |
|
77 | Please 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 |
|
84 | Follow [@atomist][atomist-twitter] and [The Composition][atomist-blog]
|
85 | blog 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 |
|
92 | General support questions should be discussed in the `#support`
|
93 | channel in the [Atomist community Slack workspace][slack].
|
94 |
|
95 | If you find a problem, please create an [issue][].
|
96 |
|
97 | [issue]: https://github.com/atomist-seeds/sdm-pack/issues
|
98 |
|
99 | ## Development
|
100 |
|
101 | You will need to install [Node.js][node] to build and test this
|
102 | project.
|
103 |
|
104 | [node]: https://nodejs.org/ (Node.js)
|
105 |
|
106 | ### Build and test
|
107 |
|
108 | Install dependencies.
|
109 |
|
110 | ```
|
111 | $ npm install
|
112 | ```
|
113 |
|
114 | Use the `build` package script to compile, test, lint, and build the
|
115 | documentation.
|
116 |
|
117 | ```
|
118 | $ npm run build
|
119 | ```
|
120 |
|
121 | ### Release
|
122 |
|
123 | Releases are handled via the [Atomist SDM][atomist-sdm]. Just press
|
124 | the '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 |
|
130 | Created by [Atomist][atomist].
|
131 | Need 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)
|