Skip to content

Commit b73d61d

Browse files
authored
Merge pull request #4 from fortrabbit/cleanup
Cleanup
2 parents dfe1e29 + 67cdae6 commit b73d61d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+338
-691
lines changed

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/.dockerignore
2+
/.github/
3+
/.gitattributes
4+
/.gitignore
5+
/composer.lock
6+
/docker-compose.yml
7+
/docker/Dockerfile
8+
/fortrabbit-post.php
9+
/fortrabbit-pre.php
10+
/fortrabbit.yml
11+
/Justfile
12+
/storage/
13+
/vendor/

.env.example

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,18 @@
1-
APP_NAME=Laravel
1+
APP_DEBUG=true
22
APP_ENV=local
33
APP_KEY=
4-
APP_DEBUG=true
5-
APP_URL=http://localhost
6-
7-
LOG_CHANNEL=stack
8-
LOG_DEPRECATIONS_CHANNEL=null
9-
LOG_LEVEL=debug
104

115
DB_CONNECTION=mysql
12-
DB_HOST=127.0.0.1
6+
DB_HOST=mysql
137
DB_PORT=3306
14-
DB_DATABASE=laravel
8+
DB_DATABASE=testrabbit
159
DB_USERNAME=root
16-
DB_PASSWORD=
10+
DB_PASSWORD=pwd
1711

1812
MONGODB_CONNECTION="mongodb+srv://testrabbit:[email protected]/test?retryWrites=true&w=majority"
1913

20-
BROADCAST_DRIVER=log
21-
CACHE_DRIVER=file
22-
FILESYSTEM_DRIVER=local
23-
QUEUE_CONNECTION=sync
24-
SESSION_DRIVER=file
25-
SESSION_LIFETIME=120
26-
2714
MEMCACHED_HOST=127.0.0.1
2815

29-
REDIS_HOST=127.0.0.1
30-
REDIS_PASSWORD=null
31-
REDIS_PORT=6379
32-
33-
MAIL_MAILER=smtp
34-
MAIL_HOST=mailhog
35-
MAIL_PORT=1025
36-
MAIL_USERNAME=null
37-
MAIL_PASSWORD=null
38-
MAIL_ENCRYPTION=null
39-
MAIL_FROM_ADDRESS=null
40-
MAIL_FROM_NAME="${APP_NAME}"
41-
42-
AWS_ACCESS_KEY_ID=
43-
AWS_SECRET_ACCESS_KEY=
44-
AWS_DEFAULT_REGION=us-east-1
45-
AWS_BUCKET=
46-
AWS_USE_PATH_STYLE_ENDPOINT=false
47-
48-
PUSHER_APP_ID=
49-
PUSHER_APP_KEY=
50-
PUSHER_APP_SECRET=
51-
PUSHER_APP_CLUSTER=mt1
52-
53-
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
54-
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
5516

56-
# Sets parameters for testing based on platform.
57-
# E.g. new platform supports more image formats.
58-
# Options: current, new
59-
# Default: current
60-
FRBIT_PLATFORM=current
17+
APP_TYPE=pro
18+
FRBIT_PLATFORM=ubuntu22

.gitattributes

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
* text=auto
2-
*.css linguist-vendored
3-
*.scss linguist-vendored
4-
*.js linguist-vendored
5-
CHANGELOG.md export-ignore

.github/workflows/deploy.yml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,62 +6,55 @@ env:
66

77
on:
88
push:
9-
branches:
10-
- master
11-
- develop
12-
- production
13-
tags:
14-
- '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-?*'
159

1610
jobs:
1711

1812
test:
1913
runs-on: ubuntu-22.04
2014
strategy:
2115
matrix:
22-
php-version: ['7.4','8.0','8.1','8.2']
16+
php-version: ['7.4','8.0','8.1','8.2','8.3','8.4']
2317

2418
steps:
2519
- uses: actions/checkout@v3
2620

