-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47bf565
commit 862cf55
Showing
307 changed files
with
15,134 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/composer.lock | ||
/package-lock.json | ||
/.git | ||
/Makefile | ||
/resources/ops/*/Dockerfile | ||
/node_modules/ | ||
/vendor/ | ||
/storage/logs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[docker-compose.yml] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
APP_NAME="Tooling Procurement Centre" | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://127.0.0.1:8000 | ||
|
||
LOG_CHANNEL=stack | ||
LOG_LEVEL=debug | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=mariadb | ||
DB_PORT=3306 | ||
DB_DATABASE=tp_centre | ||
DB_USERNAME=tpc | ||
DB_PASSWORD=tpc | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DRIVER=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
REDIS_HOST=redis-master | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
PROMETHEUS_REDIS_PREFIX=PROMETHEUS_ | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=mailhog | ||
MAIL_PORT=1025 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS=null | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
AWS_USE_PATH_STYLE_ENDPOINT=false | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: CI | ||
on: [ push, workflow_dispatch ] | ||
jobs: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: php-actions/composer@v6 | ||
with: | ||
php_version: 8.0 | ||
|
||
- name: Launch TDD process using PHPUnit | ||
uses: php-actions/phpunit@v3 | ||
with: | ||
bootstrap: vendor/autoload.php | ||
configuration: phpunit.xml | ||
env: | ||
TEST_NAME: TPCentre | ||
APP_KEY: base64:2NCh00CfUJ89QkCz2Ez8jMMkRnlR81pFLCdN/Mp4O5Q= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Vulnerability | ||
on: [ push, workflow_dispatch ] | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'template' | ||
template: '@/contrib/sarif.tpl' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/public/mix-manifest.json | ||
/public/favicon.ico | ||
/public/assets | ||
/vendor | ||
.env | ||
.env.backup | ||
.phpunit.result.cache | ||
docker-compose.override.yml | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
/public/css | ||
/public/js | ||
.idea/ | ||
.DS_* | ||
._DS* | ||
|
||
# No lock files, allow updates for security | ||
# ... manage versions, rely on CI and TDD | ||
composer.lock | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- no_unused_imports | ||
finder: | ||
not-name: | ||
- index.php | ||
- server.php | ||
js: | ||
finder: | ||
not-name: | ||
- webpack.mix.js | ||
css: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020-2021 Crown Copyright (Ministry of Justice) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.PHONY: dshell | ||
|
||
d-compose: | ||
docker-compose up -d nginx phpmyadmin | ||
docker-compose run --service-ports --rm --entrypoint=bash php | ||
|
||
dshell: | ||
[ -f "./.env" ] || cp .env.example .env | ||
echo "http://127.0.0.1:8080/" > public/hot | ||
make d-compose | ||
|
||
setup: | ||
composer install | ||
php artisan key:generate | ||
php artisan migrate | ||
php artisan db:seed | ||
php artisan notify:restart | ||
|
||
restart: | ||
docker-compose down | ||
make d-compose | ||
|
||
db-migrate: | ||
php artisan db:wipe | ||
php artisan migrate | ||
php artisan db:seed | ||
|
||
test: | ||
php artisan test | ||
|
||
# Remove ignored git files | ||
clean: | ||
@if [ -d ".git" ]; then git clean -xdf --exclude ".env" --exclude ".idea"; fi | ||
|
||
node-assets: | ||
npm install | ||
npm run watch | ||
|
||
bash-nginx: | ||
docker compose exec --workdir /var/www/html nginx bash | ||
|
||
bash-node: | ||
docker compose exec --workdir /node node bash | ||
|
||
##### | ||
## Production CI mock | ||
##### | ||
|
||
build-nginx: | ||
docker image build -f resources/ops/docker/nginx/Dockerfile -t tp-centre-nginx:latest --target nginx . | ||
|
||
build-fpm: | ||
docker image build -f resources/ops/docker/fpm/Dockerfile -t tp-centre-fpm:latest --target fpm . | ||
|
||
build: | ||
make build-fpm | ||
make build-nginx | ||
|
||
ks-apply: | ||
kubectl apply -f resources/ops/kubernetes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.