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](https://badge.atomist.com/T29E48P34/atomist/sdm-pack-s3/728dec9b-f3d3-4363-a09c-a0a017f2074c)](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/sdm-pack-s3)
|
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 the `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 | ## Support
|
62 |
|
63 | General support questions should be discussed in the `#support`
|
64 | channel in the [Atomist community Slack workspace][slack].
|
65 |
|
66 | If you find a problem, please create an [issue][].
|
67 |
|
68 | [issue]: https://github.com/atomist/sdm-pack-s3/issues
|
69 |
|
70 | ## Development
|
71 |
|
72 | See the [Atomist developer documentation][atomist-dev] for information
|
73 | on how to write your own SDM features and automations.
|
74 |
|
75 | [atomist-dev]: https://docs.atomist.com/developer/ (Atomist Developer Documentation)
|
76 |
|
77 | ### Release
|
78 |
|
79 | Releases are handled via the [Atomist SDM][atomist-sdm]. Just press
|
80 | the 'Approve' button in the Atomist dashboard or Slack.
|
81 |
|
82 | [atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)
|
83 |
|
84 | ---
|
85 |
|
86 | Created by [Atomist][atomist].
|
87 | Need Help? [Join our Slack workspace][slack].
|
88 |
|
89 | [atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)
|
90 | [slack]: https://join.atomist.com/ (Atomist Community Slack)
|