fix docker deployment issue on linux

This commit is contained in:
therecipe 2019-09-26 01:36:43 +02:00
parent 521980c887
commit 383164b950
8 changed files with 46 additions and 32 deletions

View file

@ -16,8 +16,6 @@ Status
Almost all Qt functions and classes are accessible from Go and you should be able to find everything you need to build fully featured applications.
(A special exception are the WebEngine/WebView packages, these aren't available for Windows yet.)
Installation
------------

View file

@ -74,7 +74,11 @@ func GenModule(m, target string, mode int) {
if utils.QT_DOCKER() {
if idug, ok := os.LookupEnv("IDUG"); ok {
utils.RunCmd(exec.Command("chown", "-R", idug, utils.GoQtPkgPath(strings.ToLower(m))), "chown files to user")
if path := utils.GoQtPkgPath(strings.ToLower(m)); utils.UseGOMOD(path) {
utils.RunCmd(exec.Command("chown", "-R", idug, filepath.Dir(utils.GOMOD(path))), "chown files to user")
} else {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
}
}
}
}

View file

@ -338,7 +338,7 @@ func virtual(arg []string, target, path string, writeCacheToHost bool, docker bo
if err != nil {
utils.Log.WithError(err).Error("failed to lookup current user")
} else {
args = append(args, "-u", fmt.Sprintf("%v:%v", u.Uid, u.Gid), "-e", fmt.Sprintf("IDUG=%v:%v", u.Uid, u.Gid))
args = append(args, "-e", fmt.Sprintf("IDUG=%v:%v", u.Uid, u.Gid))
}
}

View file

@ -883,7 +883,11 @@ func bundle(mode, target, path, name, depPath string, tagsCustom string, fast bo
if utils.QT_DOCKER() {
if idug, ok := os.LookupEnv("IDUG"); ok {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
if utils.UseGOMOD(path) {
utils.RunCmd(exec.Command("chown", "-R", idug, filepath.Dir(utils.GOMOD(path))), "chown files to user")
} else {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
}
}
}
}

View file

@ -74,7 +74,11 @@ func Moc(path, target, tags string, fast, slow, deploying bool) {
if !deploying && utils.QT_DOCKER() {
if idug, ok := os.LookupEnv("IDUG"); ok {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
if utils.UseGOMOD(path) {
utils.RunCmd(exec.Command("chown", "-R", idug, filepath.Dir(utils.GOMOD(path))), "chown files to user")
} else {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
}
}
}
}

View file

@ -48,7 +48,11 @@ func Rcc(path, target, tagsCustom, output_dir string, useuic, quickcompiler, dep
if !deploying && utils.QT_DOCKER() {
if idug, ok := os.LookupEnv("IDUG"); ok {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
if utils.UseGOMOD(path) {
utils.RunCmd(exec.Command("chown", "-R", idug, filepath.Dir(utils.GOMOD(path))), "chown files to user")
} else {
utils.RunCmd(exec.Command("chown", "-R", idug, path), "chown files to user")
}
}
}
}

View file

@ -175,7 +175,7 @@ func Test(target string, docker, vagrant bool, vagrantsystem string) {
vagrantsystem,
false,
true,
!strings.HasPrefix(target, "sailfish"),
false, //TODO: re-enable once quickcompiler files can be properly cleaned up automatically !strings.HasPrefix(target, "sailfish"),
)
templater.CleanupDepsForCI()
templater.CleanupDepsForCI = func() {}

View file

@ -194,52 +194,52 @@ jobs:
file: windows_32_shared/Dockerfile
tag: windows_32_shared
dep:
- windows_32_shared_base
# - windows_32_shared_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_32_shared/Dockerfile.base
tag: windows_32_shared_base
# -
# template: docker_job_template.yml
# parameters:
# file: windows_32_shared/Dockerfile.base
# tag: windows_32_shared_base
-
template: docker_job_template.yml
parameters:
file: windows_32_static/Dockerfile
tag: windows_32_static
dep:
- windows_32_static_base
# - windows_32_static_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_32_static/Dockerfile.base
tag: windows_32_static_base
# -
# template: docker_job_template.yml
# parameters:
# file: windows_32_static/Dockerfile.base
# tag: windows_32_static_base
-
template: docker_job_template.yml
parameters:
file: windows_64_shared/Dockerfile
tag: windows_64_shared
dep:
- windows_64_shared_base
# - windows_64_shared_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_64_shared/Dockerfile.base
tag: windows_64_shared_base
# -
# template: docker_job_template.yml
# parameters:
# file: windows_64_shared/Dockerfile.base
# tag: windows_64_shared_base
-
template: docker_job_template.yml
parameters:
file: windows_64_static/Dockerfile
tag: windows_64_static
dep:
- windows_64_static_base
# - windows_64_static_base
- linux
-
template: docker_job_template.yml
parameters:
file: windows_64_static/Dockerfile.base
tag: windows_64_static_base
# -
# template: docker_job_template.yml
# parameters:
# file: windows_64_static/Dockerfile.base
# tag: windows_64_static_base
-
template: docker_job_template.yml
parameters: