Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prototype terraform deployment #652

Merged
merged 2 commits into from
Aug 19, 2020
Merged

Prototype terraform deployment #652

merged 2 commits into from
Aug 19, 2020

Conversation

nghialv
Copy link
Member

@nghialv nghialv commented Aug 19, 2020

What this PR does / why we need it:

This is just a part of the prototype.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

DOCKER

A Kapetanios build has just been triggered to run docker operations for the following 1 directory.
Their results will be reported back after the build is completed.

  1. dockers/piped-base

@nghialv
Copy link
Member Author

nghialv commented Aug 19, 2020

/cc @nakabonne

@pipecd-bot pipecd-bot requested a review from nakabonne August 19, 2020 01:51
Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO_LINTER

Some issues were detected while linting go source files in your changes.

PredefinedStageTerraformApply = "TerraformApply"
PredefinedStageCloudRunSync = "CloudRunSync"
PredefinedStageRollback = "Rollback"
PredefinedStageK8sSync = "K8sSync"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported const PredefinedStageK8sSync should have comment (or a comment on this block) or be unexported

https://golang.org/wiki/CodeReviewComments#doc-comments

}
}

func (t *Terraform) Changes(ctx context.Context) ([]byte, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx is unused in Changes

return nil, nil
}

func (t *Terraform) Apply(ctx context.Context) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx is unused in Apply

return executor.DetermineStageStatus(sig.Signal(), originalStatus, status)
}

func (e *Executor) ensureSync(ctx context.Context) model.StageStatus {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx is unused in ensureSync

return model.StageStatus_STAGE_SUCCESS
}

func (e *Executor) ensurePlan(ctx context.Context) model.StageStatus {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx is unused in ensurePlan

return model.StageStatus_STAGE_SUCCESS
}

func (e *Executor) ensureApply(ctx context.Context) model.StageStatus {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx is unused in ensureApply

return model.StageStatus_STAGE_SUCCESS
}

func (e *Executor) ensureRollback(ctx context.Context) model.StageStatus {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx is unused in ensureRollback

@pipecd-bot
Copy link
Collaborator

DOCKER

The Kapetanios build to run docker operations for the following 1 directory has been completed.

1. dockers/piped-base - success

An image named piped-base:0.0.6-f35c0ef was procuded for reviewing and testing.
By merging this PR, an image named piped-base:0.0.6 will be pushed to the container registry.

All tests inside this directory have PASSED.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 21.07%. This pull request decreases coverage by -0.20%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/terraform/terraform.go NewTerraform -- 0.00% +0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Changes -- 0.00% +0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Apply -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensureSync -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensurePlan -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensureApply -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensureRollback -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.findTerraform -- 0.00% +0.00%
pkg/app/piped/planner/terraform/pipeline.go builQuickSyncPipeline -- 0.00% +0.00%
pkg/app/piped/toolregistry/install.go registry.installTerraform -- 0.00% +0.00%
pkg/app/piped/toolregistry/registry.go registry.Terraform -- 0.00% +0.00%
pkg/app/piped/planner/terraform/pipeline.go buildProgressivePipeline 0.00% 0.00% +0.00%
pkg/app/piped/planner/terraform/terraform.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Register 80.00% 83.33% +3.33%
pkg/app/piped/executor/terraform/terraform.go Executor.Execute 0.00% 0.00% +0.00%
pkg/app/piped/planner/terraform/pipeline.go builDefaultPipeline 0.00% -- +-0.00%

pkg/app/piped/executor/terraform/terraform.go Outdated Show resolved Hide resolved
return model.StageStatus_STAGE_SUCCESS
}

func (e *Executor) findTerraform(ctx context.Context, version string) (*provider.Terraform, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findTerraform is unused, but are you planning to use it later?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, It will be used later.

pkg/app/piped/toolregistry/install.go Outdated Show resolved Hide resolved
pkg/app/piped/toolregistry/install.go Outdated Show resolved Hide resolved
Co-authored-by: Ryo Nakao <ryo@nakao.dev>
@pipecd-bot
Copy link
Collaborator

DOCKER

A Kapetanios build has just been triggered to run docker operations for the following 1 directory.
Their results will be reported back after the build is completed.

  1. dockers/piped-base

@pipecd-bot
Copy link
Collaborator

DOCKER

The Kapetanios build to run docker operations for the following 1 directory has been completed.

1. dockers/piped-base - success

An image named piped-base:0.0.6-d8de11f was procuded for reviewing and testing.
By merging this PR, an image named piped-base:0.0.6 will be pushed to the container registry.

All tests inside this directory have PASSED.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 21.07%. This pull request decreases coverage by -0.20%.

File Function Base Head Diff
pkg/app/piped/cloudprovider/terraform/terraform.go NewTerraform -- 0.00% +0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Changes -- 0.00% +0.00%
pkg/app/piped/cloudprovider/terraform/terraform.go Terraform.Apply -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensureSync -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensurePlan -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensureApply -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.ensureRollback -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Executor.findTerraform -- 0.00% +0.00%
pkg/app/piped/planner/terraform/pipeline.go builQuickSyncPipeline -- 0.00% +0.00%
pkg/app/piped/toolregistry/install.go registry.installTerraform -- 0.00% +0.00%
pkg/app/piped/toolregistry/registry.go registry.Terraform -- 0.00% +0.00%
pkg/app/piped/executor/terraform/terraform.go Register 80.00% 83.33% +3.33%
pkg/app/piped/executor/terraform/terraform.go Executor.Execute 0.00% 0.00% +0.00%
pkg/app/piped/planner/terraform/pipeline.go buildProgressivePipeline 0.00% 0.00% +0.00%
pkg/app/piped/planner/terraform/terraform.go Planner.Plan 0.00% 0.00% +0.00%
pkg/app/piped/planner/terraform/pipeline.go builDefaultPipeline 0.00% -- +-0.00%

@nakabonne
Copy link
Member

Looks great!
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nakabonne.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants