Skip to content

Workflow match #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions templates/django3/files/.platform.app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ web:
socket_family: unix
# Commands are run once after deployment to start the application process.
commands:
start: "gunicorn -w 4 -b unix:$SOCKET myapp.wsgi:application"
start: "pipenv run gunicorn -w 4 -b unix:$SOCKET myapp.wsgi:application"
locations:
"/":
passthru: true
Expand All @@ -56,10 +56,10 @@ hooks:
pipenv install --system --deploy

mkdir logs
python manage.py collectstatic
pipenv run python manage.py collectstatic
rm -rf logs
deploy: |
python manage.py migrate
pipenv run python manage.py migrate

source:
operations:
Expand Down
2 changes: 1 addition & 1 deletion templates/django3/files/myapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
SECRET_KEY = '5^#15wdl(qll2ue&&(-1ixwalo7%td1a(&x7abp(roabe_mk7w'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False

ALLOWED_HOSTS = ['*']

Expand Down
2 changes: 1 addition & 1 deletion templates/fastapi/.platform.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ info:
# Each note object is displayed as a small section heading with content below. Supports limited HTML.
notes:
- heading: "Features"
content: "Python 3.9<br/>MariaDB 10.4<br/>Redis 5.0"
content: "Python 3.11<br/>MariaDB 10.4<br/>Redis 5.0"

# This key describes the initialization call made to the master environment at
# project creation time. This is part of the full v2 UI operation mode, which
Expand Down
38 changes: 38 additions & 0 deletions templates/fastapi/files/.github/tests/vrt/template-paths.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* This is the default scenarios collection that will be used if there is not a theme-specific scenarios file in place
* for a given theme. You can copy this file and then name it `template-paths.js`.
*
*/

/**
* Stores the scenarios for each page/endpoint that should be tested
* @type {{}}
*/
var scenarioPaths = {};

/**
* For each page/endpoint you want to test, create a new array entry that contains at least the keys/properties `label`
* and `path`.
*
* additional properties you can set for each scenario are documented here: https://github.com/garris/BackstopJS#advanced-scenarios
*
* However, do NOT set `referenceUrl` or `url` as those will be overridden
*
* `path` should assume the URL ends in a trailing slash. For example, if the page you want to test against is
* https://master-7rqtwti-fqfjrmtjbjta4.eu-3.platformsh.site/a/path/to/foo/bar/
* Then for `path` it should be "a/path/to/foo/bar/"
*
* @type {{path: string, label: string}[]}
*/
scenarioPaths.paths = [
{
"label": "Home",
"delay": 2000,
},
{
"label": "Forced 404",
"delay": 2000,
},
];

module.exports = scenarioPaths;
64 changes: 45 additions & 19 deletions templates/fastapi/files/.platform.app.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
# This file describes an application. You can have multiple applications
# in the same project.
#
# See https://docs.platform.sh/user_guide/reference/platform-app-yaml.html
#########################
# FastAPI using pip
##########################
# Container configuration.

# The name of this app. Must be unique within a project.
name: app
# The name of this app. Must be unique within a project.
name: 'app'

# The runtime the application uses.
type: "python:3.9"
# The runtime the application uses.
type: 'python:3.11'

# The build-time dependencies of the app.
dependencies:
python:
pipenv: "2018.10.13"
python3:
pipenv: '2023.2.4'

##########################
# Builds and variables

# The hooks executed at various points in the lifecycle of the application.
hooks:
build: |
pipenv install --system --deploy
set -eu

# Download the latest version of pip
python3.11 -m pip install --upgrade pip

# Install dependencies
pipenv install --deploy

##########################
# Web configuration

# The configuration of the application when it is exposed to the web.
web:
commands:
start: "pipenv run python server.py"

##########################
# Services

# The size of the persistent disk of the application (in MB).
disk: 1024
# The relationships of the application with services or other applications.
#
# The left-hand side is the name of the relationship as it will be exposed
Expand All @@ -30,7 +46,17 @@ relationships:
database: "db:mysql"
rediscache: "cache:redis"

# The configuration of app when it is exposed to the web.
web:
commands:
start: python server.py
##########################
# Data and mounts

# The size of the persistent disk of the application (in MB).
disk: 1024

##########################
# Internal maintenance

source:
operations:
auto-update:
command: |
curl -fsS https://raw.githubusercontent.com/platformsh/source-operations/main/setup.sh | { bash /dev/fd/3 sop-autoupdate; } 3<&0
14 changes: 6 additions & 8 deletions templates/fastapi/files/Pipfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

[packages]
fastapi = ">=0.74.1"
fastapi = "*"
uvicorn = "*"
asyncmy = "*"
aioredis = "==2.0.0a1"
platformshconfig = "~=2.0"

[dev-packages]
click = "*"

[requires]
python_version = "3.9"
python_version = "3.11"
Loading