From f71935ee308de65b874af8bd75c144be2886fe02 Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Tue, 23 Sep 2025 04:37:59 +0100 Subject: [PATCH 1/3] config: apply Upsun branding updates to "platform" --- internal/config/platformsh-cli.yaml | 51 +++++++++++++++-------------- internal/config/upsun-cli.yaml | 4 +-- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/internal/config/platformsh-cli.yaml b/internal/config/platformsh-cli.yaml index a0a63b7..d7eaa93 100644 --- a/internal/config/platformsh-cli.yaml +++ b/internal/config/platformsh-cli.yaml @@ -1,60 +1,51 @@ -# Platform.sh CLI configuration +# Upsun CLI (Platform.sh compatibility) configuration # -# Based on the legacy CLI config in https://github.com/platformsh/legacy-cli/blob/main/config.yaml +# Platform.sh is now Upsun. # -# See ../internal/config/schema.go for the required keys +# These are settings for the 'platform' command, which is available for backwards compatibility. wrapper: homebrew_tap: platformsh/tap/platformsh-cli github_repo: platformsh/cli application: - name: 'Platform.sh CLI' + name: 'Upsun CLI (Platform.sh compatibility)' slug: 'platformsh-cli' executable: 'platform' env_prefix: 'PLATFORMSH_CLI_' user_config_dir: '.platformsh' - package_name: 'platformsh/cli' - installer_url: 'https://platform.sh/cli/installer' - manifest_url: 'https://platform.sh/cli/manifest.json' - github_repo: 'platformsh/legacy-cli' - mark_unwrapped_legacy: true disabled_commands: - self:install - self:update -local: - # A legacy project config file from versions < 3. - project_config_legacy: 'platform-project.yaml' - service: - name: 'Platform.sh' + name: 'Upsun (formerly Platform.sh)' env_prefix: 'PLATFORM_' project_config_dir: '.platform' app_config_file: '.platform.app.yaml' project_config_flavor: 'platform' - console_url: 'https://console.platform.sh' + console_url: 'https://console.upsun.com' - docs_url: 'https://docs.platform.sh' - docs_search_url: 'https://docs.platform.sh/search.html?q={{ terms }}' + docs_url: 'https://docs.upsun.com' + docs_search_url: 'https://docs.upsun.com/search.html?q={{ terms }}' - register_url: 'https://auth.api.platform.sh/register' - reset_password_url: 'https://auth.api.platform.sh/reset-password' + register_url: 'https://auth.upsun.com/register' + reset_password_url: 'https://auth.upsun.com/reset-password' - pricing_url: 'https://platform.sh/pricing' + pricing_url: 'https://upsun.com/pricing' activity_type_list_url: 'https://docs.upsun.com/anchors/fixed/integrations/activity-scripts/type/' runtime_operations_help_url: 'https://docs.upsun.com/anchors/fixed/app/runtime-operations/' api: - base_url: 'https://api.platform.sh' + base_url: 'https://api.upsun.com' - auth_url: 'https://auth.api.platform.sh' + auth_url: 'https://auth.upsun.com' oauth2_client_id: 'platform-cli' organization_types: [flexible, fixed] @@ -65,7 +56,7 @@ api: metrics: true teams: true - vendor_filter: 'platformsh' + vendor_filter: 'upsun' ssh: domain_wildcards: ['*.platform.sh'] @@ -73,9 +64,21 @@ ssh: detection: git_remote_name: 'platform' git_domain: 'platform.sh' # matches git.eu-5.platform.sh, etc. - site_domains: ['platform.sh', 'platformsh.site', 'tst.site'] + site_domains: ['platform.sh', 'platformsh.site', 'tst.site', 'upsunapp.com', 'upsun.app'] cluster_header: 'X-Platform-Cluster' +browser_login: + body: | + + +

{{title}}

