Commit Graph

30 Commits

Author SHA1 Message Date
David Taylor
80b9c280ba
DEV: Switch to pnpm for JS dependencies (#28671)
This will bring significant improvements to install speed & storage requirements. For information on how it may affect you, see https://meta.discourse.org/t/324521

This commit:
- removes the `yarn.lock` and replaces with `pnpm-lock.yaml`
- updates workspaces to pnpm format
- adjusts package dependencies to work with pnpm's stricter resolution strategy
- updates Rails app to load modules from more specific node_modules directories
- adds a `.pnpmfile` which automatically cleans up old yarn-managed `node_modules` directories
- updates various scripts to call `pnpm` instead of `yarn`
- updates patches to use pnpm's native patch system instead of patch-package
- adds a patch for licensee to support pnpm
2024-09-03 10:51:07 +01:00
Loïc Guitaut
484954ec4c DEV: Add early support for aarch64 dev env
This patch allows running system specs on an aarch64 Linux system
(typically our `discourse_dev` docker image).
As Chrome isn’t available for the aarch64 architecture (yet), we have to
rely on Firefox instead. This has some drawbacks like not being able to
access the browser logs like we do with the Chrome webdriver.
2024-01-30 15:50:44 +01:00
Alan Guo Xiang Tan
39aa70d7cb
FIX: Run bundle install before migration in d/boot_dev (#24509)
48c0cd5b2a broke `d/boot_dev` when used
with `--init` because `rake db:migrate` will fail as it requires `bundle
install` to run first
2023-11-22 16:08:28 +08:00
Alan Guo Xiang Tan
48c0cd5b2a
DEV: Always run bundle and yarn install while running d/boot_dev (#24453)
Why this change?

Before this change, running `d/boot_dev` does not run `bundle install`
and `yarn install` unless the `--init` option is specified. However,
this does not make sense because the user will end up having to run
`d/bundle install` and `d/yarn install` manually after if the `--init`
option is not used. We can simplify this by just always running `bundle
install` and `yarn install` whenever `d/boot_dev` is used.

What does this change do?

This change changes the `d/boot_dev` script to always run `bundle
install` and `yarn install`.
2023-11-20 10:04:55 +08:00
dsims
6415bab455
DEV: Run yarn install before db migrations in d/boot_dev (#20866)
Yarn dependencies need to be present before booting Rails
2023-04-05 18:49:50 +01:00
Arpit Jalan
016524e244
DEV: use mailhog in our docker dev environment (#14549) 2021-10-08 11:10:46 +05:30
Jacob Mischka
f9247dabcc
Replace -depth -> -maxdepth in boot_dev (#14046)
The `-depth` flag is incorrect on Linux, it does not take an argument
and causes an error and results in no plugins ever being found.

Copied from `man find`:

```
The global options occur after the list of start points, and so are not the same kind of option as -L, for example.

       -d     A synonym for -depth, for compatibility with FreeBSD, NetBSD, MacOS X and OpenBSD.

       -depth Process each directory's contents before the directory itself.  The -delete action also implies -depth.

       ...

       -maxdepth levels
              Descend at most levels (a non-negative integer) levels of directories below the starting-points.  Using -maxdepth 0  means
              only apply the tests and actions to the starting-points themselves.
```
2021-08-16 13:28:54 +08:00
David Taylor
78f9d47ab1 DEV: Add non-x86_64 warning to d/boot_dev
Running a development environment using Docker's qemu architecture emulation is currently not possible because `inotify` is not supported: https://github.com/docker/for-mac/issues/5321
2021-05-21 16:51:10 +01:00
David Taylor
73050d9049 DEV: Update docker development binstubs
- Add `d/ember-cli`, and publish port 4200
- Remove `d/sidekiq`. Sidekiq is now started with the rails server
- Move all `docker exec` logic into a single place, so we have one place to set environment variable pass-throughs
- Use `exec` for all bash scripts, so that return statuses are passed back correctly
- Avoid using `bin/bash -c` unnecessarily, because it makes escaping arguments difficult
2021-05-21 16:51:10 +01:00
David Taylor
ab23412113 DEV: Only mount top-level plugin symlinks
Sometimes plugins directories will end up with other symlinks (e.g. inside node_modules folders). This logic does not work with deeply nested symlinks, and they are unlikely to be necessary for the plugin to work. Therefore we should only look for symlinks in the top-level of the `plugins` directory
2021-05-21 16:51:10 +01:00
Alessandro Bertacco
dc2f5064e2
DEV: support for relative symlinks for plugins in docker dev (#10955)
These changes gives the possibility to use relative symlinks for plugins. Previously only absolute symlinks was supported.
2020-10-21 09:39:53 +11:00
Sam Saffron
d8412f409a DEV: resolve symlinks in docker dev
symlinks where not fully resolved leading to docker not booting when you
had symlinks in the plugins directory pointing at relative paths.
2020-01-13 10:33:34 +11:00
Sam Saffron
ff33899323 FEATURE: allow publishing docker dev either locally or net wide
Previously we had no control over how internal ports in the containter got
published.

Following UNICORN_BIND_ALL=true setting this broke docker dev env and exposed
this weakness.

The new `d/boot_dev` will only export on localhost, if you wish to export
network with use `d/boot_dev -p`
2019-11-04 12:51:35 +11:00
Kyle Zhao
2fbafd077c DEV: Mount plugin symlinks to dev docker container (#8002)
When developing using docker, in order to support symlinks in the
`plugins/` directory, this reads the symlinks' values and mounts them to
the dev docker container.
2019-08-14 18:13:01 +10:00
Sam
0e6d0b0f8e FEATURE: always update docker image for dev prior to launching
Previously people could stay stuck on old dev images, this ensures they
are always on latest when booting
2019-02-18 13:12:00 +11:00
Sam
fef45789c4 DEV: improve docker dev environment
- pass USER=discourse which is not passed in from docker exec (improves backup restore)

- add unicorn script and unicorn support (expose port 9292)
2018-12-31 10:45:08 +11:00
mmayoNR
a900c9bf93 pass env vars into local dev image (#6212) 2018-08-01 16:44:27 +10:00
Kyle Zhao
3e7638e3f5 Improve docker performance with delegated mount flag (#5760) 2018-04-16 10:56:35 +02:00
Sam
32d881399f avoid getting duplicates in docker dev paths 2017-12-15 10:11:40 +11:00
Sam
e0f660d9a9 lets crash out on error 2017-12-14 18:03:17 +11:00
Sam
e7c2ad41ca Move discourse dev data out of tmp
Fix watch for restart so it works with puma
2017-05-18 11:36:24 -04:00
Rafael dos Santos Silva
2e152f4d39 FIX: Use latest docker image for dev 2017-05-16 12:05:11 -03:00
ckeboss
6bfe92e19e Update boot_dev 2017-04-12 10:33:56 -07:00
ckeboss
513f1f065a Wrap directory names in quotes
When there are spaces in any of the directories referenced, bash will error out. This wraps those items in quotes to allow bash to parse the path names properly.
2017-04-12 09:41:23 -07:00
Sam
97e2a614c8 add wrappers for mailcatcher and sidekiq
add symlink to simplify invoking docker commands `d/rake`
2016-12-13 09:05:45 +11:00
Sam
4b0f013edf migrate test as well 2016-12-12 17:47:24 +11:00
Sam
1cbb8dc9b7 improve dev process 2016-12-12 17:39:20 +11:00
Jared Reisinger
b7ea3de7bb Switch from hard-coded image version to 'latest' 2016-09-22 12:58:43 -07:00
Jared Reisinger
4db3f53c87 Improve the "develop inside Docker" experience
This PR is intended to work in concert with the discourse_docker changes
in https://github.com/discourse/discourse_docker/pull/292.  I have used
those changes to build a local "discourse_dev" image, and then
_**these**_ changes to easily spin up and work on Discourse and plugin
functionality.  It's working well for me, but of course YMMV.

Add `--init` and `--patch` options to bin/docker/boot_dev to make it
easier to spin up a container running Discourse out of a development
directory.

Add `bin/docker/README.md` to explain how to go about using the docker
command-line tools.

Tweak the Docker command-line tools to use the `-u` option to specify
user rather than changing to the user "inside" the container via `chpst`
(This way, we don't have to explicitly specify the HOME environment
variable, either.)

Add `bin/docker/shell` command to make it easy to jump inside the
running container.
2016-09-20 15:35:50 -07:00
Sam
2c4f290786 docker dev binaries 2015-11-02 13:33:08 +11:00