Skip to content

Commit db205f1

Browse files
author
Jonathan Visser
committed
Merge branch 'master' into add-support-for-php84-update-dependancies
2 parents ba61c17 + 55b440d commit db205f1

File tree

15 files changed

+171
-61
lines changed

15 files changed

+171
-61
lines changed

.github/workflows/publish.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ jobs:
1414
- "8.3"
1515
- "8.4"
1616
node_version:
17-
- 12
18-
- 14
1917
- 16
2018
- 18
2119
- 20
20+
- 22
2221
runs-on: ubuntu-latest
2322
env:
2423
PHP_VERSION: ${{ matrix.php_version }}
2524
NODE_VERSION: ${{ matrix.node_version }}
2625
LATEST_PHP_VERSION: 8.3
27-
LATEST_NODE_VERSION: 20
26+
LATEST_NODE_VERSION: 22
2827
steps:
2928
- name: Checkout hypernode-deploy
3029
uses: actions/checkout@v3

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
integration_test:
77
strategy:
88
matrix:
9-
php_version: [8.2, 8.3] # 8.4 is disabled for now, since Magento 2 does not support this yet.
9+
php_version: [8.1, 8.2, 8.3]
1010
testsuite: [general, brancher]
1111
runs-on: ubuntu-latest
1212
steps:

bin/hypernode-deploy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
\define('WORKING_DIR', getcwd());
1010
\define('APPLICATION_ROOT', \dirname(__DIR__));
1111

12-
$customAutoLoadPath = WORKING_DIR . '/vendor/autoload.php';
1312
// Allows to specify a custom autoload path to avoid overriding Hipex deploy packages
1413
// when the same packages are used by your application and Hipex Deploy.
1514
if (getenv('DEPLOY_AUTOLOAD_PATH') !== false) {
1615
$customAutoLoadPath = getenv('DEPLOY_AUTOLOAD_PATH');
17-
}
1816

19-
if (file_exists($customAutoLoadPath)) {
20-
require_once $customAutoLoadPath;
17+
if (file_exists($customAutoLoadPath)) {
18+
require_once $customAutoLoadPath;
19+
}
2120
}
2221

