diff options
author | 2022-03-15 17:03:26 -0400 | |
---|---|---|
committer | 2022-03-15 16:03:26 -0500 | |
commit | 60fe7bd41e234117036de3564ef41ad2971ed056 (patch) | |
tree | 563b8cc64181196f7bc18f506e7204717f4b475b | |
parent | 6eb494796e5144a4f2c12a6cce3fb2345c9b4e4e (diff) | |
download | astro-60fe7bd41e234117036de3564ef41ad2971ed056.tar.gz astro-60fe7bd41e234117036de3564ef41ad2971ed056.tar.zst astro-60fe7bd41e234117036de3564ef41ad2971ed056.zip |
Gitpod setup improvements (#2789)
* install latest pnpm version in docker image
* Add astro-build vscode extension in Gitpod setup
* automatically open preview when port 3000 is used
* run astro build during prebuild
* Run starter demo when starting this workspace
* and $ASTRO_NEW to run specific example
* open index.astro of selected project
* Add sleep 1 before running code command
* use `gp await-port` instead of sleep
Diffstat (limited to '')
-rw-r--r-- | .gitpod.Dockerfile | 4 | ||||
-rw-r--r-- | .gitpod.yml | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 000000000..965d8684c --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,4 @@ +FROM gitpod/workspace-node + +# Install latest pnpm +RUN pnpm i -g pnpm diff --git a/.gitpod.yml b/.gitpod.yml index ad4439968..6d12b9fff 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,15 +1,21 @@ --- +image: + file: .gitpod.Dockerfile # Commands to start on workspace startup tasks: - - init: pnpm install - command: pnpm run build + - init: | + pnpm install + pnpm run build + command: | + [[ ! -z "$ASTRO_NEW" ]] && gp await-port 23000 && cd "$GITPOD_REPO_ROOT"/examples/"$ASTRO_NEW" && code src/pages/index.astro && pnpm start vscode: extensions: - # TODO Once astro is on [vsx](https://open-vsx.org/), we should be able to specify it as an extension as well! - # https://www.gitpod.io/docs/vscode-extensions - - https://marketplace.visualstudio.com/_apis/public/gallery/publishers/astro-build/vsextensions/astro-vscode/0.7.13/vspackage + - astro-build.astro-vscode - esbenp.prettier-vscode - dbaeumer.vscode-eslint +ports: + - port: 3000 + onOpen: open-preview github: prebuilds: # enable for the master/default branch (defaults to true) |