You've already forked Php-Template
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
b1e5470a07
|
|||
|
5f9ee939d6
|
|||
|
e9a3a5885f
|
|||
|
f12559d2c3
|
|||
|
b466495ae1
|
|||
|
4eb21ace55
|
|||
|
a3e54ce989
|
|||
|
403cb4c12e
|
|||
|
9f048e408c
|
|||
|
be570a3173
|
|||
|
6353a4f19e
|
|||
|
59bcf4d2a7
|
|||
|
89bc3e75ec
|
|||
|
fb04e9c390
|
|||
|
77d66abbe0
|
|||
|
52aa7abc2d
|
|||
|
b6256a7e1d
|
|||
|
59fa57d643
|
|||
|
199921fb83
|
|||
|
aaf772dc6d
|
|||
|
89fd169067
|
|||
|
a01a0c590b
|
|||
|
dfccf9ca4f
|
|||
|
011a1e77c0
|
|||
|
7c7b538616
|
|||
|
71fa18bc17
|
|||
|
7308f33de4
|
|||
|
d0d18fd603
|
|||
|
f57406f981
|
|||
|
e46bf5a6ec
|
|||
|
02acc9afbe
|
|||
|
cdb2b28cb7
|
|||
|
118e83414d
|
@@ -7,8 +7,8 @@ name: 🧪✨ Tests Workflow
|
||||
|
||||
jobs:
|
||||
|
||||
LicenseCheck:
|
||||
name: License Check
|
||||
DatabaseMigrations:
|
||||
name: 🧪 ✨ Database Migrations
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
@@ -29,7 +29,68 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Install Composer Libraries
|
||||
- name: 🏎️ 🏁 Start Support Containers
|
||||
run: |
|
||||
echo "Starting Support Containers"
|
||||
docker run --rm \
|
||||
--network "${{ env.JOB_CONTAINER_NAME }}-${{ gitea.job }}-network" \
|
||||
--name ${{ gitea.job }}-${{ gitea.run_id }}-postgres \
|
||||
-e POSTGRES_USER=postgres \
|
||||
-e POSTGRES_PASSWORD=postgres \
|
||||
-e POSTGRES_DB=postgres \
|
||||
-p 5432 \
|
||||
-d postgres:17
|
||||
|
||||
echo "Waiting for Postgres to start"
|
||||
sleep 10
|
||||
|
||||
- name: 💽 ⬆️ Run Migrations
|
||||
run: |
|
||||
docker run \
|
||||
--name ${{ gitea.run_id }}-migrate \
|
||||
--rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
--network "${{ env.JOB_CONTAINER_NAME }}-${{ gitea.job }}-network" \
|
||||
-w ${{ github.workspace }} \
|
||||
siteworxpro/migrate:v4.18.3 -database "postgres://postgres:postgres@${{ gitea.job }}-${{ gitea.run_id }}-postgres:5432/postgres?sslmode=disable" -path db/migrations up
|
||||
|
||||
- name: 💽 ⬇️ Rollback Migrations
|
||||
run: |
|
||||
docker run \
|
||||
--name ${{ gitea.run_id }}-migrate \
|
||||
--rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
--network "${{ env.JOB_CONTAINER_NAME }}-${{ gitea.job }}-network" \
|
||||
-w ${{ github.workspace }} \
|
||||
siteworxpro/migrate:v4.18.3 -database "postgres://postgres:postgres@${{ gitea.job }}-${{ gitea.run_id }}-postgres:5432/postgres?sslmode=disable" -path db/migrations down --all
|
||||
|
||||
- name: 🧨 💥 Tear Down Support Containers
|
||||
if: always()
|
||||
run: |
|
||||
docker stop ${{ gitea.job }}-${{ gitea.run_id }}-postgres
|
||||
|
||||
LibraryAudit:
|
||||
name: 🛡️ 🔒 Library Audit
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
run: |
|
||||
apt update && apt install -yq ca-certificates curl
|
||||
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
||||
update-ca-certificates
|
||||
|
||||
- name: 📖 🔍 Checkout Repository Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: 🔑 🔐 Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: 📖 ✨ Install Composer Libraries
|
||||
run: |
|
||||
docker run --rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
@@ -37,7 +98,45 @@ jobs:
|
||||
siteworxpro/composer \
|
||||
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Run License Check
|
||||
- name: Run Library Audit
|
||||
run: |
|
||||
docker run --rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
-w ${{ github.workspace }} \
|
||||
siteworxpro/composer \
|
||||
audit
|
||||
|
||||
LicenseCheck:
|
||||
name: 🛡️ 🔒 License Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
run: |
|
||||
apt update && apt install -yq ca-certificates curl
|
||||
curl -Ls https://siteworxpro.com/hosted/Siteworx+Root+CA.pem -o /usr/local/share/ca-certificates/sw.crt
|
||||
update-ca-certificates
|
||||
|
||||
- name: 📖 🔍 Checkout Repository Code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: 🔑 🔐 Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: 📖 ✨ Install Composer Libraries
|
||||
run: |
|
||||
docker run --rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
-w ${{ github.workspace }} \
|
||||
siteworxpro/composer \
|
||||
install --ignore-platform-reqs --no-interaction --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: 🎟️ 🔬 Run License Check
|
||||
run: |
|
||||
docker run --rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
@@ -46,7 +145,7 @@ jobs:
|
||||
run tests:license
|
||||
|
||||
CodeLint:
|
||||
name: Code Lint
|
||||
name: 📝 ✨ Code Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
@@ -66,7 +165,7 @@ jobs:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Install Composer Libraries
|
||||
- name: 📖 ✨ Install Composer Libraries
|
||||
run: |
|
||||
docker run --rm \
|
||||
--volumes-from ${{ env.JOB_CONTAINER_NAME }} \
|
||||
@@ -83,7 +182,7 @@ jobs:
|
||||
run tests:lint
|
||||
|
||||
CodeSniffer:
|
||||
name: Code Sniffer
|
||||
name: 🐙 🔍 Code Sniffer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
@@ -120,7 +219,7 @@ jobs:
|
||||
run tests:phpstan
|
||||
|
||||
UnitTests:
|
||||
name: Unit Tests
|
||||
name: 🧪 ✅ Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🛡️ 🔒 Add Siteworx CA Certificates
|
||||
|
||||
17
README.md
17
README.md
@@ -10,13 +10,28 @@
|
||||
- Docker
|
||||
- Docker Compose
|
||||
|
||||
### migrations
|
||||
|
||||
create a new migration
|
||||
```shell
|
||||
docker run --rm -v $(PWD):/app siteworxpro/migrate:v4.18.3 create -ext sql -dir /app/db/migrations -seq create_users_table
|
||||
```
|
||||
|
||||
```text
|
||||
postgres://siteworxpro:password@localhost:5432/siteworxpro?sslmode=disable
|
||||
```
|
||||
|
||||
```shell
|
||||
docker run --rm -v $(PWD):/app siteworxpro/migrate:v4.18.3 -database "postgres://siteworxpro:password@localhost:5432/siteworxpro?sslmode=disable" -path /app/db/migrations up
|
||||
```
|
||||
|
||||
### Starting the Runtime
|
||||
```shell
|
||||
docker-compose up -d
|
||||
```
|
||||
### Start the server
|
||||
```shell
|
||||
docker exec -it template-runtime-1 rr serve
|
||||
docker exec -it template-dev-runtime-1 rr serve
|
||||
```
|
||||
|
||||
You can access the api at `http://localhost:9501/`
|
||||
|
||||
Reference in New Issue
Block a user