Skip to content

Commit

Permalink
Merge pull request #3488 from da-mask/main
Browse files Browse the repository at this point in the history
Adding Github CLI to workspace
  • Loading branch information
bestlong committed Apr 19, 2024
2 parents 1775f9f + 2004928 commit 38a2672
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Expand Up @@ -223,6 +223,7 @@ WORKSPACE_INSTALL_DNSUTILS=true
WORKSPACE_XDEBUG_PORT=9000
WORKSPACE_VITE_PORT=5173
WORKSPACE_INSTALL_JDK=true
WORKSPACE_INSTALL_GITHUB_CLI=false

### PHP_FPM ###############################################

Expand Down
35 changes: 35 additions & 0 deletions DOCUMENTATION/content/documentation/index.md
Expand Up @@ -382,6 +382,41 @@ WORKSPACE_INSTALL_PHPDBG=true
PHP_FPM_INSTALL_PHPDBG=true
```

<br>
<a name="Install-github-copilot-cli"></a>
## Install Github Copilot Cli
### Note: You must have Github Copilot access to use this feature.
Install `gh-cli` in the Workspace Container:

<br>
1 - Open the `.env`.

2 - Search for `WORKSPACE_INSTALL_GITHUB_CLI`.

3 - Set value to `true`

```dotenv
WORKSPACE_INSTALL_GITHUB_CLI=true
```
4 - Re-build the containers `docker compose build workspace`

5 - start your container `docker compose up -d workspace // ..and all your other containers`

6 - Enter the Workspace container:
```bash
docker-compose exec workspace bash
```

7 - Authenticate with your github account and follow the instructions::
```bash
gh auth login
```

8 - Install the copilot cli:
```bash
gh extension install github/gh-copilot
```




Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -179,6 +179,7 @@ services:
- INSTALL_DNSUTILS=${WORKSPACE_INSTALL_DNSUTILS}
- INSTALL_POPPLER_UTILS=${WORKSPACE_INSTALL_POPPLER_UTILS}
- INSTALL_JDK=${WORKSPACE_INSTALL_JDK}
- INSTALL_GITHUB_CLI=${WORKSPACE_INSTALL_GITHUB_CLI}
- http_proxy
- https_proxy
- no_proxy
Expand Down
15 changes: 15 additions & 0 deletions workspace/Dockerfile
Expand Up @@ -1868,6 +1868,21 @@ RUN if [ ${INSTALL_JDK} = true ]; then \
&& update-ca-certificates -f \
;fi

###########################################################################
# Github CLI:
###########################################################################

ARG INSTALL_GITHUB_CLI=false

RUN if [ ${INSTALL_GITHUB_CLI} = true ]; then \
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y \
;fi


#
#--------------------------------------------------------------------------
# Final Touch
Expand Down

0 comments on commit 38a2672

Please sign in to comment.