3 Star 10 Fork 0

Gitee 极速下载 / fn-project

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/fnproject/fn
克隆/下载
build.ps1 1012 Bytes
一键复制 编辑 原始数据 按行查看 历史
Tommy Su 提交于 2018-12-06 17:34 . Fix the powershell build script (#1343)
# Build script for PowerShell
$ErrorActionPreference = "Stop"
$cmd = $args[0]
Write-Host "cmd: $cmd"
function quick() {
try {
go build
if (-not $?) {
Write-Host "build failed!" # WTH, error handling in powershell sucks
exit
}
} catch {
# This try/catch thing doesn't work, the above if statement does work though
Write-Host "build failed 2!"
exit
}
./functions
}
function build () {
docker run --rm -v ${pwd}:/go/src/github.com/fnproject/fn -w /go/src/github.com/fnproject/fn/cmd/fnserver golang:alpine go build -o fn-alpine
docker build -t fnproject/fnserver:latest .
}
function run () {
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -e FN_LOG_LEVEL=debug -e "FN_DB_URL=sqlite3:///app/data/fn.db" -v $PWD/data:/app/data -p 8080:8080 fnproject/fnserver
}
switch ($cmd)
{
"quick" {quick}
"build" { build }
"run" {run}
default {"Invalid command: $cmd"}
}
Go
1
https://gitee.com/mirrors/fn-project.git
git@gitee.com:mirrors/fn-project.git
mirrors
fn-project
fn-project
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891