mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Merge pull request #164 from fnproject/awesomer-getting-started
Using install script and things again! yay!
This commit is contained in:
48
README.md
48
README.md
@@ -1,6 +1,6 @@
|
||||
# Fn [](https://github.com/fnproject/fn/commits/master)
|
||||
# Fn [](https://circleci.com/gh/fnproject/fn)
|
||||
|
||||
<!-- [](https://godoc.org/github.com/treeder/functions) -->
|
||||
<!-- ADD ONCE PUBLIC [](https://godoc.org/github.com/treeder/functions) -->
|
||||
|
||||
Fn is an event-driven, open source, [functions-as-a-service](serverless.md) compute
|
||||
platform that you can run anywhere. Some of it's key features:
|
||||
@@ -22,57 +22,21 @@ platform that you can run anywhere. Some of it's key features:
|
||||
* Docker 17.05 or later installed and running
|
||||
* Logged into Docker Hub (`docker login`)
|
||||
|
||||
## Usage
|
||||
|
||||
### Installation (if running locally)
|
||||
|
||||
NOTE: The following instructions apply while the project is a private repo. This will
|
||||
build the Functions server and the CLI tool directly from the repo instead of
|
||||
using pre-built containers. Once the project is public, these steps will be unnecessary.
|
||||
|
||||
```sh
|
||||
# Build and Install CLI tool
|
||||
cd fn
|
||||
make dep # just once
|
||||
make install
|
||||
|
||||
# Build and Run Functions Server
|
||||
cd ..
|
||||
make dep # just once
|
||||
make run # will build as well
|
||||
```
|
||||
|
||||
### Installation (if using internal alpha service)
|
||||
|
||||
Set your system to point to the internal service on BMC:
|
||||
|
||||
```sh
|
||||
export API_URL=http://129.146.10.253:80
|
||||
```
|
||||
|
||||
Download the pre-built CLI binary:
|
||||
|
||||
1. Visit: https://github.com/fnproject/fn/tree/master/fn/releases/download/0.3.2
|
||||
2. Download the CLI for your platform
|
||||
3. Put in /usr/local/bin
|
||||
4. chmod +x
|
||||
|
||||
|
||||
<!-- ADD BACK ONCE PUBLIC
|
||||
## Quickstart
|
||||
|
||||
### Install CLI tool
|
||||
|
||||
This isn't required, but it sure makes things a lot easier. Just run the following to install:
|
||||
|
||||
```sh
|
||||
curl -LSs https://goo.gl/KKDFGn | sh
|
||||
curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh
|
||||
```
|
||||
|
||||
This will download a shell script and execute it. If the script asks for a password, that is because it invokes sudo.
|
||||
|
||||
### Run Fn Server
|
||||
|
||||
To get started quickly with Fn, just fire up a functions container:
|
||||
Then fire up an Fn server:
|
||||
|
||||
```sh
|
||||
fn start
|
||||
@@ -81,8 +45,6 @@ fn start
|
||||
This will start Fn in single server mode, using an embedded database and message queue. You can find all the
|
||||
configuration options [here](docs/operating/options.md). If you are on Windows, check [here](docs/operating/windows.md).
|
||||
|
||||
-->
|
||||
|
||||
### Your First Function
|
||||
|
||||
Functions are small but powerful blocks of code that generally do one simple thing. Forget about monoliths when using functions, just focus on the task that you want the function to perform.
|
||||
|
||||
10
cli/install
10
cli/install
@@ -3,7 +3,7 @@ set -e
|
||||
|
||||
# Install script to install fn
|
||||
|
||||
release="0.3.7"
|
||||
version="0.3.26"
|
||||
|
||||
command_exists() {
|
||||
command -v "$@" > /dev/null 2>&1
|
||||
@@ -54,24 +54,24 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
url='https://github.com/fnproject/fn/cli/releases/download'
|
||||
url='https://github.com/fnproject/cli/releases/download'
|
||||
|
||||
# perform some very rudimentary platform detection
|
||||
case "$(uname)" in
|
||||
Linux)
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$release/fn_linux"
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$version/fn_linux"
|
||||
$sh_c "chmod +x /usr/local/bin/fn"
|
||||
fn --version
|
||||
exit 0
|
||||
;;
|
||||
Darwin)
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$release/fn_mac"
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$version/fn_mac"
|
||||
$sh_c "chmod +x /usr/local/bin/fn"
|
||||
fn --version
|
||||
exit 0
|
||||
;;
|
||||
WindowsNT)
|
||||
$sh_c "$curl $url/$release/fn.exe"
|
||||
$sh_c "$curl $url/$version/fn.exe"
|
||||
# TODO how to make executable? chmod?
|
||||
fn.exe --version
|
||||
exit 0
|
||||
|
||||
@@ -3,7 +3,7 @@ set -e
|
||||
|
||||
# Install script to install fn
|
||||
|
||||
release="0.3.7"
|
||||
version="0.3.26"
|
||||
|
||||
command_exists() {
|
||||
command -v "$@" > /dev/null 2>&1
|
||||
@@ -54,24 +54,24 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
url='https://github.com/fnproject/fn/cli/releases/download'
|
||||
url='https://github.com/fnproject/cli/releases/download'
|
||||
|
||||
# perform some very rudimentary platform detection
|
||||
case "$(uname)" in
|
||||
Linux)
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$release/fn_linux"
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$version/fn_linux"
|
||||
$sh_c "chmod +x /usr/local/bin/fn"
|
||||
fn --version
|
||||
exit 0
|
||||
;;
|
||||
Darwin)
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$release/fn_mac"
|
||||
$sh_c "$curl /usr/local/bin/fn $url/$version/fn_mac"
|
||||
$sh_c "chmod +x /usr/local/bin/fn"
|
||||
fn --version
|
||||
exit 0
|
||||
;;
|
||||
WindowsNT)
|
||||
$sh_c "$curl $url/$release/fn.exe"
|
||||
$sh_c "$curl $url/$version/fn.exe"
|
||||
# TODO how to make executable? chmod?
|
||||
fn.exe --version
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user