Skip to content

Commit f706326

Browse files
authored
Merge branch 'develop' into wip/support-uploading-packages-update-manager-changes
2 parents a4d137a + 2cd054e commit f706326

File tree

19 files changed

+120
-95
lines changed

19 files changed

+120
-95
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,32 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
22
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
33
{
4-
"name": "Winter on PHP 8.3",
5-
"build": {
6-
"dockerfile": "./Dockerfile",
7-
"context": "."
8-
},
4+
"name": "Winter on PHP 8.4",
5+
"image": "ghcr.io/wintercms/winter:latest",
96
"features": {
107
"ghcr.io/devcontainers/features/common-utils:2": {
11-
"installZsh": "true",
8+
"installZsh": true,
129
"configureZshAsDefaultShell": true,
13-
"username": "vscode",
14-
"userUid": "1000",
15-
"userGid": "1000",
16-
"upgradePackages": "true"
17-
},
18-
"ghcr.io/devcontainers/features/node:1": {
19-
"version": "22"
10+
"username": "winter",
11+
"upgradePackages": false
2012
},
21-
"ghcr.io/devcontainers/features/git:1": {},
2213
"ghcr.io/devcontainers/features/github-cli:1": {},
23-
"./local-features/apache-config": "latest",
2414
// Comment the following feature if you wish to bootstrap and configure Winter manually (ie. you wish to use this for your own project)
2515
"./local-features/bootstrap-winter": "latest"
2616
},
27-
"overrideFeatureInstallOrder": [
28-
"ghcr.io/devcontainers/features/common-utils"
29-
],
17+
"workspaceMount": "source=${localWorkspaceFolder},target=/winter,type=bind",
18+
"workspaceFolder": "/winter",
3019
"containerEnv": {
20+
"APP_DEBUG": "true",
21+
"XDEBUG_MODE": "debug",
22+
"ROUTES_CACHE": "false",
23+
"ASSET_CACHE": "false",
3124
"DB_CONNECTION": "sqlite",
3225
"DB_DATABASE": "${containerWorkspaceFolder}/storage/database.sqlite"
3326
},
34-
"postStartCommand": "sudo rm -rf /var/www/html && sudo ln -s ${containerWorkspaceFolder} /var/www/html && service apache2 start",
35-
"forwardPorts": [8080],
27+
"forwardPorts": [8000],
3628
"portsAttributes": {
37-
"8080": {
29+
"8000": {
3830
"label": "Preview Winter installation",
3931
"onAutoForward": "openPreview"
4032
},
@@ -63,5 +55,6 @@
6355
]
6456
}
6557
},
66-
"remoteUser": "vscode"
58+
"postAttachCommand": "nohup ${containerWorkspaceFolder}/.devcontainer/run-frankenphp.sh > /dev/null 2>&1",
59+
"remoteUser": "winter"
6760
}

.devcontainer/local-features/apache-config/devcontainer-feature.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.devcontainer/local-features/apache-config/install.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

.devcontainer/local-features/bootstrap-winter/bootstrap.sh

100644100755
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
set -e
44

5-
echo "### Updating Composer dependencies"
6-
php ${PWD}/.devcontainer/local-features/bootstrap-winter/update-composer.php
7-
composer update --no-interaction --no-scripts --no-audit
5+
if [ ! -d "${PWD}/vendor" ] && [ ! -f "${PWD}/composer.lock" ]; then
6+
echo "### Updating Composer dependencies"
7+
php ${PWD}/.devcontainer/local-features/bootstrap-winter/update-composer.php
8+
composer update --no-interaction --no-scripts --no-audit
9+
fi
810

911
if [ ! -f "${PWD}/.env" ]; then
1012
echo "### Generating .env file"
@@ -21,14 +23,14 @@ fi
2123
echo "### Run migrations"
2224
php artisan migrate
2325

26+
echo "### Set theme"
27+
php artisan theme:use workshop
28+
2429
if [ "${SETUP_ADMIN}" = true ]; then
2530
echo "### Setup admin"
2631
php artisan winter:passwd admin admin
2732
fi
2833

