You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But you may wish to populate this script with some functioncalls to clean up various common artifacts produced by the transition. Look at the `.R` scripts in the [`carpentries-incubator/`](https://github.com/carpentries/lesson-transition/tree/main/carpentries-incubator), [`datacarpentry`](https://github.com/carpentries/lesson-transition/tree/main/datacarpentry), [`librarycarpentry`](https://github.com/carpentries/lesson-transition/tree/main/librarycarpentry), and [`swcarpentry`](https://github.com/carpentries/lesson-transition/tree/main/swcarpentry) directories of the `lesson-transition` repository for inspiration.
91
+
But you may wish to populate this script with some functioncalls to clean up various common artifacts produced by the transition, or to preserve any [custom workflows](#custom-workflows) you have added to your lesson repository. Look at the `.R` scripts in the [`carpentries-incubator/`](https://github.com/carpentries/lesson-transition/tree/main/carpentries-incubator), [`datacarpentry`](https://github.com/carpentries/lesson-transition/tree/main/datacarpentry), [`librarycarpentry`](https://github.com/carpentries/lesson-transition/tree/main/librarycarpentry), and [`swcarpentry`](https://github.com/carpentries/lesson-transition/tree/main/swcarpentry) directories of the `lesson-transition` repository for inspiration.
92
92
93
93
### 3. Run the transition tool{#transition}
94
94
@@ -125,7 +125,6 @@ Try running the process step-by-step:
125
125
if [ !-s ../$LESSONNAME-invalid.hash ];then rm ../$LESSONNAME-invalid.hash;fi
126
126
```
127
127
2. Adjust lesson config file
128
-
* record lesson creation date in config.yaml: run `git log` and hit <kbd>Shift+G</kbd> to jump to end of file, note down the date when the first commit was made. Then, using your favourite text editor, open `config.yaml` and modify the `created` field by replacing `~` with this creation date in YYYY-MM-DD format.
129
128
***Option 1 (manual):** Using your favourite text editor, open the `config.yaml` file and remove the lines setting the `workbench-beta`, `analytics`, `lang`, and `url` parameters.
130
129
***Option 2 (using regular expressions):** In Bash, run:
131
130
@@ -138,6 +137,14 @@ Try running the process step-by-step:
138
137
git remote set-url origin ADDRESS-OF-YOUR-REMOTE # replace ADDRESS-OF-YOUR-REMOTE to set origin to the correct address for your lesson repository on GitHub
139
138
```
140
139
140
+
::: callout
141
+
142
+
### Custom workflow files{#custom-workflows}
143
+
The contents of the `.github` folder are not preserved by the transition tool. If you had any custom workflow files in your lesson repository before migrating to the new infrastructure, you will need to add those back into `.github/workflows/` at this point then commit the changes. (You could also modify the Rscript for your lesson transition to do this for you, and repeat the transition process to include it.)
144
+
145
+
:::
146
+
147
+
141
148
#### Build and check your transitioned lesson
142
149
At this stage, the `release/carpentries-incubator/YOUR-LESSON-NAME/` directory should contain a transitioned version of your lesson.
143
150
To check how things are looking, [install the Workbench tools foryour system](index.html#installation), then open Rin this directory and run `sandpaper::serve()`.
@@ -146,7 +153,6 @@ To check how things are looking, [install the Workbench tools for your system](i
146
153
While previewing this transitioned lesson site, you might see some problems in the content of your lesson site that appeared during the migration. Liquid comments (delineated by `{% comment %}` and `{% endcomment %}` tags) are one commonly-encountered artifact. Another is broken links to the lesson setup instructions, which are found at `index.html#setup`in a Workbench site. These can be fixed by editing the lesson after transition, but for a cleaner commit history on your lesson you might wish to delete the transitioned lesson directory (inside the `release` folder), modify the R script for your lesson to handle those issues, and re-run the transition tool. (See [_Create an Rscript for your lesson_](#Rscript) above.)
147
154
148
155
#### If something goes wrong
149
-
150
156
To go back to the start and try again, delete the directory for your lesson within the `release/` directory, i.e. `rm -rf release/carpentries-incubator/YOUR-LESSON-NAME`.
151
157
152
158
If the transition tool ran successfully but your lesson build fails, this is usually due to customisations made to the lesson that fall outside what the transition tool expected to find.
@@ -160,17 +166,19 @@ If something goes wrong and you cannot debug the problem on your own, post a mes
160
166
**We recommend that you try these steps out on a fork of your lesson first**, so that you can be certain everything works before making permanent changes to your main lesson repository.
161
167
:::
162
168
163
-
1. Commit the changes you made to the lesson config file:
169
+
1. Record your lesson creation date in config.yaml: run `git log` and hit <kbd>Shift+G</kbd> to jump to end of file, note down the date when the first commit was made. Then, using your favourite text editor, open `config.yaml` and modify the `created` field by replacing `~` with this creation date in YYYY-MM-DD format.
170
+
171
+
2. Commit the changes you made to the lesson config file:
164
172
165
173
```bash
166
174
git add config.yaml
167
175
git commit -m 'complete configuration of Workbench lesson site'
168
176
```
169
177
170
-
2. Rename the branches of your project:
178
+
3. Rename the branches of your project:
171
179
- On your GitHub repository, rename the `gh-pages` branch to `legacy/gh-pages` (if `main` is your default branch, also rename that to `legacy/main`).
172
180
- Branches can be renamed by going to the list of all branches on your repository (add `/branches/all` to the end of the URL for your GitHub repository e.g. <https://github.com/datacarpentry/image-processing/branches/all>) and selecting the pencil icon button next to the relevant branch in that listing.
173
-
3. In Bash on your local system (make sure you are working in the root of the `release/carpentries-incubator/YOUR-LESSON-NAME` directory), run the following commands (please read the comments that annotate these commands and note that **we strongly recommend that you execute these one-at-a-time!**):
181
+
4. In Bash on your local system (make sure you are working in the root of the `release/carpentries-incubator/YOUR-LESSON-NAME` directory), run the following commands (please read the comments that annotate these commands and note that **we strongly recommend that you execute these one-at-a-time!**):
174
182
175
183
```bash
176
184
git remote -v # check the names and addresses of your remote repositories: if you are testing on a fork and it is not listed here, add it with 'git remote add' https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emaddem
@@ -185,14 +193,14 @@ If something goes wrong and you cannot debug the problem on your own, post a mes
185
193
git push --force origin HEAD:gh-pages
186
194
```
187
195
188
-
4. If everything has gone well up to this point, it is time to go back to the `main` branch and force push its contents to GitHub:
196
+
5. If everything has gone well up to this point, it is time to go back to the `main` branch and force push its contents to GitHub:
189
197
190
198
```bash
191
199
git switch main
192
200
git push --force --set-upstream origin main # force push the transitioned main branch to your GitHub repository
193
201
```
194
202
195
-
5. On your GitHub repository:
203
+
6. On your GitHub repository:
196
204
- set the default branch to `main` (in Settings->General, click the button with two arrows next to the name of the default branch)
197
205
- in Settings->Branches, add rules to protect the `main` branch (require pull requests) and lock `legacy/*`
198
206
- make sure that your lesson site is being served with GitHub Pages from the root folder of the gh-pages branch (in Settings->Pages, under _Build and deployment_, ensure that `gh-pages` is selected with the dropdown under _Branch_ and that `/ (root)` is the folder selected, then hit the _Save_ button)
0 commit comments