Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into midweste
Browse files Browse the repository at this point in the history
* origin/master: (33 commits)
  Update default cachetool version to 9.0.0 (PHP 8.1 compatible) (deployphp#3462)
  Update UPGRADE.md (deployphp#3458)
  update writable deploy recipe to use release_or_current_path (deployphp#3449)
  Fix PostgreSQL provisioning
  Fix PostgresDB user creation
  Show failed tasks for CI-environments (deployphp#3446)
  Fix NodeJS 12 warning: update EndBug/add-and-commit action (deployphp#3442)
  Replace unmaintained satackey/push-prebuilt-action by a maintained fork (deployphp#3437)
  Fix Node.js 12 actions are deprecated (deployphp#3435)
  Fix set-output command is deprecated and will be disabled soon (deployphp#3436)
  Add "new version" banners on release
  Revert "Fixes deployphp#3365 (deployphp#3400)"
  Make Deployer work with PHP 8.2 (deployphp#3422)
  Update symfony/console to ^5.4.9
  Update symfony/console to ^5.4.9
  Test on php 8.2 as well
  Revert "Composer update"
  Composer update
  [automatic] Update docs with bin/docgen
  Feature/magento2 artifact deployment (deployphp#3317)
  ...
  • Loading branch information
midwestE authored and midwestE committed Jan 27, 2023
2 parents eef62f1 + 1bc90e8 commit ebc1cd2
Show file tree
Hide file tree
Showing 31 changed files with 685 additions and 157 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -37,17 +37,17 @@ jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:
docgen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -33,7 +33,7 @@ jobs:
run: php bin/docgen

- name: Add & Commit
uses: EndBug/add-and-commit@v7
uses: EndBug/add-and-commit@v9
with:
add: 'docs'
message: '[automatic] Update docs with bin/docgen'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '7.3', '7.4', '8.0', '8.1' ]
php-versions: [ '7.3', '7.4', '8.0', '8.1', '8.2' ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -28,9 +28,9 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand All @@ -47,9 +47,9 @@ jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: satackey/action-docker-layer-caching@v0.0.8
- uses: jpribyl/action-docker-layer-caching@v0.1.1
continue-on-error: true

- name: Build the docker-compose stack
Expand All @@ -58,9 +58,9 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"justinrainbow/json-schema": "^5.2",
"psr/http-message": "^1",
"react/http": "^1.5",
"symfony/console": "^5",
"symfony/console": "^5.4.9",
"symfony/polyfill-php80": "^1.22",
"symfony/process": "^5",
"symfony/yaml": "^5"
Expand Down
30 changes: 15 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion contrib/cachetool.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@
namespace Deployer;

set('cachetool', '');
set('cachetool_url', 'https://github.com/gordalina/cachetool/releases/download/7.0.0/cachetool.phar');
/**
* URL to download cachetool from if it is not available
*
* CacheTool 9.x works with PHP >=8.1
* CacheTool 8.x works with PHP >=8.0
* CacheTool 7.x works with PHP >=7.3
*/
set('cachetool_url', 'https://github.com/gordalina/cachetool/releases/download/9.0.0/cachetool.phar');
set('cachetool_args', '');
set('bin/cachetool', function () {
if (!test('[ -f {{release_or_current_path}}/cachetool.phar ]')) {
Expand Down
15 changes: 10 additions & 5 deletions contrib/cloudflare.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
- `service_key` – Cloudflare Service Key. If this is not provided, use api_key and email.
- `api_key` – Cloudflare API key generated on the "My Account" page.
- `email` – Cloudflare Email address associated with your account.
- `domain` – The domain you want to clear
- `api_token` – Cloudflare API Token generated on the "My Account" page.
- `domain` – The domain you want to clear (optional if zone_id is provided).
- `zone_id` – Cloudflare Zone ID (optional).
### Usage
Expand All @@ -33,16 +34,16 @@
'X-Auth-Key' => $config['api_key'],
'X-Auth-Email' => $config['email']
];
} else if (!empty($config['api_token'])) {
$headers = [
'Authorization' => 'Bearer '.$config['api_token']
];
} else {
throw new \RuntimeException("Set a service key or email / api key");
}

$headers['Content-Type'] = 'application/json';

if (empty($config['domain'])) {
throw new \RuntimeException("Set a domain");
}

$makeRequest = function ($url, $opts = []) use ($headers) {
$ch = curl_init("https://api.cloudflare.com/client/v4/$url");

Expand Down Expand Up @@ -71,6 +72,10 @@

$zoneId = $config['zone_id'];
if (empty($zoneId)) {
if (empty($config['domain'])) {
throw new \RuntimeException("Set a domain");
}

// get the mysterious zone id from Cloud Flare
$zones = json_decode($makeRequest(
"zones?name={$config['domain']}"
Expand Down
7 changes: 5 additions & 2 deletions contrib/newrelic.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- `newrelic_app_id` – newrelic's app id
- `newrelic_api_key` – newrelic's api key
- `newrelic_description` – message to send
- `newrelic_endpoint` – newrelic's REST API endpoint
## Usage
Expand All @@ -31,16 +32,18 @@
return runLocally('git log -n 1 --format="%h"');
});

set('newrelic_endpoint', 'api.newrelic.com');

desc('Notifies New Relic of deployment');
task('newrelic:notify', function () {
if (($appId = get('newrelic_app_id')) && ($apiKey = get('newrelic_api_key'))) {
if (($appId = get('newrelic_app_id')) && ($apiKey = get('newrelic_api_key')) && ($endpoint = get('newrelic_endpoint'))) {
$data = [
'user' => get('user'),
'revision' => get('newrelic_revision'),
'description' => get('newrelic_description'),
];

Httpie::post("https://api.newrelic.com/v2/applications/$appId/deployments.json")
Httpie::post("https://$endpoint/v2/applications/$appId/deployments.json")
->header("X-Api-Key", $apiKey)
->query(['deployment' => $data])
->send();
Expand Down
17 changes: 8 additions & 9 deletions deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import:
- src/Support/update_banner.php
- src/Support/update_manifest.php

hosts:
Expand All @@ -7,16 +8,14 @@ hosts:

config:
banner: |
╭──────────────────────────────────────────────────────╮
│ │
│ Update available! Mode info ï.at/update │
│ │
╰──────────────────────────────────────────────────────╯
╭────────────────────────────────────────────╮
│ │
│ Update available! More info at │
│ https://ï.at/deployer-releases │
│ │
╰────────────────────────────────────────────╯
tasks:
release:
- update_banner
- update_manifest

create_banner:
- desc: Create an update banner
- run: echo $'{{banner}}' > {{site}}/check-updates/{{old_version}}
2 changes: 1 addition & 1 deletion docs/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
```
11. Replace `local()` tasks with combination of `once()` and `runLocally()` func.
12. Replace `locateBinaryPath()` with `which()` func.
13. Configuration property `default_stage` is not supported.
13. Configuration property `default_stage` is not supported anymore and has been dropped.
14. Replace `onHosts()` and `onStage()` with [labels & selectors](selector.md).
15. Replace `setPrivate()` with [`hidden()`](tasks.md#hidden).

Expand Down
2 changes: 1 addition & 1 deletion docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
Loading

0 comments on commit ebc1cd2

Please sign in to comment.