diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index ab6b6ea..0b22dde 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,22 +1,26 @@ -FROM gitpod/workspace-full:latest +# Image source code: https://github.com/axonasif/workspace-images/tree/tmp +# Also see https://github.com/gitpod-io/workspace-images/issues/1071 +FROM axonasif/workspace-base@sha256:8c057b1d13bdfe8c279c68aef8242d32110c8d5310f9a393f9c0417bc61367d9 USER gitpod +# Persist ~ due to the requirements of this project +RUN echo 'create-overlay $HOME' > "$HOME/.runonce/1-home_persist" + # or git will keep prompting RUN git config --global pull.ff only -# ~/.stack, ~/.ghcup will be lost across Gitpod workspace restarts, -# use /workspace/ so it is persisted as part of prebuilt workspace -ENV STACK_ROOT=/workspace/.stack -ENV GHCUP_INSTALL_BASE_PREFIX=/workspace - -# Add ghcup to path -ENV PATH=/workspace/bin:/workspace/.ghcup/bin:${PATH} - -# create toolhome -RUN mkdir -p /workspace/bin +# add /workspace/bin and ghcup to PATH +ENV PATH="/workspace/bin:$HOME/.ghcup/bin:$PATH" # install ghcup, then stack and hls via it RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | env BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh -RUN ghcup install stack -RUN ghcup install hls +RUN ghcup install stack && \ + ghcup install hls +# populate stack's cache, this takes minutes & GBs +RUN stack update + +# install latest epm +RUN mkdir -p $HOME/.local/bin; \ + curl -o $HOME/.local/bin/epm -L https://github.com/e-wrks/epm/raw/latest/epm && \ + chmod +x $HOME/.local/bin/epm diff --git a/.gitpod.yml b/.gitpod.yml index 4342b56..68fdf93 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,6 +1,8 @@ image: file: .gitpod.Dockerfile +workspaceLocation: tour/main.code-workspace # Relative to /workspace dir + ports: - port: 1024-6000 onOpen: ignore @@ -8,9 +10,8 @@ ports: tasks: - name: Build Đ Tooling init: | - # /workspace/bin should have been created per Dockerfile, and added to $PATH - curl -o /workspace/bin/epm -L https://github.com/e-wrks/epm/raw/latest/epm - chmod a+x /workspace/bin/epm + # update epm to latest version + curl -o $HOME/.local/bin/epm -L https://github.com/e-wrks/epm/raw/latest/epm # prepare /workspace as an epm home cd /workspace epm init \ @@ -19,7 +20,8 @@ tasks: -B http://github.com/complyue \ nedh els sedh eas hasdim haskit cd /workspace/edh-universe - # build & install executables from Edh packages + # build & install executables from Edh packages, + # this takes minutes & GBs stack update stack install command: | @@ -27,9 +29,7 @@ tasks: cd /workspace/edh-universe epm up epm i - epm x gen-hie > hie.yaml # update executables from Edh packages - stack update stack install vscode: diff --git a/.rebuild-gitpod b/.rebuild-gitpod deleted file mode 100644 index 6cafedb..0000000 --- a/.rebuild-gitpod +++ /dev/null @@ -1,2 +0,0 @@ -Increase this number to trigger Gitpod rebuild: -1 diff --git a/main.code-workspace b/main.code-workspace new file mode 100644 index 0000000..41b64b6 --- /dev/null +++ b/main.code-workspace @@ -0,0 +1,12 @@ +{ + // All paths are relative to your main repo + // The additional repos are cloned inside /workspace dir + "folders": [ + { + "path": "." // Main repo that you will open in Gitpod (e.g. frontend) + }, + { + "path": "/workspace/edh-universe" // Additional repo + } + ] +} \ No newline at end of file