Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bobgroup-mage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bob Public Utils
bobgroup-mage
Commits
4288f330
Commit
4288f330
authored
3 years ago
by
Johan de Klerk
Browse files
Options
Downloads
Patches
Plain Diff
Added logs
parent
46529904
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mage_helpers/cdk.go
+5
-13
5 additions, 13 deletions
mage_helpers/cdk.go
mage_helpers/debug.go
+1
-0
1 addition, 0 deletions
mage_helpers/debug.go
mage_helpers/file_system.go
+9
-0
9 additions, 0 deletions
mage_helpers/file_system.go
with
15 additions
and
13 deletions
mage_helpers/cdk.go
+
5
−
13
View file @
4288f330
...
@@ -3,13 +3,11 @@ package mage_helpers
...
@@ -3,13 +3,11 @@ package mage_helpers
import
(
import
(
_
"embed"
_
"embed"
"fmt"
"fmt"
"gopkg.in/yaml.v2"
"io/ioutil"
"io/ioutil"
"os"
"os"
"os/exec"
"os/exec"
"strconv"
"strconv"
"strings"
"gopkg.in/yaml.v2"
)
)
func
CDKCompileTypeScript
(
cdkDir
string
)
error
{
func
CDKCompileTypeScript
(
cdkDir
string
)
error
{
...
@@ -50,8 +48,7 @@ func CDKDiff(cdkDir string, env string, stack string, local bool, profile string
...
@@ -50,8 +48,7 @@ func CDKDiff(cdkDir string, env string, stack string, local bool, profile string
`--exclusively=true`
,
`--exclusively=true`
,
`--progress=events`
)
`--progress=events`
)
fmt
.
Println
(
fmt
.
Sprintf
(
"Running command: cdk %s"
,
strings
.
Join
(
commandArgs
,
" "
)))
cmd
:=
BuildCommand
(
"cdk"
,
commandArgs
)
cmd
:=
exec
.
Command
(
"cdk"
,
commandArgs
...
)
cmd
.
Dir
=
cdkDir
cmd
.
Dir
=
cdkDir
output
,
err
:=
cmd
.
CombinedOutput
()
output
,
err
:=
cmd
.
CombinedOutput
()
...
@@ -90,9 +87,7 @@ func CDKDeploy(cdkDir string, env string, stack string, exclusively bool, local
...
@@ -90,9 +87,7 @@ func CDKDeploy(cdkDir string, env string, stack string, exclusively bool, local
`--progress=events`
,
`--progress=events`
,
`--app=./cdk.out`
)
`--app=./cdk.out`
)
fmt
.
Println
(
fmt
.
Sprintf
(
"Running command: cdk %s"
,
strings
.
Join
(
commandArgs
,
" "
)))
cmd
:=
BuildCommand
(
"cdk"
,
commandArgs
)
cmd
:=
exec
.
Command
(
"cdk"
,
commandArgs
...
)
cmd
.
Dir
=
cdkDir
cmd
.
Dir
=
cdkDir
output
,
err
:=
cmd
.
CombinedOutput
()
output
,
err
:=
cmd
.
CombinedOutput
()
...
@@ -123,8 +118,7 @@ func CDKSynthAll(cdkDir string, env string, profile string, local bool) error {
...
@@ -123,8 +118,7 @@ func CDKSynthAll(cdkDir string, env string, profile string, local bool) error {
commandArgs
=
append
(
commandArgs
,
commandArgs
=
append
(
commandArgs
,
`--progress=events`
)
`--progress=events`
)
fmt
.
Println
(
fmt
.
Sprintf
(
"Running command: cdk %s"
,
strings
.
Join
(
commandArgs
,
" "
)))
cmd
:=
BuildCommand
(
"cdk"
,
commandArgs
)
cmd
:=
exec
.
Command
(
"cdk"
,
commandArgs
...
)
cmd
.
Dir
=
cdkDir
cmd
.
Dir
=
cdkDir
output
,
err
:=
cmd
.
CombinedOutput
()
output
,
err
:=
cmd
.
CombinedOutput
()
...
@@ -176,9 +170,7 @@ func CDKSynthDebug(cdkDir string, env string, handler string, appName string, pr
...
@@ -176,9 +170,7 @@ func CDKSynthDebug(cdkDir string, env string, handler string, appName string, pr
`--no-staging`
,
`--no-staging`
,
}
}
fmt
.
Println
(
fmt
.
Sprintf
(
"Running command: cdk %s"
,
strings
.
Join
(
commandArgs
,
" "
)))
cmd
:=
BuildCommand
(
"cdk"
,
commandArgs
)
cmd
:=
exec
.
Command
(
"cdk"
,
commandArgs
...
)
cmd
.
Dir
=
cdkDir
cmd
.
Dir
=
cdkDir
output
,
err
:=
cmd
.
CombinedOutput
()
output
,
err
:=
cmd
.
CombinedOutput
()
...
...
This diff is collapsed.
Click to expand it.
mage_helpers/debug.go
+
1
−
0
View file @
4288f330
...
@@ -86,6 +86,7 @@ func runLongRunningSubProcess(ctx context.Context, name string, arg ...string) e
...
@@ -86,6 +86,7 @@ func runLongRunningSubProcess(ctx context.Context, name string, arg ...string) e
cancel
()
cancel
()
}()
}()
fmt
.
Println
(
fmt
.
Sprintf
(
"Running command: %s %s"
,
name
,
strings
.
Join
(
arg
,
" "
)))
cmd
:=
exec
.
CommandContext
(
cancelContext
,
name
,
arg
...
)
cmd
:=
exec
.
CommandContext
(
cancelContext
,
name
,
arg
...
)
cmd
.
Stdout
=
os
.
Stdout
cmd
.
Stdout
=
os
.
Stdout
cmd
.
Stderr
=
os
.
Stderr
cmd
.
Stderr
=
os
.
Stderr
...
...
This diff is collapsed.
Click to expand it.
mage_helpers/file_system.go
+
9
−
0
View file @
4288f330
...
@@ -2,13 +2,16 @@ package mage_helpers
...
@@ -2,13 +2,16 @@ package mage_helpers
import
(
import
(
"context"
"context"
"fmt"
"io"
"io"
"io/ioutil"
"io/ioutil"
"log"
"log"
"os"
"os"
"os/exec"
"os/signal"
"os/signal"
"path"
"path"
"path/filepath"
"path/filepath"
"strings"
"github.com/thoas/go-funk"
"github.com/thoas/go-funk"
...
@@ -168,3 +171,9 @@ func killWithContext(ctx context.Context) {
...
@@ -168,3 +171,9 @@ func killWithContext(ctx context.Context) {
os
.
Exit
(
exitCodeInterrupt
)
os
.
Exit
(
exitCodeInterrupt
)
}()
}()
}
}
func
BuildCommand
(
command
string
,
args
[]
string
)
*
exec
.
Cmd
{
fmt
.
Println
(
fmt
.
Sprintf
(
"Running command: %s %s"
,
command
,
strings
.
Join
(
args
,
" "
)))
cmd
:=
exec
.
Command
(
command
,
args
...
)
return
cmd
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment