diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000000..ea913c7d21 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,9 @@ +image: + file: .gitpod/.gitpod.Dockerfile +tasks: + - name: Prepare Environment + init: | + composer install + command: | + ./.gitpod/scripts/login.sh + printf "\n\n All set! Be sure to test your changes by running: vendor/bin/phpunit\n\n" diff --git a/.gitpod/.gitpod.Dockerfile b/.gitpod/.gitpod.Dockerfile new file mode 100644 index 0000000000..57a5df5461 --- /dev/null +++ b/.gitpod/.gitpod.Dockerfile @@ -0,0 +1,4 @@ +FROM gitpod/workspace-full:latest + +# Set PHP 7.4 - Gitpod defaults to 8.1 otherwise +RUN sudo update-alternatives --set php $(which php7.4) diff --git a/.gitpod/scripts/login.sh b/.gitpod/scripts/login.sh new file mode 100755 index 0000000000..7d0b80ec89 --- /dev/null +++ b/.gitpod/scripts/login.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +echo "When ready to make authenticated requests, use: platform auth:api-token-login" +echo "Or: export \PLATFORMSH_CLI_TOKEN=YOUR_TOKEN" + +if [ -z "$PLATFORM_CLI_TOKEN" ]; then + echo "WARNING: \$PLATFORMSH_CLI_TOKEN was detected as an environment variable. If you share this workspace with others, they will have access to this token."; +fi; diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d34a13dea7..8f34af1c7f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,12 @@ Development of the Platform.sh CLI happens in public in the [GitHub repository](https://github.com/platformsh/platformsh-cli). Issues and pull requests submitted via GitHub are very welcome. +## Developing via Gitpod + +This project ships with a no-install, ready-to-develop environment using Gitpod. Start working on the 3.x branch [here](https://gitpod.io/#https://github.com/platformsh/platformsh-cli/tree/3.x). + +Or, the branch of your choice using the format: https://gitpod.io/#https://github.com/platformsh/platformsh-cli/tree/{branch} + ## Developing locally If you clone this repository locally, you can build it with: diff --git a/README.md b/README.md index 9cbef00ad2..0690bfff8f 100644 --- a/README.md +++ b/README.md @@ -143,3 +143,5 @@ the command `platform clear-cache` (or `platform cc` for short). ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute to the CLI. + +Or, launch a ready-to-develop environment via [Gitpod](https://gitpod.io/#https://github.com/platformsh/platformsh-cli/tree/3.x). diff --git a/src/Local/DependencyManager/Pip.php b/src/Local/DependencyManager/Pip.php index 62e37454a6..493de5b8a8 100644 --- a/src/Local/DependencyManager/Pip.php +++ b/src/Local/DependencyManager/Pip.php @@ -58,7 +58,7 @@ public function install($path, array $dependencies, $global = false) file_put_contents($path . '/requirements.txt', $this->formatRequirementsTxt($dependencies)); $command = $this->getCommandName() . ' install --requirement=requirements.txt'; if (!$global) { - $command .= ' --prefix=.'; + $command .= ' --prefix='; } $this->runCommand($command, $path); }