mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Added build and run commands for PowerShell (#244)
This commit is contained in:
21
build.ps1
21
build.ps1
@@ -1,8 +1,21 @@
|
||||
# Build script for PowerShell
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$pwd = (Resolve-Path .\).Path
|
||||
Write-Host "pwd: " $pwd
|
||||
$cmd = $args[0]
|
||||
Write-Host "cmd: $cmd"
|
||||
|
||||
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 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 () {
|
||||
docker run --rm --privileged -it -e LOG_LEVEL=debug -e "DB=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"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user