22+
2323
/** @var \Composer\Autoload\ClassLoader $loader */
2424
$loader = require_once APPLICATION_ROOT . '/vendor/autoload.php';
2525
if (!array_key_exists('Deployer\\', $loader->getPrefixesPsr4())) {

ci/build/Dockerfile

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,33 @@ ARG PHP_VERSION
55

66
ENV DEBIAN_FRONTEND=noninteractive
77

8-
RUN apt-get update \
9-
&& apt-get install -y --no-install-recommends \
10-
git zip unzip wget \
11-
&& rm -rf /var/lib/apt/lists/*
8+
RUN apt-get update
9+
10+
RUN apt-get install -y --no-install-recommends \
11+
git zip unzip wget
1212

1313
# Add repositories
14-
RUN apt-get update \
15-
&& apt-get install -y --no-install-recommends \
16-
apt-transport-https \
17-
ca-certificates \
18-
curl \
19-
gnupg-agent \
20-
gnupg \
21-
software-properties-common \
22-
gettext-base \
23-
&& rm -rf /var/lib/apt/lists/* \
24-
&& curl -sSL http://debian.hypernode.com/repo.key | apt-key add - \
25-
&& echo "deb http://debian.hypernode.com bookworm main hypernode" | tee /etc/apt/sources.list.d/hypernode.list \
26-
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
27-
&& echo "deb http://deb.nodesource.com/node_${NODE_VERSION}.x bookworm main" | tee /etc/apt/sources.list.d/nodesource.list \
14+
RUN apt-get install -y --no-install-recommends \
15+
apt-transport-https \
16+
ca-certificates \
17+
curl \
18+
gnupg-agent \
19+
gnupg \
20+
software-properties-common \
21+
gettext-base
22+
23+
RUN apt-get clean \
24+
&& curl -fsSL http://debian.hypernode.com/repo.key | gpg --dearmor -o /usr/share/keyrings/hypernode.gpg \
25+
&& echo "deb [signed-by=/usr/share/keyrings/hypernode.gpg] http://debian.hypernode.com bookworm main hypernode" > /etc/apt/sources.list.d/hypernode.list \
2826
&& echo \
29-
"Package: * \
30-
Pin origin deb.nodesource.com \
31-
Pin-Priority: 1001" > /etc/apt/preferences.d/nodejs
27+
"Package: * \
28+
Pin origin debian.hypernode.com \
29+
Pin-Priority: 1000" > /etc/apt/preferences.d/hypernode
30+
31+
RUN curl -fsSL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
3232

3333
# Install dependencies
34-
RUN apt-get update && \
35-
apt-get install -y --no-install-recommends \
34+
RUN apt-get install -y --no-install-recommends \
3635
openssh-client \
3736
rsync \
3837
git \
@@ -52,9 +51,12 @@ RUN apt-get update && \
5251
nodejs \
5352
gnupg \
5453
zip \
55-
bc \
56-
&& apt install -y --no-install-recommends \
54+
bc
55+
56+
# Install PHP
57+
RUN apt-get install -y --no-install-recommends \
5758
php${PHP_VERSION} \
59+
php${PHP_VERSION}-amqp \
5860
php${PHP_VERSION}-bcmath \
5961
php${PHP_VERSION}-bz2 \
6062
php${PHP_VERSION}-cli \
@@ -77,8 +79,10 @@ RUN apt-get update && \
7779
php${PHP_VERSION}-soap \
7880
php${PHP_VERSION}-tidy \
7981
php${PHP_VERSION}-xml \
80-
php${PHP_VERSION}-zip \
81-
&& rm -rf /var/lib/apt/lists/*
82+
php${PHP_VERSION}-zip
83+
84+
# Confirm NodeJS & NPM are installed
85+
RUN node -v && npm -v
8286

8387
COPY ./.git /hypernode/.git
8488
COPY ./bin /hypernode/bin
@@ -127,6 +131,9 @@ RUN rm -rvf \
127131
/var/lib/apt/lists/* \
128132
&& apt-get autoremove -y
129133

134+
# Allow hypernode-deploy to be ran in ordinary git repository locations
135+
RUN git config --global --add safe.directory "*"
136+
130137
# Setup default command
131138
CMD ["hypernode-deploy"]
132139

ci/release_semantic_versions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if echo "${INPUT_VERSION}" | grep -F "."; then
4040
fi
4141

4242
tag_and_publish "$LOCAL_IMAGE_TAG" "$IMAGE:$MAJOR_VERSION-$TAG_SPECS"
43+
tag_and_publish "$LOCAL_IMAGE_TAG" "$IMAGE:latest-$TAG_SPECS"
4344
fi
4445

4546
if [[ "${PHP_VERSION}" == "${LATEST_PHP_VERSION}" ]] && [[ "${NODE_VERSION}" == "${LATEST_NODE_VERSION}" ]]; then

ci/test/run-brancher.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ DP="docker run --rm -v /tmp/m2build:/web -e HYPERNODE_API_TOKEN -e SSH_PRIVATE_K
1010
# Build Docker image
1111
docker build \
1212
-f ci/build/Dockerfile \
13-
--build-arg NODE_VERSION=16 \
13+
--build-arg NODE_VERSION=22 \
1414
--build-arg PHP_VERSION="${PHP_VERSION:-8.2}" \
1515
-t hndeploy \
1616
.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"doctrine/annotations": "^1.6",
1717
"guzzlehttp/guzzle": "^7.5",
1818
"hypernode/api-client": "^0.4",
19-
"hypernode/deploy-configuration": "^3.2",
19+
"hypernode/deploy-configuration": "^3.4",
2020
"php-di/php-di": "^7.0",
2121
"psr/log": "^1.0",
2222
"symfony/console": "^5.4",

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ private function initContainer(): Container
6363

6464
$container = $builder->build();
6565

66+
if (!defined('DEPLOYER_VERSION')) {
67+
define("DEPLOYER_VERSION", sprintf("Hypernode Deploy %s", $this->getVersion()));
68+
}
69+
6670
$this->registerTwigLoader($container);
6771

6872
return $container;

src/Brancher/BrancherHypernodeManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ public function waitForAvailability(string $brancherHypernode, int $timeout = 15
128128

129129
try {
130130
$flows = $this->hypernodeClient->logbook->getList($brancherHypernode);
131-
$relevantFlows = array_filter($flows, fn(Flow $flow) => $flow->name === 'ensure_app');
132-
$failedFlows = array_filter($flows, fn(Flow $flow) => $flow->isReverted());
133-
$completedFlows = array_filter($flows, fn(Flow $flow) => $flow->isComplete());
131+
$relevantFlows = array_filter($flows, fn(Flow $flow) => in_array($flow->name, ["ensure_app", "ensure_copied_app"], true));
132+
$failedFlows = array_filter($relevantFlows, fn(Flow $flow) => $flow->isReverted());
133+
$completedFlows = array_filter($relevantFlows, fn(Flow $flow) => $flow->isComplete());
134134

135135
if (count($failedFlows) === count($relevantFlows)) {
136136
throw new CreateBrancherHypernodeFailedException();

0 commit comments

Comments
 (0)