27-
- name: Login to GitHub Container Registry
28-
uses: docker/login-action@v2
29-
with:
30-
registry: ghcr.io
31-
username: ${{ github.repository_owner }}
32-
password: ${{ secrets.GITHUB_TOKEN }}
21+
# - name: Login to GitHub Container Registry
22+
# uses: docker/login-action@v2
23+
# with:
24+
# registry: ghcr.io
25+
# username: ${{ github.repository_owner }}
26+
# password: ${{ secrets.GITHUB_TOKEN }}
3327

3428
- name: Build docker image using Github Packages as cache
3529
env:
3630
PHP_VERSION: ${{ matrix.php-version }}
3731
run: |
38-
docker pull $DOCKER_REGISTRY_IMAGE:${PHP_VERSION} || true
39-
cd docker/$PHP_VERSION
40-
docker build --build-arg PHP_VERSION=${PHP_VERSION} \
41-
--cache-from $DOCKER_REGISTRY_IMAGE:${PHP_VERSION} \
32+
docker build \
33+
--file docker/Dockerfile \
34+
--build-arg PHP_VERSION=${PHP_VERSION} \
4235
--tag $DOCKER_REGISTRY_IMAGE:${PHP_VERSION} \
43-
--tag $DOCKER_REGISTRY_IMAGE:latest .
44-
docker push $DOCKER_REGISTRY_IMAGE:${PHP_VERSION}
36+
.
4537
46-
- name: Cache vendor folder
47-
uses: actions/cache@v3
48-
with:
49-
path: vendor
50-
key: vendor-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}
38+
# - name: Cache vendor folder
39+
# uses: actions/cache@v3
40+
# with:
41+
# path: vendor
42+
# key: vendor-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}
5143

52-
- name: Install dependencies
53-
run: |
54-
docker run --rm \
55-
-v $PWD:/var/www/html \
56-
$DOCKER_REGISTRY_IMAGE:${{ matrix.php-version }} \
57-
bash -c '\
58-
composer config -g github-oauth.github.com ${{ secrets.ACTIONS_TOKEN }} && \
59-
composer install --no-interaction --prefer-dist --no-scripts --no-cache'
44+
# - name: Install dependencies
45+
# run: |
46+
# docker run --rm \
47+
# -v $PWD:/var/www/html \
48+
# $DOCKER_REGISTRY_IMAGE:${{ matrix.php-version }} \
49+
# bash -c '\
50+
# composer config -g github-oauth.github.com ${{ secrets.ACTIONS_TOKEN }} && \
51+
# composer install --no-interaction --prefer-dist --no-scripts --no-cache'
6052

6153

6254
usx:
6355
runs-on: ubuntu-22.04
6456
needs: test
57+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
6558
steps:
6659
- name: Checkout
6760
uses: actions/checkout@v3
@@ -88,6 +81,7 @@ jobs:
8881
eu2:
8982
runs-on: ubuntu-22.04
9083
needs: test
84+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
9185
steps:
9286
- name: Checkout
9387
uses: actions/checkout@v3
@@ -115,6 +109,7 @@ jobs:
115109
us1:
116110
runs-on: ubuntu-22.04
117111
needs: test
112+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
118113
steps:
119114
- name: Checkout
120115
uses: actions/checkout@v3

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/public/hot
44
/public/storage
55
/public/imagick/tmp/
6+
/public/gd/tmp
67

