mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
23 lines
589 B
PowerShell
23 lines
589 B
PowerShell
# Build script for PowerShell
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$cmd = $args[0]
|
|
Write-Host "cmd: $cmd"
|
|
|
|
function build () {
|
|
docker run --rm -v ${pwd}:/go/src/github.com/iron-io/functions -w /go/src/github.com/iron-io/functions iron/go:dev go build -o functions-alpine
|
|
docker build -t iron/functions:latest .
|
|
}
|
|
|
|
function run () {
|
|
build
|
|
docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB_URL=bolt:///app/data/bolt.db" -v ${pwd}/data:/app/data -p 8080:8080 iron/functions
|
|
}
|
|
|
|
switch ($cmd)
|
|
{
|
|
"build" { build }
|
|
"run" {run}
|
|
default {"Invalid command: $cmd"}
|
|
}
|