-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add deployment details, improve environment * node linter fixes * formatting * fix deploy-to-beta-manually.yml workflow
- Loading branch information
Showing
20 changed files
with
212 additions
and
231 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
|
@@ -19,3 +19,4 @@ yarn-error.log | |
google-credentials.json | ||
.idea/ | ||
.composer | ||
.deployment |
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 |
---|---|---|
@@ -1,33 +1,59 @@ | ||
DOCKER_COMPOSE_BETA_FILENAME=docker-compose.beta.yml | ||
BETA_DOCKER_EXEC=docker compose --file ${DOCKER_COMPOSE_BETA_FILENAME} exec --workdir /application/environment/scripts | ||
DOCKER_COMPOSE_BETA_FILENAME = docker-compose.beta.yml | ||
BETA_DOCKER_EXEC = docker compose --file ${DOCKER_COMPOSE_BETA_FILENAME} exec --workdir /application/environment/scripts | ||
|
||
DOCKER_COMPOSE_PROD_FILENAME=docker-compose.prod.yml | ||
PROD_DOCKER_EXEC=docker compose --file ${DOCKER_COMPOSE_PROD_FILENAME} exec --workdir /application/environment/scripts | ||
DOCKER_COMPOSE_PROD_FILENAME = docker-compose.prod.yml | ||
PROD_DOCKER_EXEC = docker compose --file ${DOCKER_COMPOSE_PROD_FILENAME} exec --workdir /application/environment/scripts | ||
|
||
export COMPOSE_DOCKER_CLI_BUILD = 1 | ||
export DOCKER_BUILDKIT = 1 | ||
|
||
.PHONY: beta-deploy | ||
beta-deploy: | ||
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose --file ${DOCKER_COMPOSE_BETA_FILENAME} build --pull && \ | ||
beta-deploy: create-deployment-file | ||
docker compose --file ${DOCKER_COMPOSE_BETA_FILENAME} build --pull && \ | ||
docker compose --file ${DOCKER_COMPOSE_BETA_FILENAME} up --detach && \ | ||
echo "App post deploy actions" && \ | ||
${BETA_DOCKER_EXEC} toby-beta-php bash post-deploy-actions.sh && \ | ||
echo "Worker post deploy actions" && \ | ||
${BETA_DOCKER_EXEC} toby-beta-worker bash post-deploy-actions.sh && \ | ||
echo "Scheduler post deploy actions" && \ | ||
${BETA_DOCKER_EXEC} toby-beta-scheduler bash post-deploy-actions.sh | ||
|
||
.PHONY: beta-reload-config | ||
beta-reload-config: | ||
echo "App config reload" && \ | ||
${BETA_DOCKER_EXEC} toby-beta-php bash reload-config.sh && \ | ||
echo "Worker config reload" && \ | ||
${BETA_DOCKER_EXEC} toby-beta-worker bash reload-config.sh && \ | ||
echo "Scheduler config reload" && \ | ||
${BETA_DOCKER_EXEC} toby-beta-scheduler bash reload-config.sh | ||
|
||
.PHONY: prod-deploy | ||
prod-deploy: | ||
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose --file ${DOCKER_COMPOSE_PROD_FILENAME} build --pull && \ | ||
prod-deploy: create-deployment-file | ||
docker compose --file ${DOCKER_COMPOSE_PROD_FILENAME} build --pull && \ | ||
docker compose --file ${DOCKER_COMPOSE_PROD_FILENAME} up --detach && \ | ||
echo "App post deploy actions" && \ | ||
${PROD_DOCKER_EXEC} toby-prod-php bash post-deploy-actions.sh && \ | ||
echo "Worker post deploy actions" && \ | ||
${PROD_DOCKER_EXEC} toby-prod-worker bash post-deploy-actions.sh && \ | ||
echo "Scheduler post deploy actions" && \ | ||
${PROD_DOCKER_EXEC} toby-prod-scheduler bash post-deploy-actions.sh | ||
|
||
.PHONY: prod-reload-config | ||
prod-reload-config: | ||
echo "App config reload" && \ | ||
${PROD_DOCKER_EXEC} toby-prod-php bash reload-config.sh && \ | ||
echo "Worker config reload" && \ | ||
${PROD_DOCKER_EXEC} toby-prod-worker bash reload-config.sh && \ | ||
echo "Scheduler config reload" && \ | ||
${PROD_DOCKER_EXEC} toby-prod-scheduler bash reload-config.sh | ||
|
||
|
||
DEPLOYMENT_PROJECT_VERSION = $(shell ./environment/scripts/version.sh --long) | ||
DEPLOYMENT_DATETIME = $(shell date --rfc-3339=seconds) | ||
|
||
.PHONY: create-deployment-file | ||
create-deployment-file: | ||
@echo "\ | ||
DEPLOY_DATE='${DEPLOYMENT_DATETIME}'\n\ | ||
DEPLOY_VERSION='${DEPLOYMENT_PROJECT_VERSION}'\ | ||
" > .deployment |
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
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 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
return [ | ||
"version" => env("DEPLOY_VERSION", default: "---"), | ||
"date" => env("DEPLOY_DATE", default: "---"), | ||
]; |
This file was deleted.
Oops, something went wrong.
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
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
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
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,25 @@ | ||
ARG NGINX_VERSION=1.23-alpine | ||
ARG NODE_VERSION=19-alpine3.16 | ||
|
||
### FRONTEND ### | ||
FROM node:${NODE_VERSION} as frontend | ||
|
||
WORKDIR /app_frontend_dependencies | ||
|
||
COPY package.json package-lock.json postcss.config.js tailwind.config.js vite.config.js webpack.config.js webpack.mix.js ./ | ||
|
||
RUN npm clean-install | ||
|
||
COPY resources/js ./resources/js/ | ||
COPY resources/css ./resources/css/ | ||
|
||
RUN npm run build | ||
|
||
### WEB SERVER ### | ||
FROM nginx:${NGINX_VERSION} as webserver | ||
|
||
WORKDIR /application | ||
|
||
COPY --from=frontend /app_frontend_dependencies/public/build ./public/build/ | ||
COPY /public/favicon.ico /public/robots.txt /public/index.php ./public/ | ||
COPY /public/img ./public/img/ |
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.