From 190121407b470bd71c545fcbbd5bc4a474dabcc7 Mon Sep 17 00:00:00 2001 From: Teo Koon Peng Date: Wed, 12 Jun 2024 08:30:18 +0000 Subject: [PATCH] update scripts Signed-off-by: Teo Koon Peng --- .github/actions/bootstrap/action.yml | 7 ------- .github/minimal-rmf/Dockerfile | 4 ++++ pipenv-install/{pipenv => bootstrap-pipenv.sh} | 4 ---- pipenv-install/package.json | 2 +- scripts/pipenv | 5 ++--- 5 files changed, 7 insertions(+), 15 deletions(-) rename pipenv-install/{pipenv => bootstrap-pipenv.sh} (77%) diff --git a/.github/actions/bootstrap/action.yml b/.github/actions/bootstrap/action.yml index f792eb20e..cdd3b6df4 100644 --- a/.github/actions/bootstrap/action.yml +++ b/.github/actions/bootstrap/action.yml @@ -11,13 +11,6 @@ inputs: runs: using: composite steps: - - uses: pnpm/action-setup@v2.2.2 - with: - version: 'latest' - - uses: actions/setup-node@v2 - with: - node-version: '20' - cache: 'pnpm' - name: Install dependencies run: pnpm install -w --filter ${{ inputs.package }}... --no-frozen-lockfile shell: bash diff --git a/.github/minimal-rmf/Dockerfile b/.github/minimal-rmf/Dockerfile index a5d88693e..dd8f98bc6 100644 --- a/.github/minimal-rmf/Dockerfile +++ b/.github/minimal-rmf/Dockerfile @@ -21,6 +21,8 @@ RUN cd /rmf \ && colcon build --merge-install --install-base /opt/rmf --cmake-args -DCMAKE_BUILD_TYPE=Release \ && rm -rf /rmf +# install tools for rmf-web + RUN curl -fsSL https://get.pnpm.io/install.sh | bash - # shell runs in non-interactive mode, which does not source .bashrc so we need to set the PATH manually ENV PNPM_HOME /root/.local/share/pnpm @@ -28,3 +30,5 @@ ENV PATH "$PNPM_HOME:$PATH" # nodejs seems to have changed the official mirror, the default in pnpm is very slow now RUN pnpm config -g set 'node-mirror:release' https://nodejs.org/dist && pnpm env use --global lts + +RUN apt update && apt install -y python3-venv diff --git a/pipenv-install/pipenv b/pipenv-install/bootstrap-pipenv.sh similarity index 77% rename from pipenv-install/pipenv rename to pipenv-install/bootstrap-pipenv.sh index dc214356e..a75763123 100755 --- a/pipenv-install/pipenv +++ b/pipenv-install/bootstrap-pipenv.sh @@ -1,12 +1,8 @@ #!/usr/bin/bash set -e -cd "$(dirname "$0")/.." - if [ ! -d .venv ]; then echo 'creating virtualenv at .venv' python3 -m venv .venv --system-site-packages --prompt rmf-web .venv/bin/pip3 install pipenv fi - -exec .venv/bin/pipenv "$@" diff --git a/pipenv-install/package.json b/pipenv-install/package.json index 4c3116844..3dff20af3 100644 --- a/pipenv-install/package.json +++ b/pipenv-install/package.json @@ -4,6 +4,6 @@ "description": "A dummy package so that we can run pipenv install only when needed", "private": true, "scripts": { - "install": "./pipenv install -d --site-packages" + "install": "./bootstrap-pipenv.sh && ../scripts/pipenv install -d --site-packages" } } diff --git a/scripts/pipenv b/scripts/pipenv index b4878473e..753077e5b 100755 --- a/scripts/pipenv +++ b/scripts/pipenv @@ -1,6 +1,5 @@ -#!/bin/bash +#!/usr/bin/bash set -e # Wrapper to the locally installed pipenv. -. "$(dirname $0)/../.venv/bin/activate" -pipenv "$@" +exec "$(dirname "$0")/../.venv/bin/pipenv" "$@"