build: use pre-built poetry image
Some checks failed
gitea-physics/deepdog/pipeline/head There was a failure building this commit

This commit is contained in:
Deepak Mallubhotla 2023-04-09 17:35:37 -05:00
parent b3e2acd79c
commit 743c3e22ae
Signed by: deepak
GPG Key ID: BEBAEBF28083E022
2 changed files with 10 additions and 9 deletions

13
Jenkinsfile vendored
View File

@ -22,26 +22,25 @@ pipeline {
steps { steps {
echo 'Building...' echo 'Building...'
sh 'python --version' sh 'python --version'
sh 'curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python' sh 'poetry --version'
sh '${POETRY_HOME}/bin/poetry --version' sh 'poetry install'
sh '${POETRY_HOME}/bin/poetry install'
} }
} }
stage('Test') { stage('Test') {
parallel{ parallel{
stage('pytest') { stage('pytest') {
steps { steps {
sh '${POETRY_HOME}/bin/poetry run pytest' sh 'poetry run pytest'
} }
} }
stage('lint') { stage('lint') {
steps { steps {
sh '${POETRY_HOME}/bin/poetry run flake8 deepdog tests' sh 'poetry run flake8 deepdog tests'
} }
} }
stage('mypy') { stage('mypy') {
steps { steps {
sh '${POETRY_HOME}/bin/poetry run mypy deepdog' sh 'poetry run mypy deepdog'
} }
} }
} }
@ -57,7 +56,7 @@ pipeline {
} }
steps { steps {
echo 'Deploying...' echo 'Deploying...'
sh '${POETRY_HOME}/bin/poetry publish -u ${PYPI_USR} -p ${PYPI_PSW} --build' sh 'poetry publish -u ${PYPI_USR} -p ${PYPI_PSW} --build'
} }
} }

View File

@ -1,9 +1,11 @@
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
spec: spec:
imagePullSecrets:
- name: regcreds
containers: # list of containers that you want present for your build, you can define a default container in the Jenkinsfile containers: # list of containers that you want present for your build, you can define a default container in the Jenkinsfile
- name: python - name: poetry
image: python:3.8 image: ghcr.io/dmallubhotla/poetry-image:1
command: ["tail", "-f", "/dev/null"] # this or any command that is bascially a noop is required, this is so that you don't overwrite the entrypoint of the base container command: ["tail", "-f", "/dev/null"] # this or any command that is bascially a noop is required, this is so that you don't overwrite the entrypoint of the base container
imagePullPolicy: Always # use cache or pull image for agent imagePullPolicy: Always # use cache or pull image for agent
resources: # limits the resources your build contaienr resources: # limits the resources your build contaienr