GitHub

Introduction

Step by Step

Install CLI

Get started by installing an Outblocks CLI:

macOS

brew install outblocks/tap/ok # install CLI

If you don't have brew installed, visit Brew Website for the install guide.

Windows

scoop bucket add outblocks-cli https://github.com/outblocks/outblocks-scoop.git
scoop install outblocks-cli

If you don't have scoop installed, visit Scoop Website for the install guide.

You can use NPM to install CLI globally:

NPM

npm install -g outblocks-cli

or in your project, to maintain specific version:

npm install outblocks-cli --save-dev

Set up cloud access

We want to deploy our project to Google Cloud Platform.

Install gcloud

Install Cloud SDK (gcloud CLI tool) using this guide in this tutorial.

Log in

To obtain your keys, which Outblocks will you as deployment keys, log in using this command:

gcloud auth application-default login

Initiate a project

Go to your project folder and execute:

ok init

You can create a GCP project or choose one from the list:

#  ok init
? Name of project: website
? Deployment plugin to be used: gcp
? Run plugin to be used: docker
? Main domain you plan to use for deployments: outblocks.io
? Default run plugin: direct
? Do you want to create a new GCP Project? Yes
? GCP Project name to create: outblocks
? GCP Region to use: europe-west3

Add an app

# website ok apps add
? Application name: website
? Application type: static
? Application dir: /Users/mcj/code/outblocks/website/
Run plugin used for application: direct
? Dir to save application YAML: /Users/mcj/code/outblocks/website/
? URL of application: outblocks.io
? Run command of application to serve app during dev (optional, e.g. yarn dev): yarn start
? Deploy plugin used for application: gcp
Routing of application:
? Build directory of application: /Users/mcj/code/outblocks/website/build
? Build command of application (optional, e.g. yarn build): yarn build

Deploy

Deployment: (95 to add, 0 to change, 0 to destroy, 0 to process)


  App 'website' changes:
    + add 83 of BucketObject
    + add Bucket 'app-static-website-3b8fd026'
    + add CloudRun 'app-static-website-3b8f'


  Plugin 'gcp' common changes:
    + add Image 'nginx-gcs-static-proxy:1.21-v3'


  Plugin 'gcp' load balancer changes:
    + add ServerlessNEG 'app-static-website-3b8f'
    + add TargetHTTPSProxy 'load-balancer-3b8f-0'
    + add 2 of ForwardingRule ['load-balancer-3b8f-https-0', 'load-balancer-3b8f-http-0']
    + add ManagedSSL 'outblocks-io-3b8f'
    + add Address 'load-balancer-3b8f-0'
    + add URLMap 'load-balancer-3b8f-0'
    + add TargetHTTPProxy 'load-balancer-3b8f-0'
    + add BackendService 'app-static-website-3b8f'

Now you will get a summary, after this step you should add the A record in your DNS service, then give it a while for GCP to generate the certificate.

# DNS Setup (manual)


Record       | Type | Value
outblocks.io | A    | 35.244.254.228


# App External URLs


https://outblocks.io/ ==> website (static)


# SSL Certificates


Domain       | Status  | Info
outblocks.io | PROVISIONING |
Previous
Quick start