Skip to content

Commit ee24fc3

Browse files
committed
Add support for Laravel 12
1 parent 8b184f5 commit ee24fc3

13 files changed

+198
-744
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
ARG IMAGE_VERSION
1+
ARG IMAGE_VERSION="8.2-node-20"
2+
23
FROM pionl/docker-php-laravel-ci:${IMAGE_VERSION}
34

45
WORKDIR /app
@@ -7,7 +8,7 @@ COPY . .
78

89
RUN npm install
910

10-
ARG LARAVEL_VERSION
11+
ARG LARAVEL_VERSION="12.*"
1112

1213
RUN composer self-update
1314
RUN node setup.js ${LARAVEL_VERSION} --verbose

_setup/getVersions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function getVersions (userInput) {
1010

1111
versions.forEach(version => {
1212
const preferredVersion = version.laravel === useOnlyGivenVersion;
13+
1314
if (useOnlyGivenVersion === null || preferredVersion) {
1415
noVersions = false;
1516

_setup/runTests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const path = require('path');
1212
*/
1313
async function runTests (version, currentDirectory, verbose) {
1414
const dockerComposeArgs = [
15+
'compose',
1516
'-f',
1617
'docker-compose.yml',
1718
'-f',
@@ -31,7 +32,7 @@ async function runTests (version, currentDirectory, verbose) {
3132
console.log(`${versionMessage} ${imageVersionMessage}`)
3233

3334
const result = await run(
34-
'docker-compose', dockerComposeArgs, currentDirectory, verbose, environmentVars
35+
'docker', dockerComposeArgs, currentDirectory, verbose, environmentVars
3536
);
3637

3738
return result.exitCode === 0

_setup/versionsRecursively.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ async function versionsRecursively (versions, onVersion, versionIndex = 0) {
1212

1313
const version = versions[versionIndex];
1414

15+
1516
await onVersion(version)
1617

18+
1719
return versionsRecursively(versions, onVersion, versionIndex + 1)
1820
}
1921

docker-compose-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
codeceptjs:
43
image: codeception/codeceptjs

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: '3'
21
services:
32
laravel:
43
build:

package-lock.json

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

readme.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ Open http://localhost:8000
4444
4545
| Laravel | PHP | Run | Tests |
4646
|---------|---------------------------------------|-------------------|------------------------|
47-
| 10.* | 8.2-node-20, 8.2-node-20 | `node run "11.*"` | `node tests.js "11.*"` |
47+
| 12.* | 8.2-node-20 | `node run "12.*"` | `node tests.js "12.*"` |
48+
| 11.* | 8.2-node-20 | `node run "11.*"` | `node tests.js "11.*"` |
4849
| 10.* | 8.1-node-17, 8.2-node-18 | `node run "10.*"` | `node tests.js "10.*"` |
4950
| 9.* | 8.0-node-17, 8.1-node-17, 8.2-node-18 | `node run "9.*"` | `node tests.js "9.*"` |
5051
| 8.* | 7.4-node-17, 8.0-node-17, 8.1-node-17 | `node run "8.*"` | `node tests.js "8.*"` |
@@ -78,9 +79,11 @@ node tests.js "8.*"
7879
* `abort-on-container-exit` needs to be used to stop the Laravel server.
7980

8081
```bash
81-
IMAGE_VERSION=7.4 LARAVEL_VERSION=8.\* docker-compose -f docker-compose.yml -f docker-compose-tests.yml up --abort-on-container-exit
82+
IMAGE_VERSION=8.2-node-20 LARAVEL_VERSION=12.\* docker compose -f docker-compose.yml -f docker-compose-tests.yml up --abort-on-container-exit
8283
```
8384

85+
We are using docker images built for [Laravel](https://github.com/pionl/docker-php-laravel-ci)
86+
8487
## Testing Your Contribution
8588

8689
> Do not commit your changes - use a pull request in the main repo.
@@ -93,6 +96,12 @@ pr.sh <your-github-username> <branch = default is master> <repository-name = lar
9396
```
9497
* Run tests on all versions with `node tests.js` to ensure backward compatibility.
9598

99+
### Getting current master when PR is merged
100+
101+
```
102+
bash update.sh
103+
```
104+
96105
## Adding Support for a New Laravel Release
97106

98107
- Docker and Docker Compose installed.

run.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ async function main () {
3939
}
4040

4141
await versionsRecursively(useGivenVersions, async function (version) {
42-
await run('docker-compose', ['up', '--build'], currentDirectory, cli.flags.verbose, {
42+
43+
await run('docker', ['compose', 'up', '--build'], currentDirectory, cli.flags.verbose, {
4344
IMAGE_VERSION: version.image_version,
4445
LARAVEL_VERSION: version.laravel,
4546
} );

setup.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ async function main () {
5353

5454
const useGivenVersions = getVersions(cli.input);
5555

56+
console.log('Setting up versions: ', useGivenVersions)
5657
await versionsRecursively(useGivenVersions, async function (version) {
5758
await setupVersion(version, currentDirectory, cli.flags.verbose)
5859
});

update.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
cd laravel-chunk-upload
4+
git fetch
5+
git reset --hard
6+
git checkout master
7+
git pull

versions.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,17 @@
3838
{
3939
"laravel": "11.*",
4040
"image_version": "8.2-node-20"
41+
},
42+
{
43+
"laravel": "12.*",
44+
"image_version": "8.2-node-20"
45+
},
46+
{
47+
"laravel": "12.*",
48+
"image_version": "8.3-node-22"
49+
},
50+
{
51+
"laravel": "12.*",
52+
"image_version": "8.4-node-22"
4153
}
4254
]

0 commit comments

Comments
 (0)