Dockerfile
This commit is contained in:
parent
4038adf14d
commit
8c779e180c
3 changed files with 9 additions and 12 deletions
4
Dockerfile
Normal file
4
Dockerfile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
FROM python:3.13-slim
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
CMD ["python3", "test.py"]
|
||||
13
Jenkinsfile
vendored
13
Jenkinsfile
vendored
|
|
@ -2,17 +2,10 @@ pipeline {
|
|||
agent any
|
||||
|
||||
stages {
|
||||
stage('Install Python') {
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Installing Python...'
|
||||
sh 'apt-get update && apt-get install -y python3 python3-pip'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'Running tests...'
|
||||
sh 'python3 test.py'
|
||||
echo 'Building...'
|
||||
sh 'docker build -t my-python-app .'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
test.py
4
test.py
|
|
@ -2,9 +2,9 @@ from time import sleep
|
|||
|
||||
|
||||
def main():
|
||||
while True:
|
||||
for _ in range(100):
|
||||
print('Hello, World!')
|
||||
sleep(1)
|
||||
sleep(3)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue