Skip to content

Commit 3f16e07

Browse files
Merge pull request #1 from infinitered/new-orb
create orb
2 parents b07d26d + 7b777af commit 3f16e07

14 files changed

+853
-75
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ workflows:
2929
# dev:${CIRCLE_SHA1:0:7} version of your orb
3030
- orb-tools/trigger-integration-tests-workflow:
3131
name: trigger-integration-dev
32-
context: <publishing-context>
32+
context: orb-publishing
3333
requires:
3434
- orb-tools/publish-dev
3535
lint-pack:

README.md

Lines changed: 143 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ repository.
3434

3535
## Parameters
3636

37-
- `git_email` (String): Email for Git configuration.
38-
- `git_username` (String): Username for Git configuration.
39-
- `target_repo` (String): The GitHub repository URL where the documentation resides.
40-
- `description` (String): Short description of the package used in indexes etc. (Default: "")
41-
- `label` (String): The label that will appear in the sidebar. (Default: "package-name")
42-
- `project_name` (String): The path where documents will be located on the docs site. (Default: "")
43-
- `source_docs_path` (String): The path to the source docs directory. (Default: "./docs")
37+
| Parameter | Type | Description |
38+
|-------------------|--------|-------------------------------------------------------------------------------------------------|
39+
| `git_email` | String | Email for Git configuration. |
40+
| `git_username` | String | Username for Git configuration. |
41+
| `target_repo` | String | The GitHub repository URL where the documentation resides. |
42+
| `description` | String | Short description of the package used in indexes etc. Default is an empty string. |
43+
| `label` | String | The label that will appear in the sidebar of the docs site. Default is "package-name". |
44+
| `project_name` | String | The path where these documents will be located on the docs site. Default is an empty string. |
45+
| `source_docs_path`| String | The path to the directory containing the source markdown files. Default is "./docs". |
4446

4547
## Basic Example
4648

@@ -64,3 +66,137 @@ workflows:
6466
project_name: "example-package"
6567
source_docs_path: "./example-docs"
6668
```
69+
70+
### Handling Static Files
71+
72+
In your source repository, static files such as images should be placed in a directory named `_static_` under
73+
your `docs` folder. The directory structure will look like this when you run the `tree` command:
74+
75+
```plaintext
76+
docs/
77+
├── part-one.md
78+
├── part-two.md
79+
└── _static_
80+
└── image.png
81+
```
82+
83+
During the documentation merge process, the orb will automatically move the contents of `_static_` to the appropriate
84+
location in the target repository.
85+
86+
#### Directory Structure Before and After Merge
87+
88+
**Before Merge:**
89+
90+
```plaintext
91+
source-repo/
92+
└── docs/
93+
│ ├── part-one.md
94+
│ └── part-two.md
95+
└── _static_/
96+
└── image.png
97+
```
98+
**After Merge:**
99+
100+
```
101+
target-repo/
102+
├── docs/
103+
│ └── <<project-name>>
104+
│ ├── part-one.md
105+
│ └── part-two.md
106+
└── static/
107+
└── <<project-name>>
108+
└── image.png
109+
```
110+
111+
By following this convention, you ensure that all static files and documents are correctly placed in the target
112+
repository, under `docs/<<project-name>>` for documents and `static/<<project-name>>` for static files.
113+
114+
## Commands
115+
116+
### `clone_target`
117+
118+
#### Description
119+
120+
Clones the target documentation repository to `~/target_repo`.
121+
122+
#### Parameters
123+
124+
| Parameter | Type | Description |
125+
|-------------|--------|-------------------------------------------------------------------|
126+
| `target_repo`| String| The GitHub repository URL where the documentation resides. |
127+
128+
---
129+
130+
### `commit_and_push`
131+
132+
#### Description
133+
134+
Commits and pushes the updated documentation to the target repository.
135+
136+
#### Parameters
137+
138+
None
139+
140+
---
141+
142+
### `copy_docs_to_target`
143+
144+
#### Description
145+
146+
Clones a Docusaurus repo and adds the docs from the current repo to the target repository.
147+
148+
#### Parameters
149+
150+
| Parameter | Type | Description |
151+
|-----------------|--------|-----------------------------------------------------------------------------|
152+
| `description` | String | Short description of the package. Default is an empty string. |
153+
| `label` | String | The label for the sidebar. Default is "package-name". |
154+
| `project_name` | String | The path where the documents will be located on the docs site. |
155+
| `source_docs_path`| String | The path to the directory containing the source markdown files. Default is "./docs".|
156+
| `target_docs_path`| String | The path to the directory in the target repo where docs will be copied. Default is "./docs".|
157+
158+
---
159+
160+
### `install_git`
161+
162+
#### Description
163+
164+
Installs Git on the CI environment.
165+
166+
#### Parameters
167+
168+
None
169+
170+
---
171+
172+
### `setup_git`
173+
174+
#### Description
175+
176+
Configures Git for commit and push operations.
177+
178+
#### Parameters
179+
180+
| Parameter | Type | Description |
181+
|-------------|--------|-------------------------|
182+
| `git_email` | String | Email for Git configuration.|
183+
| `git_username`| String | Username for Git configuration.|
184+
185+
---
186+
187+
### `validate_params`
188+
189+
#### Description
190+
191+
Validates that all required parameters are set.
192+
193+
#### Parameters
194+
195+
| Parameter | Type | Description |
196+
|-----------------|--------|-----------------------------------------------------------------------------|
197+
| `description` | String | Short description of the package. |
198+
| `git_email` | String | Email for Git configuration. |
199+
| `git_username` | String | Username for Git configuration. |
200+
| `label` | String | The label for the sidebar. |
201+
| `project_name` | String | The path where the documents will be located on the docs site. |
202+
| `target_repo` | String | The GitHub repository URL where the documentation resides. |

0 commit comments

Comments
 (0)