mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-02 11:47:36 +08:00
[REV] support parse ARG variable value
This commit is contained in:
parent
4a40fbb9cc
commit
9870da385e
@ -27,6 +27,7 @@ import (
|
|||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/goodrain/rainbond/builder"
|
"github.com/goodrain/rainbond/builder"
|
||||||
"github.com/goodrain/rainbond/builder/sources"
|
"github.com/goodrain/rainbond/builder/sources"
|
||||||
|
"github.com/goodrain/rainbond/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func dockerfileBuilder() (Build, error) {
|
func dockerfileBuilder() (Build, error) {
|
||||||
@ -86,8 +87,10 @@ func (d *dockerfileBuild) Build(re *Request) (*Response, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//GetARGs get args and parse value
|
||||||
func GetARGs(buildEnvs map[string]string) map[string]*string {
|
func GetARGs(buildEnvs map[string]string) map[string]*string {
|
||||||
args := make(map[string]*string, 5)
|
args := make(map[string]*string)
|
||||||
|
argStr := make(map[string]string)
|
||||||
for k, v := range buildEnvs {
|
for k, v := range buildEnvs {
|
||||||
if strings.Replace(v, " ", "", -1) == "" {
|
if strings.Replace(v, " ", "", -1) == "" {
|
||||||
continue
|
continue
|
||||||
@ -95,7 +98,12 @@ func GetARGs(buildEnvs map[string]string) map[string]*string {
|
|||||||
if ks := strings.Split(k, "ARG_"); len(ks) > 1 {
|
if ks := strings.Split(k, "ARG_"); len(ks) > 1 {
|
||||||
value := v
|
value := v
|
||||||
args[ks[1]] = &value
|
args[ks[1]] = &value
|
||||||
|
argStr[ks[1]] = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for k, arg := range args {
|
||||||
|
value := util.ParseVariable(*arg, argStr)
|
||||||
|
args[k] = &value
|
||||||
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
@ -101,7 +101,6 @@ http {
|
|||||||
server 0.0.0.1; # placeholder
|
server 0.0.0.1; # placeholder
|
||||||
|
|
||||||
balancer_by_lua_block {
|
balancer_by_lua_block {
|
||||||
ngx.log(ngx.INFO, string.format("start balancer"))
|
|
||||||
balancer.balance()
|
balancer.balance()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user