78
/storage/*.key
89
/vendor
@@ -19,3 +20,6 @@ yarn-error.log
1920

2021
/.idea
2122
/.vscode
23+
24+
# Ignore so install works on many different PHP versions
25+
/composer.lock

.styleci.yml

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

Justfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
default: start
2+
3+
start: build
4+
docker-compose --progress=plain up -d --remove-orphans
5+
6+
stop:
7+
docker-compose down
8+
9+
build:
10+
#!/usr/bin/env bash
11+
if [ -z "$GITHUB_ACTIONS" ]; then
12+
docker-compose --progress=plain build
13+
fi
14+
15+
# Composer install is run inside the test containers instead
16+
#install: build
17+
# #!/usr/bin/env bash
18+
# rm composer.lock
19+
# if [ -n "$GITHUB_ACTIONS" ]; then
20+
# docker-compose run --rm php81 bash -c '\
21+
# composer config -g github-oauth.github.com ${GITHUB_AUTH} && \
22+
# composer install --no-interaction --prefer-dist --no-scripts --no-cache'
23+
# else
24+
# docker-compose run --rm php81 composer install
25+
# fi
26+
27+
test:
28+
#!/usr/bin/env bash
29+
set -e
30+
for port in 8074 8080 8081 8082 8083 8084; do
31+
echo "--- Testing on port $port ---"
32+
response=$(curl -fsSL "http://localhost:$port/tests/MySQL")
33+
34+
# Print the JSON structure without the message
35+
echo "$response" | jq 'del(.message)'
36+
37+
# The actual test to verify success
38+
echo "$response" | grep -q '"success":true'
39+
done
40+
echo "All tests passed!"
41+
42+
clean:
43+
rm -f public/imagick/tmp/img.*
44+
rm -f public/gd/tmp/img.*

Makefile

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

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
# Test Rabbit
22

3-
This is a repo that when deployed as a fortrabbit App uses all common features of the platform. It has an automatic test suite that is run whenever you visit the main page of the app.
3+
This is a repo that when deployed as a fortrabbit App uses all common features of the platform.
4+
It has an automatic test suite that is run whenever you visit the main page of the app.
45

5-
## Local environment
6+
This test app is designed to work on all supported PHP versions.
67

7-
```bash
8-
docker-compose up -d
9-
```
108

11-
or
9+
## Local environment
1210

1311
```bash
14-
sail up -d
12+
just start
1513
```
1614

15+
1716
## Deployment
1817

19-
This repo is already deployed to Apps in all regions and whenever you push to the `master` branch on github, a Github Action is triggered that deploys that commit to the live apps.
18+
This repo is already deployed to Apps in all regions.
19+
Whenever you push to the `master` branch on GitHub,
20+
a GitHub Action is triggered that deploys that commit to the live apps.
2021

21-
Further documentation for current platform: https://www.notion.so/fortrabbit/testrabbit-237ed2d09f6280a49ca8dfdced0310a4?source=copy_link
22+
Further documentation for current platform:
23+
https://www.notion.so/fortrabbit/testrabbit-237ed2d09f6280a49ca8dfdced0310a4
2224

2325

2426
### Initial setup for a new App

composer.json

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
"laravel/framework": "^8.75",
1515
"laravel/sanctum": "^2.11",
1616
"laravel/tinker": "^2.5",
17-
"mongodb/mongodb": "1.10"
17+
"mongodb/mongodb": "*"
1818
},
1919
"require-dev": {
2020
"facade/ignition": "^2.5",
2121
"laravel/sail": "^1.0.1",
22-
"mockery/mockery": "^1.4.4",
23-
"nunomaduro/collision": "^5.10",
24-
"phpunit/phpunit": "^9.5.10"
22+
"nunomaduro/collision": "^5.10"
2523
},
2624
"autoload": {
2725
"psr-4": {
@@ -30,11 +28,6 @@
3028
"Database\\Seeders\\": "database/seeders/"
3129
}
3230
},
33-
"autoload-dev": {
34-
"psr-4": {
35-
"Tests\\": "tests/"
36-
}
37-
},
3831
"scripts": {
3932
"post-autoload-dump": [
4033
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
@@ -50,18 +43,10 @@
5043
"@php artisan key:generate --ansi"
5144
]
5245
},
53-
"extra": {
54-
"laravel": {
55-
"dont-discover": []
56-
}
57-
},
5846
"config": {
5947
"optimize-autoloader": true,
6048
"preferred-install": "dist",
61-
"sort-packages": true,
62-
"platform": {
63-
"php": "7.4"
64-
}
49+
"sort-packages": true
6550
},
6651
"minimum-stability": "dev",
6752
"prefer-stable": true

0 commit comments

Comments
 (0)