Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
devtool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
10
Issues
10
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
k8s
devtool
Commits
1ed5a7e7
Commit
1ed5a7e7
authored
Mar 22, 2019
by
Christopher Harm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing docker context when building in subfolders
parent
2a771ea4
Pipeline
#29356
passed with stages
in 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
cmd/build.go
cmd/build.go
+9
-1
No files found.
cmd/build.go
View file @
1ed5a7e7
...
...
@@ -16,7 +16,9 @@ package cmd
import
(
"errors"
"fmt"
"os"
"strings"
"git.psu.edu/k8s/devtool/config"
"git.psu.edu/k8s/devtool/environment"
...
...
@@ -120,8 +122,14 @@ func buildDockerAndDeploy(config config.Config) error {
dockerTag
:=
image
+
":"
+
tag
.
String
()
dockerRootDir
:=
"."
if
idx
:=
strings
.
LastIndex
(
dockerfile
,
"/"
);
idx
!=
-
1
{
dockerRootDir
=
dockerfile
[
:
idx
]
fmt
.
Println
(
dockerRootDir
)
}
color
.
New
(
color
.
FgGreen
)
.
PrintFunc
()(
"Building "
,
dockerTag
)
err
=
environment
.
Run
(
true
,
"docker"
,
"build"
,
"-t"
,
dockerTag
,
"-f"
,
dockerfile
,
"."
)
err
=
environment
.
Run
(
true
,
"docker"
,
"build"
,
"-t"
,
dockerTag
,
"-f"
,
dockerfile
,
dockerRootDir
)
if
err
!=
nil
{
return
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment