diff --git a/.harness/pythonpipelinesamples.yaml b/.harness/pythonpipelinesamples.yaml new file mode 100644 index 0000000..e6370d4 --- /dev/null +++ b/.harness/pythonpipelinesamples.yaml @@ -0,0 +1,98 @@ +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 + platform: + os: Linux + arch: Amd64 + runtime: + type: Cloud + spec: {} + - 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