Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
chatbot/Jenkinsfile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26 lines (24 sloc)
926 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
checkout scm | |
stage('Build and Test') { | |
docker.image('redis:alpine').withRun { c -> | |
docker.image('python:3.5').inside( | |
"-e HOME=${env.WORKSPACE} --network container:${c.id}") { | |
withCredentials([file(credentialsId: 'ChatbotConfig', | |
variable: 'FILE')]) { | |
sh 'mv $FILE config.json' | |
sh 'pip install --user -r requirements.txt' | |
sh 'python -m unittest discover -p "*_test.py"' | |
} | |
} | |
} | |
} | |
stage('Docker') { | |
def REGISTRY_URL = 'registry.declansoper.xyz' | |
def REGISTRY_PROTO = 'https' | |
docker.withRegistry("${REGISTRY_PROTO}://${REGISTRY_URL}/", 'DockerRegistry') { | |
def image = docker.build("${REGISTRY_URL}/chatbot:${env.BRANCH_NAME}") | |
image.push() | |
} | |
} | |
} |