Commit Graph

7 Commits

Author SHA1 Message Date
Chris Raible
30fc2f3d50
Added ps dependency to Dockerfile (#21471)
no issue

- When stopping `yarn dev` with ctrl+c in the dev container, you'd get
an error because the container doens't have `ps` installed, which is
used by node under the hood. Adding this dependency fixed the error so
`yarn dev` (and other commands) exit cleanly
2024-10-30 11:56:10 -07:00
Chris Raible
d4d45de3de
Added github-cli and some zsh plugins to dev container (#21460)
no issue

- The Dev Container didn't have the Github CLI installed, so this adds
that using Dev Container
"[features](https://containers.dev/implementors/features/)"
- It also adds oh-my-zsh and a few plugins that are nice to have when
developing.
2024-10-29 19:22:58 -07:00
Chris Raible
eb9483abb6
Fixed git remote configuration in dev container (#21459)
no issue

- When creating a dev container, the onCreateCommand script will try to
setup the git remotes according to the environment variables defined for
e.g. `$GHOST_UPSTREAM`. There was a bug that caused the `origin` remote
to successfully be renamed to `$GHOST_UPSTREAM`, but the `origin` remote
was not being created successfully on the first try. This commit fixes
that bug.
2024-10-29 15:21:46 -07:00
Chris Raible
1d24b2c8c0
Added configuration of git remotes to dev container setup (#21458)
no issue

- Added function to Dev Container onCreateCommand to setup git remotes
when creating the Dev Container
- If `$GHOST_UPSTREAM` is set, it will rename the default `origin`
remote to its value
- It will also update the remotes for the submodules, otherwise `yarn
main` will fail
- If `$GHOST_FORK_REMOTE_URL` is set, it will add it as `origin`, or the
value of `$GHOST_FORK_REMOTE_NAME` if set.
- If `$GHOST_FORCE_SSH` is set to `true`, it will change all remotes
URL's to use ssh instead of https
2024-10-29 14:52:44 -07:00
Chris Raible
71fb9f8b34
Converted dev container's onCreateCommand to JavaScript (#21457)
no issue

- The onCreateCommand was previously a bash script, which made it a bit
more challenging to read and make changes to it. This commit converts it
to JavaScript so it will be easier to make updates to it.
2024-10-29 13:03:49 -07:00
Chris Raible
d0bf80b718
Added from address to Dev Container's auto configuration (#21442)
refs
https://linear.app/ghost/issue/ENG-1686/mail-auto-configuration-doesnt-work

- Previously the `mail` configuration that is auto-generated didn't work
because the `from` address wasn't being set, and requests were
consequently failing due to some Mailgun internal validation.
- This change requires the `MAILGUN_FROM_ADDRESS` environment variable
to be set for it to automatically configure the `mail` block, and if it
is, it adds it as `mail.from`. Now with all three of
`MAILGUN_SMTP_AUTH`, `MAILGUN_SMTP_PASS` and `MAILGUN_FROM_ADDRESS`
setup, transactional emails work out of the box in the Dev Container.
2024-10-28 16:14:04 -07:00
Chris Raible
af0f26c75f
Added Dev Container setup (#21279)
no issue

- Dev Containers let you work on Ghost in a consistent, isolated
environment with all the necessary development dependencies
pre-installed. VSCode (or Cursor) can effectively run _inside_ the
container, providing a local quality development environment while
working in a well-defined, isolated environment.
- For now the default setup only works with "Clone repository in
Container Volume" or "Clone PR in Container Volume" — this allows for a
super quick and simple setup. We can also introduce another
configuration to allow opening an existing local checkout in a Dev
Container, but that's not quite ready yet.
- This PR also added the `yarn clean:hard` command which: deletes all
node_modules, cleans the yarn cache, and cleans the NX cache. This will
be necessary for opening a local checkout in a Dev Container.
- To learn more about Dev Containers, read this guide from VSCode:
https://code.visualstudio.com/docs/devcontainers/containers#_personalizing-with-dotfile-repositories

---------

Co-authored-by: Joe Grigg <joe@ghost.org>
Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-24 11:15:08 -07:00