Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
devtool
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
k8s
devtool
Commits
bf02850d
Commit
bf02850d
authored
6 years ago
by
SWE CI
Browse files
Options
Downloads
Plain Diff
Merge branch 'release/v0.1.7'
parents
fa684440
84901aec
No related branches found
Branches containing commit
Tags
v0.1.7
Tags containing commit
No related merge requests found
Pipeline
#29560
passed
6 years ago
Stage: compile
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cmd/ci.go
+19
-0
19 additions, 0 deletions
cmd/ci.go
cmd/ci_build.go
+2
-6
2 additions, 6 deletions
cmd/ci_build.go
cmd/ci_deploy.go
+2
-6
2 additions, 6 deletions
cmd/ci_deploy.go
cmd/config_init.go
+1
-1
1 addition, 1 deletion
cmd/config_init.go
with
24 additions
and
13 deletions
cmd/ci.go
+
19
−
0
View file @
bf02850d
...
@@ -15,6 +15,11 @@
...
@@ -15,6 +15,11 @@
package
cmd
package
cmd
import
(
import
(
"os"
"git.psu.edu/k8s/devtool/config"
"github.com/fatih/color"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
)
)
...
@@ -50,3 +55,17 @@ func init() {
...
@@ -50,3 +55,17 @@ func init() {
// is called directly, e.g.:
// is called directly, e.g.:
// configCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
// configCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
}
func
getCiConfiguration
()
config
.
Config
{
conf
,
err
:=
config
.
New
(
configFile
)
if
err
!=
nil
{
color
.
New
(
color
.
FgRed
)
.
Printf
(
"WARN: configuration file: %s doesn't exist, using defaults
\n
"
,
configFile
)
conf
.
Name
=
os
.
Getenv
(
"CI_PROJECT_NAME"
)
deployable
:=
config
.
Deployable
{
Name
:
os
.
Getenv
(
"CI_PROJECT_NAME"
),
}
conf
.
Deployables
=
[]
config
.
Deployable
{
deployable
}
}
return
conf
}
This diff is collapsed.
Click to expand it.
cmd/ci_build.go
+
2
−
6
View file @
bf02850d
...
@@ -32,13 +32,9 @@ var ciBuildCmd = &cobra.Command{
...
@@ -32,13 +32,9 @@ var ciBuildCmd = &cobra.Command{
Use
:
"build"
,
Use
:
"build"
,
Short
:
"build the application within the CI system"
,
Short
:
"build the application within the CI system"
,
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
conf
,
err
:=
config
.
New
(
configFile
)
conf
:=
getCiConfiguration
()
if
err
!=
nil
{
color
.
New
(
color
.
FgRed
)
.
Printf
(
"Error reading configuration file: %s
\n
"
,
configFile
)
return
err
}
err
=
buildCiDocker
(
conf
)
err
:
=
buildCiDocker
(
conf
)
if
err
!=
nil
{
if
err
!=
nil
{
color
.
Red
(
"Failed to build docker image."
)
color
.
Red
(
"Failed to build docker image."
)
return
err
return
err
...
...
This diff is collapsed.
Click to expand it.
cmd/ci_deploy.go
+
2
−
6
View file @
bf02850d
...
@@ -28,13 +28,9 @@ var ciDeployCmd = &cobra.Command{
...
@@ -28,13 +28,9 @@ var ciDeployCmd = &cobra.Command{
Use
:
"deploy"
,
Use
:
"deploy"
,
Short
:
"deploy the application within the CI system"
,
Short
:
"deploy the application within the CI system"
,
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
conf
,
err
:=
config
.
New
(
configFile
)
conf
:=
getCiConfiguration
()
if
err
!=
nil
{
color
.
New
(
color
.
FgRed
)
.
Printf
(
"Error reading configuration file: %s
\n
"
,
configFile
)
return
err
}
err
=
fluxDeployCi
(
conf
)
err
:
=
fluxDeployCi
(
conf
)
if
err
!=
nil
{
if
err
!=
nil
{
color
.
Red
(
"Failed to build docker image."
)
color
.
Red
(
"Failed to build docker image."
)
return
err
return
err
...
...
This diff is collapsed.
Click to expand it.
cmd/config_init.go
+
1
−
1
View file @
bf02850d
...
@@ -175,7 +175,7 @@ var initCmd = &cobra.Command{
...
@@ -175,7 +175,7 @@ var initCmd = &cobra.Command{
}
}
conf
.
LocalEnvVars
=
[]
string
{
"OAUTH_CLIENT_ID"
}
conf
.
LocalEnvVars
=
[]
string
{
"OAUTH_CLIENT_ID"
}
conf
.
Local
EnvVar
s
=
[]
string
{
"OAUTH_CLIENT_SECRET"
,
"OAUTH_JWK"
}
conf
.
Local
Secret
s
=
[]
string
{
"OAUTH_CLIENT_SECRET"
,
"OAUTH_JWK"
}
color
.
Yellow
(
"Writing configuration"
)
color
.
Yellow
(
"Writing configuration"
)
...
...
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