Use main branch to simpyfy config
This commit is contained in:
+19
-13
@@ -29,27 +29,28 @@ missing). Everything else runs inside containers.
|
||||
| 3000 | Gitea | https://astro-git.isl-dev.grid.cyfronet.pl (ingress vhost) |
|
||||
| 8080 | portal (nginx, static) | https://astro.isl-dev.grid.cyfronet.pl (ingress vhost) |
|
||||
|
||||
## Switch an existing demo to `simple`
|
||||
## Publish the simplified portal from `main`
|
||||
|
||||
1. In a checkout of `ctao/content`, create a `simple` branch from the existing
|
||||
content branch. Copy `sample-content/pages/*.md` and
|
||||
1. In a checkout of `ctao/content`, switch to `main`. Copy the missing
|
||||
Example files from `sample-content/pages/` and
|
||||
`sample-content/uploads/hero.jpg` from this code repository into its root
|
||||
`pages/` and `uploads/` directories, then commit the seed files. Existing
|
||||
`pages/` and `uploads/` directories, then commit the seed files. Preserve
|
||||
any existing editorial versions of these files. Existing
|
||||
news or other page files can remain in the content history; this portal
|
||||
loads only the four Example files.
|
||||
2. Push the content branch to Gitea as `ctao/content:simple`, and the code
|
||||
branch as `ctao/portal:simple`. These are separate pushes; Bitbucket is
|
||||
2. Push the content branch to Gitea as `ctao/content:main`, and the code
|
||||
branch as `ctao/portal:main`. These are separate pushes; Bitbucket is
|
||||
not the deployment remote.
|
||||
3. Copy the updated `build.sh` to `~/ctao-portal-demo/bin/build.sh` and the
|
||||
updated `ctao-portal-build.service` to `~/.config/systemd/user/`. Reload
|
||||
systemd with `systemctl --user daemon-reload`. The service explicitly sets
|
||||
`CODE_BRANCH=simple` and `CONTENT_BRANCH=simple`; the script defaults agree.
|
||||
`CODE_BRANCH=main` and `CONTENT_BRANCH=main`; the script defaults agree.
|
||||
4. Start the build service or let its timer run. It overlays `pages/` and
|
||||
`uploads/`, clears the previous news overlay, and runs `npm run check`
|
||||
before the atomic release switch. Missing Example pages fail the build.
|
||||
5. Verify the four `/example/…/` pages and empty `/news/`. Sign in at `/admin/`,
|
||||
save an Example title, and check that a commit appears on
|
||||
`ctao/content:simple` and the rebuilt page reflects it.
|
||||
`ctao/content:main` and the rebuilt page reflects it.
|
||||
|
||||
The OAuth client and public portal origin stay the same. Sveltia's
|
||||
`backend.branch` in `public/admin/config.yml` must always match
|
||||
@@ -57,8 +58,13 @@ The OAuth client and public portal origin stay the same. Sveltia's
|
||||
environment variable is no longer used. For a separate preview hostname,
|
||||
update the site origin, OAuth redirect, and Gitea CORS together.
|
||||
|
||||
To roll back, restore the previous deployed release and the previous worker
|
||||
script/service configuration. The original content `main` branch is retained.
|
||||
To undo the simplification in shared code history, use
|
||||
`git revert -m 1 <simplification-merge-commit>` on `main` and publish the
|
||||
resulting commit. The previous portal code is also preserved at `0772462`.
|
||||
For an immediate deployment rollback, restore the previous release and worker
|
||||
script/service configuration. Content has its own history: reverting a code
|
||||
commit does not revert CMS edits. Keep the old content files available if
|
||||
the previous portal may be restored.
|
||||
|
||||
## Install (each step reviewed before running; [W] = writes to the machine)
|
||||
|
||||
@@ -84,12 +90,12 @@ script/service configuration. The original content `main` branch is retained.
|
||||
password never lands in a file or shell history:
|
||||
`podman exec -it ctao-demo-gitea gitea admin user create --admin --username <you> --email <you@…> --random-password`
|
||||
7. **[W]** In the Gitea UI: create org `ctao` with repos `portal` and
|
||||
`content` (both public read). Seed the content `simple` branch with
|
||||
`content` (both public read). Seed the content `main` branch with
|
||||
`sample-content/pages/` and `sample-content/uploads/` as described above.
|
||||
Then, from your workstation, push both over
|
||||
the vhost with a repo-scoped token:
|
||||
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/portal.git simple`
|
||||
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/content.git simple`
|
||||
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/portal.git main`
|
||||
`git push https://<user>:<token>@astro-git.isl-dev.grid.cyfronet.pl/ctao/content.git main`
|
||||
8. **[W]** `systemctl --user enable --now ctao-portal-build.timer`. The first run
|
||||
clones + `npm ci` + builds (minutes); later runs are seconds. Wait until
|
||||
`journalctl --user -u ctao-portal-build -n 5` shows `published <sha>`
|
||||
|
||||
Reference in New Issue
Block a user