Skip to content

Instantly share code, notes, and snippets.

View chadwcarlson's full-sized avatar
💭
🍉

Chad Carlson chadwcarlson

💭
🍉
View GitHub Profile
@chadwcarlson
chadwcarlson / next.platform.app.yaml
Created April 18, 2024 18:11
next.platform.app.yaml
name: "myapp"
stack:
- "nodejs@20"
hooks:
build: |
set -eux
npm install
npm run build
web:
commands:
@chadwcarlson
chadwcarlson / .environment-sub-bridge
Created November 29, 2023 15:01
Replacing laravel bridge
# Set database environment variables
export DB_HOST="$MARIADB_HOST"
export DB_PORT="$MARIADB_PORT"
export DB_PATH="$MARIADB_PATH"
export DB_USERNAME="$MARIADB_USERNAME"
export DB_PASSWORD="$MARIADB_PASSWORD"
export DB_SCHEME="$MARIADB_SCHEME"
export DATABASE_URL="${DB_SCHEME}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_PATH}"
# Set Laravel-specific environment variables
@chadwcarlson
chadwcarlson / local.sh
Created August 30, 2023 20:08
Flask (cookiecutter-flask) local on Platform.sh
#!/usr/bin/env bash
# Cleanup
rm -rf env
rm -rf migrations
rm -rf Platformify_Cookies/static
rm -rf node_modules
platform tunnel:close -y
# Setup a virtual environment
#!/usr/bin/env bash
# pbt - Platform.sh Build Tools
# 1) build cache handling
# 2) common framework recipes
#
# What also could change?
# - any variable defined in variables in .platform.app.yaml
# - Using a specific variables.pbt for cache handling config
# - A forced rebuild environment variable (to catch other cases)
# - composability: resusing the caching logic for dirs and build deps --> cached-poetry; cached-pip
deploy:
name: 'Deploy to Platform.sh'
needs: [build-frontend, coder, install]
runs-on: ubuntu-latest
# Deploy to Platform.sh only for branches.
if: ${{ github.event_name == 'push' }}
env:
GITHUB_REF: ${{ github.event.ref }}
steps:
- name: Extract branch name
name: magento
type: 'php:7.4'
build:
flavor: composer
hooks:
build: |
php ./vendor/bin/ece-tools build:generate
php ./vendor/bin/ece-tools build:transfer
@chadwcarlson
chadwcarlson / post-deploy.yaml
Last active August 10, 2022 15:43
Updating a Platform.sh integration's `target_url` to display failed activity logs
---
name: Post-deploy
on:
push:
branches-ignore:
- 'master'
env:
PLATFORMSH_CLI_TOKEN: ${{ secrets.CLI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACC_MIN: 0.80
{
"documentId": "de1c2adbb897effdfe0deae32a01035e46f932ce",
"rank": 1,
"relurl": "/configuration/app/web.html#locations",
"section": "Web",
"site": "docs",
"text": " The locations block is the most powerful, and potentially most involved, section of the .platform.app.yaml file. It allows you to control how the application container responds to incoming requests at a very fine-grained level. Common patterns also vary between language containers due to the way PHP-FPM handles incoming requests.\nEach entry of the locations block is an absolute URI path (with leading /) and its value includes the configuration directives for how the web server should handle matching requests. That is, if your domain is example.com then '/' means “requests for example.com/”, while '/admin' means “requests for example.com/admin”. If multiple blocks could match an incoming request then the most-specific will apply.\nweb:locations:'/':# Rules for all requests that don't oth
{
"site": "website",
"source": "secondary",
"rank": 3,
"documentId": "1f80afed50618a7f5be17adaaf31af33",
"title": "Web",
"description": "",
"text": " The web key defines a single web instance container running a single web server process (currently Nginx), behind which runs your application. The web key configures the web server, including what requests should be served directly (such as static files) and which should be passed to your application. The server is extremely flexible, which means that some configurations will be more involved than others. Additionally, defaults may vary somewhat between different language base images (specified by the type key of .platform.app.yaml). The first section on this page explains the various options the file supports. If you prefer, the later sections include various example configurations to demonstrate common patterns and configurations. You can also examine the .platform.app.yaml files of the provided proje