+ + {{content}} + migrate: prompt: true docs_url: https://docs.upsun.com/anchors/fixed/cli/ diff --git a/internal/config/upsun-cli.yaml b/internal/config/upsun-cli.yaml index 22acdfc..c50db2d 100644 --- a/internal/config/upsun-cli.yaml +++ b/internal/config/upsun-cli.yaml @@ -74,8 +74,8 @@ ssh: detection: git_remote_name: "upsun" - git_domain: "upsun.com" - site_domains: ["platformsh.site", "tst.site", "upsunapp.com"] + git_domain: "platform.sh" # matches git.eu-5.platform.sh, etc. + site_domains: ["platformsh.site", "tst.site", "upsunapp.com", "upsun.app"] cluster_header: 'X-Platform-Cluster' browser_login: From b6528923f7749d79ae669222b6c90198383dddf8 Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Tue, 23 Sep 2025 05:40:28 +0100 Subject: [PATCH 2/3] Apply Upsun branding updates in README and other config files --- .gon.hcl | 2 +- .goreleaser.vendor.yaml.tpl | 2 +- .goreleaser.yaml | 12 ++++++------ Makefile | 8 ++++---- README.md | 20 +++++++++----------- installer.sh | 16 ++++++++-------- internal/config/schema.go | 32 ++++++++++++++++---------------- 7 files changed, 45 insertions(+), 47 deletions(-) diff --git a/.gon.hcl b/.gon.hcl index 673aba8..2079601 100644 --- a/.gon.hcl +++ b/.gon.hcl @@ -4,7 +4,7 @@ source = [ bundle_id = "sh.platform.cli" apple_id { - username = "antonis.kalipetis@platform.sh" + username = "antonis.kalipetis@upsun.com" password = "@env:AC_PASSWORD" } diff --git a/.goreleaser.vendor.yaml.tpl b/.goreleaser.vendor.yaml.tpl index 0f08cf9..54f55dd 100644 --- a/.goreleaser.vendor.yaml.tpl +++ b/.goreleaser.vendor.yaml.tpl @@ -79,7 +79,7 @@ nfpms: - homepage: https://docs.upsun.com/anchors/fixed/cli/ package_name: ${VENDOR_BINARY}-cli description: ${VENDOR_NAME} CLI - maintainer: Antonis Kalipetis + maintainer: Antonis Kalipetis license: MIT vendor: Platform.sh ids: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6f1e083..2b9f00c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -215,7 +215,7 @@ brews: commit_author: name: Antonis Kalipetis - email: antonis.kalipetis@platform.sh + email: antonis.kalipetis@upsun.com homepage: https://docs.upsun.com/anchors/fixed/cli/ description: Platform.sh CLI @@ -245,7 +245,7 @@ brews: commit_author: name: Antonis Kalipetis - email: antonis.kalipetis@platform.sh + email: antonis.kalipetis@upsun.com homepage: https://docs.upsun.com/anchors/cli/ description: Upsun CLI @@ -274,7 +274,7 @@ scoops: directory: Scoops commit_author: name: Antonis Kalipetis - email: antonis.kalipetis@platform.sh + email: antonis.kalipetis@upsun.com homepage: https://docs.upsun.com/anchors/fixed/cli/ description: Platform.sh CLI @@ -295,7 +295,7 @@ scoops: directory: Scoops commit_author: name: Antonis Kalipetis - email: antonis.kalipetis@platform.sh + email: antonis.kalipetis@upsun.com homepage: https://docs.upsun.com/anchors/cli/ description: Upsun CLI @@ -310,7 +310,7 @@ nfpms: homepage: https://docs.upsun.com/anchors/fixed/cli/ package_name: platformsh-cli description: Platform.sh CLI - maintainer: Antonis Kalipetis + maintainer: Antonis Kalipetis license: MIT vendor: Platform.sh ids: @@ -329,7 +329,7 @@ nfpms: homepage: https://docs.upsun.com/anchors/cli/ package_name: upsun-cli description: Upsun CLI - maintainer: Antonis Kalipetis + maintainer: Antonis Kalipetis license: MIT vendor: Platform.sh ids: diff --git a/Makefile b/Makefile index 11e769a..56a2d51 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PHP_VERSION = 8.2.29 LEGACY_CLI_VERSION = 4.26.0 -GORELEASER_ID ?= platform +GORELEASER_ID ?= upsun ifeq ($(GOOS), darwin) GORELEASER_ID=$(GORELEASER_ID)-macos @@ -71,10 +71,10 @@ goreleaser: command -v goreleaser >/dev/null || go install github.com/goreleaser/goreleaser/v2@$(GORELEASER_VERSION) .PHONY: single -single: goreleaser internal/legacy/archives/platform.phar php ## Build a single target release for Platform.sh or Upsun +single: goreleaser internal/legacy/archives/platform.phar php ## Build a single target release PHP_VERSION=$(PHP_VERSION) LEGACY_CLI_VERSION=$(LEGACY_CLI_VERSION) goreleaser build --single-target --id=$(GORELEASER_ID) --snapshot --clean -.PHONY: snapshot ## Build a snapshot release for Platform.sh and Upsun +.PHONY: snapshot ## Build a snapshot release snapshot: goreleaser internal/legacy/archives/platform.phar php PHP_VERSION=$(PHP_VERSION) LEGACY_CLI_VERSION=$(LEGACY_CLI_VERSION) goreleaser build --snapshot --clean @@ -83,7 +83,7 @@ clean-phar: ## Clean up the legacy CLI phar rm -f internal/legacy/archives/platform.phar .PHONY: release -release: goreleaser clean-phar internal/legacy/archives/platform.phar php ## Release the Platform.sh and Upsun CLIs +release: goreleaser clean-phar internal/legacy/archives/platform.phar php ## Create and publish a release PHP_VERSION=$(PHP_VERSION) LEGACY_CLI_VERSION=$(LEGACY_CLI_VERSION) goreleaser release --clean VERSION=$(VERSION) bash cloudsmith.sh diff --git a/README.md b/README.md index 87a66e4..4d83d8c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Platform.sh CLI +# Upsun CLI -The **Platform.sh CLI** is the official command-line interface for [Platform.sh](https://platform.sh). Use this tool to interact with your [Platform.sh](https://platform.sh) projects, and to build them locally for development purposes. +The **Upsun CLI** is the official command-line interface for [Upsun](https://upsun.com) (formerly Platform.sh). -This repository hosts the source code and releases of the new CLI. +This repository hosts the source code and releases of the CLI. > This product includes PHP software, freely available from [the PHP website](https://www.php.net/software) @@ -183,25 +183,23 @@ yum upgrade -y platformsh-cli ## Under the hood -The New Platform.sh CLI is built with backwards compatibility in mind. This is why we've embedded PHP, so that all Legacy PHP CLI commands can be executed in the exact same way, making sure that nothing breaks when you switch to it. - ## Building binaries, snapshots and releases Build a single binary ```console -# Build a single binary for Platform.sh make single -# Build a single binary for Upsun -make single GORELEASER_ID=upsun ``` Build a snapshot ```console -# Build and snapshot for Platform.sh and Upsun make snapshot -# Build a snapshot for a vendor +``` + +Build a snapshot for a vendor + +```console # Download the config file at internal/config/embedded-config.yaml make vendor-snapshot VENDOR_NAME='Upsun staging' VENDOR_BINARY='upsunstg' ``` @@ -212,7 +210,7 @@ Create a release # First, create a new tag, if not already on a Git tag git tag -f -m 'Release v5.0.0' '5.0.0' -# Create a release for Platform.sh and Upsun +# Create a release # Expose a GITHUB_TOKEN to use for the release make release diff --git a/installer.sh b/installer.sh index 50c5dff..725b084 100644 --- a/installer.sh +++ b/installer.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Platform.sh CLI installer +# Upsun CLI installer set -euo pipefail @@ -11,10 +11,10 @@ set -euo pipefail : "${URL:=https://github.com/platformsh/cli/releases/download}" -# Force Platform.sh CLI installation in this directory instead of system directory +# Force Upsun CLI installation in this directory instead of system directory : "${INSTALL_DIR:=}" -# Platform.sh CLI version to install +# Upsun CLI version to install : "${VERSION:=}" # macOS specifics @@ -24,8 +24,8 @@ set -euo pipefail # GitHub token check : "${GITHUB_TOKEN:=}" -# Platform.sh CLI vendor to install -: "${VENDOR:=platformsh}" +# Upsun CLI vendor to install +: "${VENDOR:=upsun}" # CI specifics : "${CI:=}" @@ -34,7 +34,7 @@ set -euo pipefail # global variables binary="platform" -vendor_name="Platform.sh" +vendor_name="Upsun (formerly Platform.sh)" cloudsmith_repository="cli" cmd_shasum="" cmd_sudo="" @@ -45,8 +45,8 @@ kernel="" machine="" version="" package="platformsh-cli" -docs_url="https://docs.platform.sh" -support_url="https://platform.sh/contact" +docs_url="https://docs.upsun.com" +support_url="https://upsun.com/contact" if [ "$VENDOR" == "upsun" ]; then BREW_FORMULA="platformsh/tap/upsun-cli" diff --git a/internal/config/schema.go b/internal/config/schema.go index c142224..dd9fa84 100644 --- a/internal/config/schema.go +++ b/internal/config/schema.go @@ -26,11 +26,11 @@ type Config struct { Application struct { // Fields required for both the PHP and Go applications. - Name string `validate:"required"` // e.g. "Platform.sh CLI" - EnvPrefix string `validate:"required" yaml:"env_prefix"` // e.g. "PLATFORMSH_CLI_" - Executable string `validate:"required"` // e.g. "platform" - Slug string `validate:"required,ascii"` // e.g. "platformsh-cli" - UserConfigDir string `validate:"required" yaml:"user_config_dir"` // e.g. ".platformsh" + Name string `validate:"required"` // e.g. "Upsun CLI" + EnvPrefix string `validate:"required" yaml:"env_prefix"` // e.g. "UPSUN_CLI_" + Executable string `validate:"required"` // e.g. "upsun" + Slug string `validate:"required,ascii"` // e.g. "upsun-cli" + UserConfigDir string `validate:"required" yaml:"user_config_dir"` // e.g. ".upsun" UserStateFile string `validate:"omitempty" yaml:"user_state_file,omitempty"` // defaults to "state.json" WritableUserDir string `validate:"omitempty" yaml:"writable_user_dir,omitempty"` // defaults to UserConfigDir TempSubDir string `validate:"omitempty" yaml:"tmp_sub_dir,omitempty"` // defaults to Slug+"-tmp" @@ -42,32 +42,32 @@ type Config struct { // Fields only needed by the PHP (legacy) CLI, at least for now. API struct { - BaseURL string `validate:"required,url" yaml:"base_url"` // e.g. "https://api.platform.sh" - AuthURL string `validate:"omitempty,url" yaml:"auth_url,omitempty"` // e.g. "https://auth.api.platform.sh" + BaseURL string `validate:"required,url" yaml:"base_url"` // e.g. "https://api.upsun.com" + AuthURL string `validate:"omitempty,url" yaml:"auth_url,omitempty"` // e.g. "https://auth.upsun.com" UserAgent string `validate:"omitempty" yaml:"user_agent,omitempty"` // a template - see UserAgent method SessionID string `validate:"omitempty,ascii" yaml:"session_id,omitempty"` // the ID for the authentication session - defaults to "default" OAuth2ClientID string `validate:"omitempty" yaml:"oauth2_client_id,omitempty"` // e.g. "upsun-cli" - OAuth2AuthorizeURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"oauth2_auth_url,omitempty"` // e.g. "https://auth.api.platform.sh/oauth2/authorize" - OAuth2RevokeURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"oauth2_revoke_url,omitempty"` // e.g. "https://auth.api.platform.sh/oauth2/revoke" - OAuth2TokenURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"oauth2_token_url,omitempty"` // e.g. "https://auth.api.platform.sh/oauth2/token" - CertifierURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"certifier_url,omitempty"` // e.g. "https://ssh.api.platform.sh" + OAuth2AuthorizeURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"oauth2_auth_url,omitempty"` // e.g. "https://auth.upsun.com/oauth2/authorize" + OAuth2RevokeURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"oauth2_revoke_url,omitempty"` // e.g. "https://auth.upsun.com/oauth2/revoke" + OAuth2TokenURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"oauth2_token_url,omitempty"` // e.g. "https://auth.upsun.com/oauth2/token" + CertifierURL string `validate:"required_without=AuthURL,omitempty,url" yaml:"certifier_url,omitempty"` // No longer used AIServiceURL string `validate:"omitempty,url" yaml:"ai_url,omitempty"` // The AI service URL, e.g. "https://ai.upsun.com". EnableOrganizations bool `validate:"omitempty" yaml:"organizations,omitempty"` // Whether the "organizations" feature is enabled. } `validate:"required"` Detection struct { - GitRemoteName string `validate:"required" yaml:"git_remote_name"` // e.g. "platform" - SiteDomains []string `validate:"required" yaml:"site_domains"` // e.g. ["platformsh.site", "tst.site"] + GitRemoteName string `validate:"required" yaml:"git_remote_name"` // e.g. "upsun" + SiteDomains []string `validate:"required" yaml:"site_domains"` // e.g. ["upsunapp.com", "upsun.app"] } `validate:"required"` Service struct { - Name string `validate:"required"` // e.g. "Platform.sh" + Name string `validate:"required"` // e.g. "Upsun" EnvPrefix string `validate:"required" yaml:"env_prefix"` // e.g. "PLATFORM_" ProjectConfigDir string `validate:"required" yaml:"project_config_dir"` // e.g. ".platform" ProjectConfigFlavor string `validate:"omitempty" yaml:"project_config_flavor,omitempty"` // default: "platform" - ConsoleURL string `validate:"omitempty,url" yaml:"console_url,omitempty"` // e.g. "https://console.platform.sh" - DocsURL string `validate:"omitempty,url" yaml:"docs_url,omitempty"` // e.g. "https://docs.platform.sh" + ConsoleURL string `validate:"omitempty,url" yaml:"console_url,omitempty"` // e.g. "https://console.upsun.com" + DocsURL string `validate:"omitempty,url" yaml:"docs_url,omitempty"` // e.g. "https://docs.upsun.com" } `validate:"required"` SSH struct { DomainWildcards []string `validate:"required" yaml:"domain_wildcards"` // e.g. ["*.platform.sh"] From 5ea159bbaa669dd0b8b249df88f92d752301f91d Mon Sep 17 00:00:00 2001 From: Antonis Kalipetis Date: Tue, 23 Sep 2025 20:16:05 +0300 Subject: [PATCH 3/3] fix: remove .gon.hcl --- .gon.hcl | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .gon.hcl diff --git a/.gon.hcl b/.gon.hcl deleted file mode 100644 index 2079601..0000000 --- a/.gon.hcl +++ /dev/null @@ -1,17 +0,0 @@ -source = [ - "./dist/platform-macos_darwin_all/platform", -] -bundle_id = "sh.platform.cli" - -apple_id { - username = "antonis.kalipetis@upsun.com" - password = "@env:AC_PASSWORD" -} - -sign { - application_identity = "Developer ID Application: Blackfire (DN59GP4LUB)" -} - -zip { - output_path = "./dist/platform-macos.zip" -}