29-
echo "### Switch theme"
30-
php artisan theme:use workshop
31-
3234
echo "### Ignoring files in Git"
3335
echo "plugins/*" >> "${PWD}/.git/info/exclude"
3436
echo "themes/*" >> "${PWD}/.git/info/exclude"
@@ -38,9 +40,12 @@ git restore config
3840

3941
cp ${PWD}/.devcontainer/.vscode/launch.json ${PWD}/.vscode/launch.json
4042

43+
echo "### Mirror site to public directory"
44+
php artisan winter:mirror public
45+
4146
if [ "${CODESPACES}" = "true" ]; then
4247
echo "### Configure for Codespaces"
4348
php ${PWD}/.devcontainer/local-features/bootstrap-winter/codespaces.php
4449
git update-index --assume-unchanged config/app.php
45-
gh codespace ports visibility 8080:public -c $CODESPACE_NAME
50+
gh codespace ports visibility 8000:public -c $CODESPACE_NAME
4651
fi

.devcontainer/local-features/bootstrap-winter/install.sh

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22

33
set -e
44

5+
# Install Xdebug extension
6+
install-php-extensions xdebug
7+
58
echo "Done"

.devcontainer/local-features/bootstrap-winter/update-composer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
}
1717
}
1818

19+
// Change Merge plugin config
20+
$composer['extra']['merge-plugin']['include'] = [
21+
'plugins/*/*/composer.json',
22+
];
23+
1924
file_put_contents(
2025
$composerPath,
2126
json_encode($composer, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)

.devcontainer/run-frankenphp.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
USER_ID=$(id -u)
6+
GROUP_ID=$(id -g)
7+
8+
# Ensure the Caddy config and data directories are owned by the current user
9+
sudo chown -R $USER_ID:$GROUP_ID /config/caddy
10+
sudo chown -R $USER_ID:$GROUP_ID /data/caddy
11+
sudo touch /var/log/frankenphp.log
12+
sudo chown $USER_ID:$GROUP_ID /var/log/frankenphp.log
13+
14+
# Run server in background
15+
if [ "${CODESPACES}" = "true" ]; then
16+
# Ensure environment variables are set correctly for Codespaces
17+
SERVER_NAME="http://:8000" APP_URL="https://${CODESPACE_NAME}-8000.app.github.dev" /usr/local/bin/frankenphp run -c /etc/frankenphp/Caddyfile -a caddyfile > /var/log/frankenphp.log 2>&1 &
18+
else
19+
/usr/local/bin/frankenphp run -c /etc/frankenphp/Caddyfile -a caddyfile > /var/log/frankenphp.log 2>&1 &
20+
fi
21+

.github/workflows/code-quality.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ on:
99
- 1.2
1010
- develop
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
codeQuality:
1418
runs-on: ubuntu-latest
1519
name: PHP
1620
steps:
17-
- name: Cancel previous incomplete runs
18-
uses: styfle/cancel-workflow-action@0.8.0
19-
with:
20-
access_token: ${{ github.token }}
21-
2221
- name: Checkout changes
2322
uses: actions/checkout@v2
2423
with:

.github/workflows/tests.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- develop
88
pull_request:
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
frontendTests:
1216
strategy:
@@ -22,11 +26,6 @@ jobs:
2226
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
2327
key: winter-cms-cache-develop
2428
steps:
25-
- name: Cancel previous incomplete runs
26-
uses: styfle/cancel-workflow-action@0.8.0
27-
with:
28-
access_token: ${{ github.token }}
29-
3029
- name: Checkout changes
3130
uses: actions/checkout@v3
3231

@@ -104,13 +103,8 @@ jobs:
104103
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_sqlite, sqlite3, xml, zip
105104
key: winter-cms-cache-develop
106105
steps:
107-
- name: Cancel previous incomplete runs
108-
uses: styfle/cancel-workflow-action@0.8.0
109-
with:
110-
access_token: ${{ github.token }}
111-
112106
- name: Checkout changes
113-
uses: actions/checkout@v2
107+
uses: actions/checkout@v3
114108

115109
- name: Setup extension cache
116110
id: extcache

0 commit comments

Comments
 (0)