Examples
Static webpage
Configuration principles:
- host static webpage from ./public folder
- automatically create SSL certificates
- build website by running yarn build command
- use Gatsby-friendly routing
The whole configuration is in three files in the root folder of your project:
- dev.outblocks.yaml - environment configuration (environment-specific variables)
- project.outblocks.yaml - project configuration (global project configuration)
- app.outblocks.yaml - application configuration (app-specific configuration)
Environment
dev.outblocks.yaml:
# Base DNS domain of environment.
base_url: my-static-website.com
gcp_project: my-gcp-project
command: yarn build
Project config
project.outblocks.yaml:
# Project config.
# You can use ${var.*} expansion to source it from values.yaml
# per environment, e.g. domain: ${var.base_url}
# Name of the project.
name: magwise
# State - where project state will be stored.
state:
type: gcp
# Main base domain for apps is loaded from values.yaml
# for easy override per environment.
dns:
- domain: my-static-website.com
# Plugins that will be used for running, deployment etc.
plugins:
- name: gcp
version: ^0.1.14
project: ${var.gcp_project}
region: europe-west1
- name: docker
version: ^0.1.4
Static app config
app.outblocks.yaml:
# Static app config.
# You can use ${var.*} expansion to source it from
# values.yaml per environment, e.g. url: ${var.base_url}/app1/
# Name of the app.
name: my-static-website
# Working directory of the app where all commands will be run.
# All other dirs will be relative to this one.
dir: ./.
# Type of the app.
type: static
# URL of the app.
url: ${var.base_url}
# Path redirect rewrites URL to specified path. URL path from 'url'
# field will be stripped and replaced with value below.
# '/' should be fine for most apps.
pathRedirect: /
# Build defines where static files are stored and optionally which
# command should be used to generate them.
build:
# Optional command to be run to generate output files.
command: ${var.command}
# Directory where generated files will end up.
dir: ./public
# Run defines where how development is handled of
# application during `ok run`.
run:
# Command to be run to for dev mode.
command: yarn start
# Additional environment variables to pass.
# env:
# BROWSER: none # disable opening browser for react app
# Port override, by default just assigns next port
# starting from listen-port.
# port: 8123
# Routing to be used:
# 'react' for react browser routing.
# 'disabled' for no additional routing.
routing: gatsby