-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
94 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Remove rsync from parcel devcontainer | ||
|
||
This migration is **only relevant** if you're using a **React UI** for Admin. | ||
|
||
Since the introduction of [VSCode devcontainers](./20200902_vscode_devcontainers.md) we were using our own file system polling for the `parcel` container. | ||
Because parcel (or rather Chokidar) supports polling, the container setup can be simplified. | ||
|
||
## Simple migration | ||
|
||
- Recreate the `.devcontainer` folder or copy it from the template on GitHub | ||
- Replace the `parcel` container definition in `./.devcontainers/docker-compose.yml` with the newly created | ||
- Delete the folder `./.devcontainers/parcel` and replace it with the newly generated folder of the same name | ||
- Rebuild the remote container with the following command in VS Code: | ||
`Remote-Containers: Rebuild Container` | ||
|
||
## Manual migration | ||
|
||
- Change the `parcel` section of `./.devcontainers/docker-compose.yml` to the following (add the environment variable `CHOKIDAR_USEPOLLING`): | ||
|
||
```yml | ||
parcel: | ||
container_name: parcel-<YOUR_ADAPTER_NAME> | ||
build: ./parcel | ||
expose: | ||
- 1234 | ||
ports: | ||
- "1235:1235" | ||
volumes: | ||
- ..:/workspace:cached | ||
environment: | ||
- CHOKIDAR_USEPOLLING=1 | ||
``` | ||
- Remove the following two scripts in `./.devcontainers/parcel/` | ||
- `run-sync.sh` | ||
- `sync.sh` | ||
- Change `./.devcontainers/parcel/run.sh` to contain the following: | ||
|
||
```bash | ||
#!/bin/bash | ||
cd /workspace | ||
echo "Installing all dependencies..." | ||
npm install | ||
npm run watch:parcel | ||
``` | ||
|
||
- Change `./.devcontainers/parcel/Dockerfile` to contain the following: | ||
|
||
```Dockerfile | ||
FROM node:12 | ||
RUN mkdir -p /usr/app | ||
COPY *.sh /usr/app/ | ||
CMD /bin/bash -c "/usr/app/run.sh" | ||
``` | ||
|
||
- Rebuild the remote container with the following command in VS Code: | ||
`Remote-Containers: Rebuild Container` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
#!/bin/bash | ||
echo "Starting initial sync..." | ||
/usr/app/sync.sh | ||
|
||
cd /usr/workspace | ||
cd /workspace | ||
|
||
echo "Installing all dependencies..." | ||
npm install | ||
|
||
# run the following two commands in parallel (honoring Ctrl-C) | ||
# - npm run watch:parcel | ||
# - /usr/app/run-sync.sh | ||
(echo "npm run watch:parcel"; echo "/usr/app/run-sync.sh") | xargs -I{} -n 1 -P 2 /bin/bash -c "{}" | ||
npm run watch:parcel |
This file was deleted.
Oops, something went wrong.