From 619b7337ab2d651b24852b14fcba6cfb2b103e12 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Wed, 19 Oct 2022 16:51:54 +0300 Subject: [PATCH] TRE CLI in devcontainer (#2757) * cli in devcontainer * Update CHANGELOG.md Co-authored-by: Stuart Leeks * cr fix Co-authored-by: Stuart Leeks --- .devcontainer/Dockerfile | 5 +++++ .devcontainer/scripts/post-create.sh | 4 ---- .dockerignore | 21 +++++++++++++++++++ .../devcontainer_run_command/action.yml | 4 +--- CHANGELOG.md | 1 + 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c861b39b4e..be1d1eb9cb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -97,3 +97,8 @@ RUN echo "export HISTFILE=$HOME/commandhistory/.bash_history" >> "$HOME/.bashrc" # Install github-cli COPY ./.devcontainer/scripts/gh.sh /tmp/ RUN if [ "${INTERACTIVE}" = "true" ]; then /tmp/gh.sh; fi + +# Install tre-cli +COPY ./cli /tmp/cli +WORKDIR /tmp/cli +RUN make install-cli && echo -e "\n# Set up tre completion\nsource <(_TRE_COMPLETE=bash_source tre)" >> ~/.bashrc diff --git a/.devcontainer/scripts/post-create.sh b/.devcontainer/scripts/post-create.sh index 3488e3de42..fc0f8cc417 100755 --- a/.devcontainer/scripts/post-create.sh +++ b/.devcontainer/scripts/post-create.sh @@ -3,7 +3,3 @@ set -e # docker socket fixup sudo bash ./devops/scripts/set_docker_sock_permission.sh - -# install tre CLI -(cd ./cli/ && make install-cli) && echo -e "\n# Set up tre completion\nsource <(_TRE_COMPLETE=bash_source tre)" >> ~/.bashrc - diff --git a/.dockerignore b/.dockerignore index 2919244c86..13fc736226 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,24 @@ # Put files here that you don't want copied into your bundle's invocation image .gitignore Dockerfile.tmpl + +.bash_history +.mypy_cache +.pytest_cache + +__pycache__ +.env +*.env + +docs +!docs/requirements.txt + +cli/build +cli/dist +*.egg-info/ + +.terraform +tfplan* +*.log + +templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/target diff --git a/.github/actions/devcontainer_run_command/action.yml b/.github/actions/devcontainer_run_command/action.yml index 01b5b9ac72..21310b5d65 100644 --- a/.github/actions/devcontainer_run_command/action.yml +++ b/.github/actions/devcontainer_run_command/action.yml @@ -175,6 +175,4 @@ runs: -e WORKSPACE_APP_SERVICE_PLAN_SKU="${{ (inputs.WORKSPACE_APP_SERVICE_PLAN_SKU != '' && inputs.WORKSPACE_APP_SERVICE_PLAN_SKU) || 'P1v2' }}" \ '${{ inputs.CI_CACHE_ACR_NAME }}.azurecr.io/tredev:${{ inputs.DEVCONTAINER_TAG }}' \ - bash -c "(cd cli/ && make install-cli) && ${{ inputs.COMMAND }}" - # Above command installs tre CLI (done via postCreateCommand in VS Code) - # If we switch to https://github.com/devcontainers/ci this would no longer be needed + bash -c "${{ inputs.COMMAND }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index bb83212975..b1b4cb368a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ FEATURES: ENHANCEMENTS: * Add cran support to nexus, open port 80 for the workspace nsg and update the firewall config to allow let's encrypt CRLs ([#2694](https://github.com/microsoft/AzureTRE/pull/2694)) * Upgrade Github Actions versions ([#2731](https://github.com/microsoft/AzureTRE/pull/2744)) +* Install TRE CLI inside the devcontainer image (rather than via a post-create step) ([#2757](https://github.com/microsoft/AzureTRE/pull/2757)) BUG FIXES: