Compare commits

..

2 Commits

Author SHA1 Message Date
Amber McCloughan cbc3cc26ed Merge branch 'main' of https://ailuridae.io/git/amber/everybody-mov
Apps/everybody-mov/pipeline/head This commit looks good Details
Merging main
2022-09-02 00:37:06 -04:00
Amber McCloughan a066142307 Adding Jenkinsfile for checking, building, and publishing 2022-09-02 00:35:32 -04:00
3 changed files with 73 additions and 3 deletions

View File

@ -1,9 +1,9 @@
FROM python:3.10-alpine
WORKDIR /app
WORKDIR /app/
ENV PYTHONIOENCODING=utf-8
COPY Pipfile Pipfile.lock everybody.txt tweetbot.py /app
COPY Pipfile Pipfile.lock everybody.txt tweetbot.py /app/
# Install pipenv and compilation dependencies
RUN pip install pipenv && pipenv install --deploy --ignore-pipfile

70
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,70 @@
pipeline {
agent none
environment {
HOME = "${env.WORKSPACE}"
DOCKER_REGISTRY = 'https://registry.digitalocean.com'
DOCKER_IMAGE_NAME = 'registry.digitalocean.com/ailuridae-registry/ailuridae.io/everybodymov'
DOCKER_IMAGE = ''
}
stages {
stage('Setup') {
agent {
docker {
image 'python:3.10-slim-bullseye'
}
}
steps {
sh 'python -m pip install --no-cache-dir --upgrade --user pip'
sh 'python -m pip install --no-cache-dir pipenv --user'
sh 'python -m pipenv install --dev'
}
}
stage('Check') {
agent {
docker {
image 'python:3.10-slim-bullseye'
}
}
steps {
sh 'python -m pipenv verify'
sh 'python -m pipenv check --clear'
sh 'python -m pipenv run bandit *.py'
}
}
stage('Build') {
agent {
label 'main'
}
steps {
script {
DOCKER_IMAGE = docker.build("${DOCKER_IMAGE_NAME}")
}
}
}
stage('Publish') {
agent {
label 'main'
}
steps {
script {
docker.withRegistry(env.DOCKER_REGISTRY, 'digital-ocean-ailuridae-registry') {
DOCKER_IMAGE.push("${BUILD_NUMBER}")
DOCKER_IMAGE.push('latest')
}
}
}
}
}
post {
always {
node('main') {
cleanWs()
}
}
}
}

2
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "3dc4c0a387fc9c5280d0dbfadae8f3d7cac3ddf589af5ec78dfe7090ff2684f2"
"sha256": "e7a1785570cb6182573b0e15cae2ad2c86adb2c280e88ceaa9126c232b720c9c"
},
"pipfile-spec": 6,
"requires": {