Skip to content

Commit

Permalink
chore: Remove deprecated jobProvisioning field from Stage (#20)
Browse files Browse the repository at this point in the history
This field is no longer used

JIRA: EPMDEDP-13166

Signed-off-by: Sergiy Kulanov <[email protected]>
Change-Id: I3963ddd690cdd507bc9618e3702f48b4c555f854
  • Loading branch information
SergK committed Jan 18, 2024
1 parent 2e534ab commit 1869184
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 124 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ git-chglog: ## Download git-chglog locally if necessary.
CRDOC = $(LOCALBIN)/crdoc
.PHONY: crdoc
crdoc: ## Download crdoc locally if necessary.
$(call go-get-tool,$(CRDOC),fybrik.io/crdoc,v0.6.1)
$(call go-get-tool,$(CRDOC),fybrik.io/crdoc,v0.6.3)

CONTROLLER_GEN = $(LOCALBIN)/controller-gen
.PHONY: controller-gen
Expand Down
5 changes: 0 additions & 5 deletions api/v1/stage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ type StageSpec struct {
// +kubebuilder:default:={type: "default"}
Source Source `json:"source"`

// CD Job Provisioner for Pipeline. E.g.
// +optional
// +kubebuilder:default:="default"
JobProvisioning string `json:"jobProvisioning,omitempty"`

// Namespace where the application will be deployed.
Namespace string `json:"namespace,omitempty"`

Expand Down
3 changes: 0 additions & 3 deletions api/v1alpha1/stage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ type StageSpec struct {

// Specifies a source of a pipeline library which will run release
Source Source `json:"source" valid:"Required"`

// CD Job Provisioner for Pipeline. E.g.
JobProvisioning string `json:"jobProvisioning"`
}

// QualityGate defines a single quality for a release.
Expand Down
8 changes: 0 additions & 8 deletions config/crd/bases/v2.edp.epam.com_stages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ spec:
description: A description of a stage.
minLength: 0
type: string
jobProvisioning:
default: default
description: CD Job Provisioner for Pipeline. E.g.
type: string
name:
description: Name of a stage.
minLength: 2
Expand Down Expand Up @@ -220,9 +216,6 @@ spec:
description: A description of a stage.
minLength: 0
type: string
jobProvisioning:
description: CD Job Provisioner for Pipeline. E.g.
type: string
name:
description: Name of a stage.
minLength: 2
Expand Down Expand Up @@ -282,7 +275,6 @@ spec:
required:
- cdPipeline
- description
- jobProvisioning
- name
- order
- qualityGates
Expand Down
1 change: 0 additions & 1 deletion deploy-templates/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ annotations:
spec:
cdPipeline: release-github-javascript
description: dev
jobProvisioning: default
name: dev
order: 0
qualityGates:
Expand Down
8 changes: 0 additions & 8 deletions deploy-templates/crds/v2.edp.epam.com_stages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ spec:
description: A description of a stage.
minLength: 0
type: string
jobProvisioning:
default: default
description: CD Job Provisioner for Pipeline. E.g.
type: string
name:
description: Name of a stage.
minLength: 2
Expand Down Expand Up @@ -220,9 +216,6 @@ spec:
description: A description of a stage.
minLength: 0
type: string
jobProvisioning:
description: CD Job Provisioner for Pipeline. E.g.
type: string
name:
description: Name of a stage.
minLength: 2
Expand Down Expand Up @@ -282,7 +275,6 @@ spec:
required:
- cdPipeline
- description
- jobProvisioning
- name
- order
- qualityGates
Expand Down
26 changes: 5 additions & 21 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CDPipeline is the Schema for the cdpipelines API.
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
Expand Down Expand Up @@ -236,7 +236,7 @@ Stage is the Schema for the stages API.
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
Expand Down Expand Up @@ -325,15 +325,6 @@ StageSpec defines the desired state of Stage. NOTE: for deleting the stage use s
<i>Default</i>: in-cluster<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>jobProvisioning</b></td>
<td>string</td>
<td>
CD Job Provisioner for Pipeline. E.g.<br/>
<br/>
<i>Default</i>: default<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>namespace</b></td>
<td>string</td>
Expand Down Expand Up @@ -601,7 +592,7 @@ CDPipeline is the Schema for the cdpipelines API.
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
Expand Down Expand Up @@ -789,7 +780,7 @@ Stage is the Schema for the stages API.
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
Expand Down Expand Up @@ -841,13 +832,6 @@ StageSpec defines the desired state of Stage.
A description of a stage.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>jobProvisioning</b></td>
<td>string</td>
<td>
CD Job Provisioner for Pipeline. E.g.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>name</b></td>
<td>string</td>
Expand Down Expand Up @@ -1087,4 +1071,4 @@ StageStatus defines the observed state of Stage.
</td>
<td>false</td>
</tr></tbody>
</table>
</table>
15 changes: 0 additions & 15 deletions docs/arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ When deploying several applications within a single CD pipeline, applications ar

### Autodeploy in Argo CD

Autodeploy logic differs depending on the CI tool that is used for EDP, whether it is Argo CD or Jenkins.
The scheme below illustrates how autodeploy works in the Tekton deploy scenario:

![Autodeploy in Tekton deploy scenario](https://github.com/epam/edp-cd-pipeline-operator/blob/master/docs/puml/autodeploy_argo_cd.png)
Expand All @@ -31,17 +30,3 @@ Under the hood, the autodeploy logic is implemented in the following way:
5. Lastly, Argo CD deploys the newer image.

**Note:** In Tekton deploy scenario, autodeploy will start working only after the first manual deploy.

### Autodeploy in Jenkins

The scheme below illustrates the logic of the autodeploy feature in the Jenkins deploy scenario:

![Autodeploy in Jenkins deploy scenario](https://github.com/epam/edp-cd-pipeline-operator/blob/master/docs/puml/autodeploy_jenkins.png "Autodeploy in Jenkins deploy scenario")

Overall, autodeploy in Jenkins can be explained in the following way:

1. Once the stage with the enabled autodeploy feature is created, CD pipeline processes this stage and creates corresponding Jenkins job with the **autodeploy: true** parameter.
2. User clicks the **Build** button or merges patch to VCS.
3. When the application build is launched, Jenkins attaches a specific tag to the CodebaseImageStream. This tag is further processed by the **codebase-operator**. As a result, the **CDStageDeploy** resource is created at the end of the process.
4. Next, the **codebase-operator** processes the **CDStageDeploy** resource. The **CDStageJenkinsDeployment** is created at the end of the process.
5. Finally, the **jenkins-operator** processes the **CDStageJenkinsDeployment** resource and triggers the Jenkins deploy job.
58 changes: 0 additions & 58 deletions docs/puml/arch.puml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ package cdpipeline-operator {
-- spec --
String cdPipeline
String description
String jobProvisioning
String name
Integer order
[]QualityGate qualityGates
Expand Down Expand Up @@ -108,17 +107,13 @@ package codebase-operator {
String ciTool
String commitMessagePattern
String defaultBranch
String deploymentScript
String description
Bool emptyProject
String framework
String gitServer
String gitUrlPath
String jenkinsSlave
String jiraIssueMetadataPayload
String jobProvisioning
String lang
Perf perf
Repository repository
Strategy strategy
String testReportFramework
Expand Down Expand Up @@ -180,63 +175,10 @@ package codebase-operator {
}
}

package jenkins-operator {
class JenkinsFolder {
-- metadata --
String name
-- spec --
String codebaseName
[]String job
String ownerName
-- status --
Boolean available
Integer jenkinsJobProvisionBuildNumber
Date lastTimeUpdated
String status
}

class JenkinsJob {
-- metadata --
String name
-- spec --
String jenkinsFolder
[]String job
String ownerName
String stageName
-- status --
ActionType action
Boolean available
String detailedMessage
Integer jenkinsJobProvisionBuildNumber
Date lastTimeUpdated
Result result
String status
String username
String value
}

class CDStageJenkinsDeployment <<autodeploy>>{
-- metadata --
String name
-- spec --
String job
[]Tag tags
}

CDStageJenkinsDeployment --> Tag : internal structure
class Tag <<autodeploy>>{
String codebase
String tag
}
}

JenkinsFolder <-- CdPipeline : "creates"
Codebase "1..*" o--- "1..*" CdPipeline : applicationsToPromote
CodebaseImageStream "1..*" o--- "1..*" CdPipeline : inputDockerStreams
CodebaseBranch "0..1" o--- "1..*" QualityGate : autotestName+branchName
JenkinsJob "1" <-- "1" Stage : creates CD Pipeline Job
CodebaseImageStream "1..*" <-- "1" Stage : creates verified stream
CDStageDeploy "1..*" <-- "1" CodebaseImageStream : triggerType: auto\n creates based on labels
CDStageJenkinsDeployment "1..*" <-=- "1" CDStageDeploy : creates

@enduml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ spec:
cdPipeline: mypipeline
clusterName: in-cluster
description: Development Environment
jobProvisioning: default
name: dev
namespace: edp-mypipeline-dev
order: 0
Expand Down Expand Up @@ -163,7 +162,6 @@ spec:
cdPipeline: mypipeline
clusterName: in-cluster
description: QA Environment
jobProvisioning: default
name: qa
namespace: custom-namespace
order: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec:
cdPipeline: mypipeline
clusterName: in-cluster
description: Development Environment
jobProvisioning: default
name: dev
namespace: edp-mypipeline-dev
order: 0
Expand All @@ -45,7 +44,6 @@ spec:
cdPipeline: mypipeline
clusterName: in-cluster
description: QA Environment
jobProvisioning: default
name: qa
# here we have custom namespace name instead of EDP pattern
namespace: custom-namespace
Expand Down

0 comments on commit 1869184

Please sign in to comment.