From 549e551eed89e15fdd9128f0f492bd0b2b5facbf Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Sun, 30 Oct 2022 16:40:23 +0530 Subject: [PATCH 01/19] Create pipeline python-pipeline-samples --- .harness/pythonpipelinesamples.yaml | 96 +++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .harness/pythonpipelinesamples.yaml diff --git a/.harness/pythonpipelinesamples.yaml b/.harness/pythonpipelinesamples.yaml new file mode 100644 index 0000000..a1fa02d --- /dev/null +++ b/.harness/pythonpipelinesamples.yaml @@ -0,0 +1,96 @@ +pipeline: + name: python-pipeline-samples + identifier: pythonpipelinesamples + projectIdentifier: krishikasingh + orgIdentifier: default + tags: {} + properties: + ci: + codebase: + connectorRef: pysampleconnector + build: <+input> + depth: <+input> + prCloneStrategy: <+input> + stages: + - stage: + name: build test and run + identifier: build_test_and_run + type: CI + spec: + cloneCodebase: true + execution: + steps: + - step: + type: Run + name: Code compile + identifier: Code_compile + spec: + connectorRef: docker_Quickstart + image: python:3.10.6-alpine + shell: Sh + command: python -m compileall ./ + - step: + type: Run + name: Create docker file + identifier: Create_docker_file + spec: + connectorRef: docker_Quickstart + image: alpine + shell: Sh + command: |- + touch pythondockerfile + cat > pythondockerfile <<- EOM + FROM python:3.10.6-alpine + WORKDIR /python-pipeline-samples + ADD . /python-pipeline-samples + RUN pip install -r requirements.txt + CMD ["python3" , "./app.py"] + EOM + cat pythondockerfile + - step: + type: BuildAndPushDockerRegistry + name: Build and Push an image to docker registry + identifier: Build_and_Push_an_image_to_docker_registry + spec: + connectorRef: <+input> + repo: <+input> + tags: + - latest + dockerfile: pythondockerfile + optimize: true + infrastructure: + type: KubernetesHosted + spec: + identifier: k8s-hosted-infra + - stage: + name: Integration test + identifier: Integration_test + type: CI + spec: + cloneCodebase: true + infrastructure: + useFromStage: build_test_and_run + execution: + steps: + - step: + type: Background + name: "python server " + identifier: python_server + spec: + connectorRef: <+input> + image: <+input> + shell: Sh + command: python3 /python-pipeline-samples/app.py + description: "server connection " + failureStrategies: [] + - step: + type: Run + name: "test connection to server " + identifier: test_connection_to_server + spec: + connectorRef: <+input> + image: curlimages/curl:7.73.0 + shell: Sh + command: |- + sleep 10 + curl localhost:5000 From 49187d17c699f940de5809d560dfa632764807f0 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Sun, 30 Oct 2022 16:42:26 +0530 Subject: [PATCH 02/19] Update pipeline python-pipeline-samples --- .harness/pythonpipelinesamples.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.harness/pythonpipelinesamples.yaml b/.harness/pythonpipelinesamples.yaml index a1fa02d..e6370d4 100644 --- a/.harness/pythonpipelinesamples.yaml +++ b/.harness/pythonpipelinesamples.yaml @@ -58,10 +58,12 @@ pipeline: - latest dockerfile: pythondockerfile optimize: true - infrastructure: - type: KubernetesHosted - spec: - identifier: k8s-hosted-infra + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} - stage: name: Integration test identifier: Integration_test From 9261225d42d5c77aba88a9b28c64b3b33a94fd19 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Sun, 30 Oct 2022 16:45:16 +0530 Subject: [PATCH 03/19] Update pipeline python-pipeline-samples From 629fbb3374d8fd6ac04f10bbbd3ca2ed556864c2 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Sun, 30 Oct 2022 16:45:58 +0530 Subject: [PATCH 04/19] Update pipeline python-pipeline-samples From 67874e2f695b903ab79290ce815936c40e5dbd75 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Mon, 7 Nov 2022 22:01:37 +0530 Subject: [PATCH 05/19] Create .drone.yml --- .harness/.drone.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .harness/.drone.yml diff --git a/.harness/.drone.yml b/.harness/.drone.yml new file mode 100644 index 0000000..387b5e6 --- /dev/null +++ b/.harness/.drone.yml @@ -0,0 +1,9 @@ +kind: pipeline +name: python-pipeline-samples + +steps: +- name: test + image: python:3.10.6-alpine + command: + - python -m compileall ./ + From 7b51b28b41c7a8b813d16cab623adf7b9f98e00a Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Tue, 8 Nov 2022 18:00:05 +0530 Subject: [PATCH 06/19] Delete .drone.yml --- .harness/.drone.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .harness/.drone.yml diff --git a/.harness/.drone.yml b/.harness/.drone.yml deleted file mode 100644 index 387b5e6..0000000 --- a/.harness/.drone.yml +++ /dev/null @@ -1,9 +0,0 @@ -kind: pipeline -name: python-pipeline-samples - -steps: -- name: test - image: python:3.10.6-alpine - command: - - python -m compileall ./ - From bc77e54cfaf9c30c38b0bcca815c633a6078ba3c Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 13:00:28 +0530 Subject: [PATCH 07/19] Create .drone.yml --- .drone.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..ea5228a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: greeting + image: alpine + commands: + - echo hello + - echo world From 45f94055ff6280e84258e1c61d14ba3b36c5dabc Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 13:03:49 +0530 Subject: [PATCH 08/19] Delete .drone.yml --- .drone.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index ea5228a..0000000 --- a/.drone.yml +++ /dev/null @@ -1,10 +0,0 @@ -kind: pipeline -type: docker -name: default - -steps: -- name: greeting - image: alpine - commands: - - echo hello - - echo world From cf387fe12e614c39e6fe47053b85817956a62bff Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 13:04:15 +0530 Subject: [PATCH 09/19] Create .drone.yml --- .drone.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..ea5228a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +kind: pipeline +type: docker +name: default + +steps: +- name: greeting + image: alpine + commands: + - echo hello + - echo world From e1bd86fdb93b37feb9dc4e1261aef9bc943bedc8 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 13:15:47 +0530 Subject: [PATCH 10/19] Update .drone.yml --- .drone.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index ea5228a..3a78ecf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,10 +1,15 @@ kind: pipeline type: docker -name: default +name: build test and run steps: -- name: greeting +- name: run + image: python:3.10.6-alpine + commands: + - python -m compileall ./ + +- name: en image: alpine commands: - - echo hello - - echo world + - echo hello world + From ef1380a633dad46ec87757a1ada814c15bb0451d Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 14:21:38 +0530 Subject: [PATCH 11/19] Update .drone.yml --- .drone.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3a78ecf..6190248 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,8 +8,24 @@ steps: commands: - python -m compileall ./ -- name: en +- name: create docker file image: alpine commands: - - echo hello world + - touch pythondockerfile + cat > pythondockerfile <<- EOM + FROM python:3.10.6-alpine + WORKDIR /python-pipeline-samples + ADD . /python-pipeline-samples + RUN pip install -r requirements.txt + CMD ["python3" , "./app.py"] + EOM + cat pythondockerfile + +- name: build and push to docker registry + image: plugins/docker + settings: + username: krishi0408 + password: Krishika@123 + repo: krishi0408/pythonsample + tags: latest From aecf409230f491651c49524baf78f6584596ecbb Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 14:36:15 +0530 Subject: [PATCH 12/19] Update .drone.yml --- .drone.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.drone.yml b/.drone.yml index 6190248..7048142 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,3 +29,24 @@ steps: password: Krishika@123 repo: krishi0408/pythonsample tags: latest +--- +kind: pipeline +type: docker +name: integration test + + +steps: +- name: python-server + image: krishi0408/pythonsample + commands: + - python3 ./app.py + + services: + - name: python-service + image: krishi0408/pythonsample + + - name: test connection to server + image: curlimages/curl:7.73.0 + commands: + - sleep 10 + curl python_server:5000 From a47324ef1a6a2c4eadc9c5dac87551cb48ba7f21 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 14:40:06 +0530 Subject: [PATCH 13/19] Update .drone.yml --- .drone.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index 7048142..2cdc005 100644 --- a/.drone.yml +++ b/.drone.yml @@ -32,21 +32,10 @@ steps: --- kind: pipeline type: docker -name: integration test - +name: integration test steps: -- name: python-server - image: krishi0408/pythonsample - commands: - - python3 ./app.py - - services: - - name: python-service - image: krishi0408/pythonsample - - - name: test connection to server - image: curlimages/curl:7.73.0 +- name: np + image: alpine commands: - - sleep 10 - curl python_server:5000 + - echo hello From c8f3683a11bb90920ee01900b3f1d5e1b98cfc2c Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 14:45:40 +0530 Subject: [PATCH 14/19] Update .drone.yml --- .drone.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2cdc005..73b6c22 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,7 +35,12 @@ type: docker name: integration test steps: -- name: np - image: alpine +- name: python-server + image: krishi0408/pythonsample commands: - - echo hello + - python3 ./app.py + +services: +- name: python-services + image: krishi0408/pythonsample + From e3b79c3750fc2077646abaf2ab72d4ddd7705a14 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 14:49:06 +0530 Subject: [PATCH 15/19] Update .drone.yml --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 73b6c22..bdc257a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -43,4 +43,10 @@ steps: services: - name: python-services image: krishi0408/pythonsample + +- name: test-connetion-to-server + image: curlimages/curl:7.73.0 + commands: + - sleep 10 + curl python-server:5000 From 6d28ae2b2557ceceb33c81961328bcd2db2a26e8 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 14:52:59 +0530 Subject: [PATCH 16/19] Update .drone.yml --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index bdc257a..27a181c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,3 +50,7 @@ services: - sleep 10 curl python-server:5000 +- name: run_done + image: alpine + commands: + - echo hello From 5d3989f9f649e8522f1b579085462c853e7f01e9 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 18:05:44 +0530 Subject: [PATCH 17/19] Update .drone.yml --- .drone.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 27a181c..33ce144 100644 --- a/.drone.yml +++ b/.drone.yml @@ -49,8 +49,3 @@ services: commands: - sleep 10 curl python-server:5000 - -- name: run_done - image: alpine - commands: - - echo hello From 3048ad59be4adc6a33cdbbf4e415e76ae36d3170 Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Fri, 6 Jan 2023 18:11:10 +0530 Subject: [PATCH 18/19] Update .drone.yml --- .drone.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.drone.yml b/.drone.yml index 33ce144..ee61f62 100644 --- a/.drone.yml +++ b/.drone.yml @@ -29,23 +29,4 @@ steps: password: Krishika@123 repo: krishi0408/pythonsample tags: latest ---- -kind: pipeline -type: docker -name: integration test -steps: -- name: python-server - image: krishi0408/pythonsample - commands: - - python3 ./app.py - -services: -- name: python-services - image: krishi0408/pythonsample - -- name: test-connetion-to-server - image: curlimages/curl:7.73.0 - commands: - - sleep 10 - curl python-server:5000 From fe38be1db00096db781554321aeefefb8472443f Mon Sep 17 00:00:00 2001 From: Krishika Singh Date: Sun, 5 Feb 2023 13:51:04 +0530 Subject: [PATCH 19/19] Delete .drone.yml --- .drone.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index ee61f62..0000000 --- a/.drone.yml +++ /dev/null @@ -1,32 +0,0 @@ -kind: pipeline -type: docker -name: build test and run - -steps: -- name: run - image: python:3.10.6-alpine - commands: - - python -m compileall ./ - -- name: create docker file - image: alpine - commands: - - touch pythondockerfile - cat > pythondockerfile <<- EOM - FROM python:3.10.6-alpine - WORKDIR /python-pipeline-samples - ADD . /python-pipeline-samples - RUN pip install -r requirements.txt - CMD ["python3" , "./app.py"] - EOM - cat pythondockerfile - - -- name: build and push to docker registry - image: plugins/docker - settings: - username: krishi0408 - password: Krishika@123 - repo: krishi0408/pythonsample - tags: latest -