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

pr test #57

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .harness/pythonpipelinesamples.yaml
Original file line number Diff line number Diff line change
@@ -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