From 678252223f629e00e453bec8d4a2e1d49013aea7 Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Mon, 4 Nov 2024 16:06:07 +0100 Subject: [PATCH 1/2] composer: Use deployer fork instead By using our fork instead, we can make use of our proper custom tags, which are full revisions with all the engine code. This problem fixes composer confusion when doing dependency checking for `dev-master`, which then gets confused a little bit because dev-master could have new version requirements, without checking the requirements specifically for the specified git revision. --- README.md | 17 ++++++++++++++ composer.json | 8 ++++++- composer.lock | 62 ++++++++++++++++++++++++++++++--------------------- 3 files changed, 60 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 2b7e696..e942dcd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,23 @@ If you are looking to see how the internals of the deployment tool work or even This project builds the `hypernode/deploy` container image, which can be found on [quay.io/hypernode/deploy](https://quay.io/hypernode/deploy). +## Updating deployer dependency + +Deployer is an integral part of Hypernode Deploy. +The official packagist distribution (and the git tags) are just phar distributions with all the engine code stripped away. +To properly install Deployer as a dependency, we install a very simple fork, which has git tags based on the engine code. + +Whenever a new Deployer version is released, here's the process: +- Sync the fork [ByteInternet/deployer](https://github.com/ByteInternet/deployer) +- Locate the commit for the release in the master branch. + - Usually this comes down to finding the commit that was pushed most recent to the release tag. +- Clone/update the fork locally. +- Run `git checkout ` +- Run `git tag v` +- Run `git push --tags` + +Finally, to utilize the new fork in Hypernode Deploy, you can simply change the deployer/deployer dependency in the `composer.json` file. + ## Building and running a local image If you don't want to use a pre-built image from https://quay.io/hypernode/deploy or if you are doing development on this project and you want to test out your changes, you can built an image locally and use that. diff --git a/composer.json b/composer.json index d9b9feb..fae8d0e 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "ext-pcntl": "*", "ext-zlib": "*", "composer-runtime-api": "^2", - "deployer/deployer": "dev-master#a3bab59 as v7.4.0", + "deployer/deployer": "v7.4.0", "doctrine/annotations": "^1.6", "guzzlehttp/guzzle": "^7.5", "hypernode/api-client": "^0.4", @@ -50,5 +50,11 @@ "phpro/grumphp-shim": true, "php-http/discovery": true } + }, + "repositories": { + "deployer-fork": { + "type": "vcs", + "url": "https://github.com/ByteInternet/deployer" + } } } diff --git a/composer.lock b/composer.lock index 41bf47a..cc2dc9f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a0ee2f27bcd1e60886d23d064882ab6d", + "content-hash": "a8161c1ede390e143f1581d8c15a9753", "packages": [ { "name": "clue/stream-filter", @@ -74,16 +74,16 @@ }, { "name": "deployer/deployer", - "version": "dev-master", + "version": "v7.4.0", "source": { "type": "git", - "url": "https://github.com/deployphp/deployer.git", - "reference": "a3bab59" + "url": "https://github.com/ByteInternet/deployer.git", + "reference": "a3bab59d448de84099e52fc5b6c652737a8c2942" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/deployphp/deployer/zipball/a3bab59", - "reference": "a3bab59", + "url": "https://api.github.com/repos/ByteInternet/deployer/zipball/a3bab59d448de84099e52fc5b6c652737a8c2942", + "reference": "a3bab59d448de84099e52fc5b6c652737a8c2942", "shasum": "" }, "require": { @@ -106,21 +106,39 @@ "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5" }, - "default-branch": true, "bin": [ "bin/dep" ], "type": "library", "autoload": { + "psr-4": { + "Deployer\\": "src/" + }, "files": [ "src/Support/helpers.php", "src/functions.php" + ] + }, + "scripts": { + "test": [ + "pest" ], - "psr-4": { - "Deployer\\": "src/" - } + "test:e2e": [ + "pest --config tests/e2e/phpunit-e2e.xml" + ], + "phpcs": [ + "phpcs" + ], + "fix": [ + "phpcbf" + ], + "phpstan": [ + "phpstan analyse -c phpstan.neon" + ], + "phpstan:baseline": [ + "@phpstan --generate-baseline tests/phpstan-baseline.neon" + ] }, - "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -134,16 +152,16 @@ "homepage": "https://deployer.org", "support": { "docs": "https://deployer.org/docs", - "issues": "https://github.com/deployphp/deployer/issues", - "source": "https://github.com/deployphp/deployer" + "source": "https://github.com/deployphp/deployer", + "issues": "https://github.com/deployphp/deployer/issues" }, "funding": [ { - "url": "https://github.com/sponsors/antonmedv", - "type": "github" + "type": "github", + "url": "https://github.com/sponsors/antonmedv" } ], - "time": "2024-09-17T08:54:36+00:00" + "time": "2024-04-17T21:19:58+00:00" }, { "name": "doctrine/annotations", @@ -7560,17 +7578,9 @@ "time": "2015-12-17T08:42:14+00:00" } ], - "aliases": [ - { - "package": "deployer/deployer", - "version": "9999999-dev", - "alias": "v7.4.0", - "alias_normalized": "7.4.0.0" - } - ], + "aliases": [], "minimum-stability": "stable", "stability-flags": { - "deployer/deployer": 20, "roave/security-advisories": 20 }, "prefer-stable": false, @@ -7581,6 +7591,6 @@ "ext-zlib": "*", "composer-runtime-api": "^2" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } From 5e843bf956a2a46efc3eb9c67e011df5644f9f60 Mon Sep 17 00:00:00 2001 From: Timon de Groot Date: Mon, 4 Nov 2024 16:18:50 +0100 Subject: [PATCH 2/2] Revert "ci: Checkout pull request ref instead" This reverts commit 32ef185e9d8d7402e27219636573ae3465ac61c1. --- .github/workflows/test.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ed2843d..30285f0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,8 +12,6 @@ jobs: steps: - name: Checkout hypernode-deploy uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.ref }} - name: Run general testsuite if: ${{ matrix.testsuite == 'general' }} run: MAGENTO_REPO=./magento2 ./runtests.sh general