-
Notifications
You must be signed in to change notification settings - Fork 6
chore(legacy): remove the legacy PHP installer and self-update #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e3dc24a
chore(legacy): remove the legacy PHP installer and self-update
pjcdawkins 3d15ed8
chore(legacy): remove unused VersionUtil
pjcdawkins d365388
docs: rewrite legacy/README.md and move configuration docs to the root
pjcdawkins 3d7b184
chore(legacy): require PHP 8.4
pjcdawkins 1fee585
Merge branch 'main' into chore/remove-legacy-installer
pjcdawkins f06556a
chore(legacy): stop passing UPDATES_CHECK=0 to the PHP CLI
pjcdawkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| FROM php:8.2-cli | ||
| FROM php:8.4-cli | ||
|
|
||
| ARG USER_ID | ||
| ARG GROUP_ID | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,113 +1,41 @@ | ||
| The **Legacy** CLI is the legacy version of the command-line interface for [Upsun (formerly Platform.sh)](https://upsun.com). | ||
| # Legacy PHP CLI | ||
|
|
||
| For the **current Upsun CLI**, check [this repository](https://github.com/platformsh/cli). | ||
| This directory contains the PHP layer of the Upsun CLI. It is built into a | ||
| phar and embedded in the Go wrapper, which runs it with its own PHP binary. | ||
| Commands not implemented in Go are passed to it. | ||
|
|
||
| ## Install | ||
| It was merged in from the archived | ||
| [platformsh/legacy-cli](https://github.com/platformsh/legacy-cli) repository. | ||
| Changes are now made here. | ||
|
|
||
| To install the CLI, use either [Homebrew](https://brew.sh/) (on Linux, macOS, or the Windows Subsystem for Linux) or [Scoop](https://scoop.sh/) (on Windows): | ||
| See the [root README](../README.md) for installing, configuring and building | ||
| the CLI. | ||
|
|
||
| ### HomeBrew | ||
| ## Development | ||
|
|
||
| ```console | ||
| brew install upsun/tap/platformsh-cli | ||
| ``` | ||
|
|
||
| ### Scoop | ||
|
|
||
| ```console | ||
| scoop bucket add platformsh https://github.com/platformsh/homebrew-tap.git | ||
| scoop install platform | ||
| ``` | ||
|
|
||
| ### Manual installation | ||
|
|
||
| For manual installation, you can also [download the latest binaries](https://github.com/platformsh/cli/releases/latest). | ||
|
|
||
| ### Legacy installer | ||
|
|
||
| _This installation method is considered legacy and is discouraged, use one of the methods above instead. Starting with version 5.x, this installation method will not be supported._ | ||
| Install dependencies: | ||
|
|
||
| In order to use the Legacy installer, you need to have an operating system supported by PHP (Linux, OS X, or Windows) and PHP 8.2 or higher, with the following extensions: `curl`, `json`, `pcre`, and `phar`. | ||
|
|
||
| Run this command to install the CLI using the legacy installer, given that you have PHP already installed: | ||
|
|
||
| ```console | ||
| curl -sS https://platform.sh/cli/installer | php | ||
| ```sh | ||
| composer install | ||
| ``` | ||
|
|
||
| In some Windows terminals you may need `php.exe` instead of `php`. | ||
|
|
||
| ## Upgrade | ||
|
|
||
| Upgrade using the same tool: | ||
| Run the PHP CLI from source: | ||
|
|
||
| ### HomeBrew | ||
|
|
||
| ```console | ||
| brew upgrade platformsh-cli | ||
| ```sh | ||
| ./bin/platform | ||
| ``` | ||
|
|
||
| ### Scoop | ||
| Run linters (php-cs-fixer and PHPStan) and unit tests: | ||
|
|
||
| ```console | ||
| scoop update platform | ||
| ```sh | ||
| make lint | ||
| make test | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| You can run this CLI in your shell by typing `platform`. | ||
|
|
||
| platform | ||
|
|
||
| Use the 'list' command to get a list of available options and commands: | ||
|
|
||
| platform list | ||
|
|
||
| ## Authentication | ||
|
|
||
| There are two ways to authenticate: | ||
|
|
||
| 1. The recommended way is `platform login`, which lets you log in via a web browser, including via third-party providers such as Google, GitHub, GitLab and Bitbucket. | ||
|
|
||
| 2. If using a browser is not possible, use an [API token](https://docs.upsun.com/anchors/fixed/cli/api-token/). | ||
|
|
||
| An interactive command is available for this: `platform auth:api-token-login` | ||
|
|
||
| For non-interactive uses such as scripts or CI systems, set the API token in an environment variable named `PLATFORMSH_CLI_TOKEN`. This can be insecure if not handled properly, although it is appropriate for systems such as CircleCI, Jenkins and GitLab. | ||
|
|
||
| *_Warning_*: An API token can act as the account that created it, with no restrictions. Use a separate machine account to limit the token's access. | ||
|
|
||
| ## Customization | ||
|
|
||
| You can configure the CLI via the user configuration file `~/.platformsh/config.yaml`. | ||
|
|
||
| The possible keys that can be overridden are in the [config-defaults.yaml](/config-defaults.yaml) and [config.yaml](/config.yaml) files. | ||
|
|
||
| Other customization is available via environment variables, including: | ||
|
|
||
| * `PLATFORMSH_CLI_DEBUG`: set to 1 to enable debugging. _Warning_: this could print HTTP request information in the terminal, including sensitive access tokens. | ||
| * `PLATFORMSH_CLI_DEFAULT_TIMEOUT`: the timeout (in seconds) for most individual API requests. The default is 30. | ||
| * `PLATFORMSH_CLI_DISABLE_CACHE`: set to 1 to disable caching | ||
| * `PLATFORMSH_CLI_HOME`: override the home directory (inside which the .platformsh directory is stored) | ||
| * `PLATFORMSH_CLI_NO_COLOR`: set to 1 to disable colors in output | ||
| * `PLATFORMSH_CLI_NO_INTERACTION`: set to 1 to disable interaction (useful for scripting). Equivalent to the `--no-interaction` command-line option. _Warning_: this will bypass any confirmation questions. | ||
| * `PLATFORMSH_CLI_SESSION_ID`: change user session (default 'default'). The `session:switch` command (beta) is now available as an alternative. | ||
| * `PLATFORMSH_CLI_SHELL_CONFIG_FILE`: specify the shell configuration file that the installer should write to (as an absolute path). If not set, a file such as `~/.bashrc` will be chosen automatically. Set this to an empty string to disable writing to a shell config file. | ||
| * `PLATFORMSH_CLI_TOKEN`: an API token. *_Warning_*: An API token can act as the account that created it, with no restrictions. Use a separate machine account to limit the token's access. Additionally, storing a secret in an environment variable can be insecure. It may be better to use the `auth:api-token-login` command. The environment variable is preferable on CI systems like Jenkins and GitLab. | ||
| * `PLATFORMSH_CLI_UPDATES_CHECK`: set to 0 to disable the automatic updates check | ||
| * `PLATFORMSH_CLI_SSH_AUTO_LOAD_CERT`: set to 0 to disable automatic loading of an SSH certificate when running login or SSH commands | ||
| * `PLATFORMSH_CLI_REPORT_DEPRECATIONS`: set to 1 to enable PHP deprecation notices (suppressed by default). They will only be displayed in debug mode (`-vvv`). | ||
| * `CLICOLOR_FORCE`: set to 1 or 0 to force colorized output on or off, respectively | ||
| * `http_proxy` or `https_proxy`: specify an HTTP proxy | ||
|
|
||
| ## Known issues | ||
|
|
||
| ### Caching | ||
|
|
||
| The CLI caches details of your projects and their environments, and some other | ||
| information. These caches could become out-of-date. You can clear caches with | ||
| the command `platform clear-cache` (or `platform cc` for short). | ||
| After changing services or commands, delete the cached container | ||
| (`make clean`). | ||
|
|
||
| ## Contributing | ||
| To build the embedded phar, run `make single` from the repository root. | ||
|
|
||
| See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute to the CLI. | ||
| A Docker development environment is available: copy `.env-dist` to `.env`, | ||
| then run `docker-compose up -d` and `docker-compose exec cli bash`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.