diff --git a/.harness/Test_Shell_Script_Pipeline.yaml b/.harness/Test_Shell_Script_Pipeline.yaml new file mode 100644 index 0000000..97bf26b --- /dev/null +++ b/.harness/Test_Shell_Script_Pipeline.yaml @@ -0,0 +1,60 @@ +pipeline: + name: Test_Shell_Script_Pipeline + identifier: Test_Shell_Script_Pipeline + projectIdentifier: shashank_sandbox + orgIdentifier: default + tags: {} + properties: + ci: + codebase: + connectorRef: shashank_github + repoName: goHelloWorldServer + build: <+input> + stages: + - stage: + name: test_build + identifier: test_build + description: "" + type: CI + spec: + cloneCodebase: true + execution: + steps: + - step: + type: Run + name: Run_1 + identifier: Run_1 + spec: + connectorRef: Shashank_docker + image: golang:1.15 + shell: Sh + command: | + go get gotest.tools/gotestsum + gotestsum --format=standard-verbose --junitfile unit-tests.xml || true + sleep 5m + testresult="passed" + testfail=$(grep -c " + sources: <+input> + environment: + environmentRef: qa_env + deployToAll: false + infrastructureDefinitions: + - identifier: myinfra + execution: + steps: + - step: + type: TerraformPlan + name: TerraformPlan + identifier: TerraformPlan_1 + spec: + provisionerIdentifier: qa987 + configuration: + command: Apply + configFiles: + store: + spec: + connectorRef: Shashank_github_connector + repoName: terraform-provider-kubernetes + gitFetchType: Branch + branch: main + folderPath: _examples/gke + type: Github + moduleSource: + useConnectorCredentials: false + secretManagerRef: account.harnessSecretManager + skipRefreshCommand: false + timeout: 10m + - step: + type: HarnessApproval + name: HarnessApproval_1 + identifier: HarnessApproval_1 + spec: + approvalMessage: Please review the following information and approve the pipeline progression + includePipelineExecutionHistory: true + isAutoRejectEnabled: false + approvers: + userGroups: + - mygroup + minimumCount: 1 + disallowPipelineExecutor: false + approverInputs: [] + timeout: 1d + - step: + type: TerraformApply + name: TerraformApply_1 + identifier: TerraformApply_1 + spec: + provisionerIdentifier: qa987 + configuration: + type: InheritFromPlan + timeout: 10m + rollbackSteps: [] + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: Abort diff --git a/.harness/myfirstdeployment.yaml b/.harness/myfirstdeployment.yaml new file mode 100644 index 0000000..88f2cea --- /dev/null +++ b/.harness/myfirstdeployment.yaml @@ -0,0 +1,54 @@ +pipeline: + name: myfirstdeployment + identifier: myfirstdeployment + projectIdentifier: shashank_sandbox + orgIdentifier: default + tags: {} + stages: + - stage: + name: QA + identifier: QA + description: "" + type: Deployment + spec: + deploymentType: Kubernetes + service: + serviceRef: myhelloworld + serviceInputs: + serviceDefinition: + type: Kubernetes + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: mykubernates + deployToAll: false + infrastructureDefinitions: + - identifier: myinfra + execution: + steps: + - step: + name: Rollout Deployment + identifier: rolloutDeployment + type: K8sRollingDeploy + timeout: 10m + spec: + skipDryRun: false + pruningEnabled: false + rollbackSteps: + - step: + name: Rollback Rollout Deployment + identifier: rollbackRolloutDeployment + type: K8sRollingRollback + timeout: 10m + spec: + pruningEnabled: false + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback diff --git a/.harness/myinputset.yaml b/.harness/myinputset.yaml new file mode 100644 index 0000000..09c632c --- /dev/null +++ b/.harness/myinputset.yaml @@ -0,0 +1,25 @@ +inputSet: + name: myinputset + identifier: myinputset + orgIdentifier: default + projectIdentifier: shashank_sandbox + pipeline: + identifier: myfirstdeployment + stages: + - stage: + identifier: QA + type: Deployment + spec: + service: + serviceInputs: + serviceDefinition: + type: Kubernetes + spec: + artifacts: + primary: + primaryArtifactRef: myimage + sources: + - identifier: myimage + type: DockerRegistry + spec: + digest: <+input> diff --git a/config/myfile.yaml b/config/myfile.yaml new file mode 100644 index 0000000..96cff5d --- /dev/null +++ b/config/myfile.yaml @@ -0,0 +1,56 @@ +template: + name: myfile + type: Pipeline + projectIdentifier: shashank_sandbox + orgIdentifier: default + spec: + stages: + - stage: + name: QA + identifier: QA + description: "" + type: Deployment + spec: + deploymentType: Kubernetes + service: + serviceRef: myhelloworld + serviceInputs: + serviceDefinition: + type: Kubernetes + spec: + artifacts: + primary: + primaryArtifactRef: <+input> + sources: <+input> + environment: + environmentRef: mykubernates + deployToAll: false + infrastructureDefinitions: + - identifier: myinfra + execution: + steps: + - step: + name: Rollout Deployment + identifier: rolloutDeployment + type: K8sRollingDeploy + timeout: 10m + spec: + skipDryRun: false + pruningEnabled: false + rollbackSteps: + - step: + name: Rollback Rollout Deployment + identifier: rollbackRolloutDeployment + type: K8sRollingRollback + timeout: 10m + spec: + pruningEnabled: false + tags: {} + failureStrategies: + - onFailure: + errors: + - AllErrors + action: + type: StageRollback + versionLabel: MyDeploymentTemplate + identifier: myfile diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..2ca2ed2 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: guestbook-ui +spec: + replicas: 3 + revisionHistoryLimit: 3 + selector: + matchLabels: + app: guestbook-ui + template: + metadata: + labels: + app: guestbook-ui + spec: + containers: + - image: gcr.io/heptio-images/ks-guestbook-demo:0.1 + name: guestbook-ui + ports: + - containerPort: 80 diff --git a/hello_server.go b/hello_server.go index df038fd..6e0be6b 100644 --- a/hello_server.go +++ b/hello_server.go @@ -23,7 +23,7 @@ func CreateGreeting(name string) string { if name == "" { name = "Guest" } - return "Hello, " + name + "\n" + return "Hellooooo11, " + name + "\n" } func main() {