From aa55c63ddb1c0a8528fcaa12fc7ddf812a002b5a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 17 Jan 2022 18:51:14 -0800 Subject: [PATCH] docs: add environment reloading commands --- README.md | 15 +++++++++++++++ building/docker/debian.dockerfile | 3 +++ building/docker/debian_node.dockerfile | 3 +++ building/docker/debian_node_slim.dockerfile | 3 +++ 4 files changed, 24 insertions(+) diff --git a/README.md b/README.md index e7f76810..8cab48a2 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ An example that installs llvm, cmake, ninja, ccache, and vcpkg: # windows example (open shell as admin) curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_windows.exe" ./setup_cpp_windows --compiler llvm --cmake true --ninja true --ccache true --vcpkg true + +RefreshEnv.cmd # reload the environment ``` ```ps1 @@ -58,6 +60,8 @@ curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cp wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_linux" chmod +x setup_cpp_linux sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true + +source ~/.profile # reload the environment ``` ```ps1 @@ -65,11 +69,15 @@ sudo ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true - wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp_mac" chmod +x setup_cpp_mac sudo ./setup_cpp_mac --compiler llvm --cmake true --ninja true --ccache true --vcpkg true + +source ~/.profile # reload the environment ``` NOTE: In the `compiler` entry, you can specify the version after `-` like `llvm-11.0.0`. For the tools, instead of `true` that chooses the default version, you can pass a specific version. +NOTE: you will not need `sudo` if you are already a root user (e.g., in a GitLab runner). + ### With Nodejs Download the `setup_cpp.js` file form [here](https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js), and run it with the available options. @@ -82,6 +90,8 @@ Open the shell as admin, download via `curl`, then install # open shell as admin curl -LJO "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js" node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true + +RefreshEnv.cmd # reload the environment ``` On Linux or Mac: @@ -89,6 +99,8 @@ On Linux or Mac: ```ps1 wget "https://github.com/aminya/setup-cpp/releases/download/v0.5.3/setup_cpp.js" sudo node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --vcpkg true + +source ~/.profile # reload the environment ``` # Inside GitHub Actions @@ -168,6 +180,9 @@ RUN chmod +x ./setup_cpp_linux # install llvm, cmake, ninja, and ccache RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true +# reload the environment +RUN source ~/.profile + ENTRYPOINT [ "/bin/sh" ] ``` diff --git a/building/docker/debian.dockerfile b/building/docker/debian.dockerfile index 1045fccc..c843247e 100644 --- a/building/docker/debian.dockerfile +++ b/building/docker/debian.dockerfile @@ -12,4 +12,7 @@ RUN chmod +x ./setup_cpp_linux # install llvm, cmake, ninja, and ccache RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true +# reload the environment +CMD source ~/.profile + ENTRYPOINT [ "/bin/sh" ] diff --git a/building/docker/debian_node.dockerfile b/building/docker/debian_node.dockerfile index 16534a86..ace5d2c9 100644 --- a/building/docker/debian_node.dockerfile +++ b/building/docker/debian_node.dockerfile @@ -8,4 +8,7 @@ WORKDIR "/" # run installation RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true +# reload the environment +CMD source ~/.profile + ENTRYPOINT [ "/bin/sh" ] \ No newline at end of file diff --git a/building/docker/debian_node_slim.dockerfile b/building/docker/debian_node_slim.dockerfile index 2ed2c26d..9a7e3d18 100644 --- a/building/docker/debian_node_slim.dockerfile +++ b/building/docker/debian_node_slim.dockerfile @@ -12,4 +12,7 @@ RUN apt-get install -y --no-install-recommends unzip # run installation RUN node ./setup_cpp.js --compiler llvm --cmake true --ninja true --ccache true --conan true +# reload the environment +CMD source ~/.profile + ENTRYPOINT [ "/bin/sh" ] \ No newline at end of file