Jenkinsfile added
This commit is contained in:
@@ -22,6 +22,8 @@ COPY --from=builder /opt/venv /opt/venv
|
|||||||
ENV PATH="/opt/venv/bin:$PATH"
|
ENV PATH="/opt/venv/bin:$PATH"
|
||||||
|
|
||||||
#COPY ./fet2020 /app
|
#COPY ./fet2020 /app
|
||||||
|
COPY ./fet2020 /app
|
||||||
|
COPY ./assets /app/assets
|
||||||
COPY ./deployment/nginx.conf /etc/nginx/conf.d/fet2020.conf
|
COPY ./deployment/nginx.conf /etc/nginx/conf.d/fet2020.conf
|
||||||
|
|
||||||
#RUN python manage.py makemigrations && python manage.py makemigrations posts members
|
#RUN python manage.py makemigrations && python manage.py makemigrations posts members
|
||||||
|
|||||||
50
Jenkinsfile
vendored
Normal file
50
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
stages {
|
||||||
|
stage('Checkout'){
|
||||||
|
steps {
|
||||||
|
git credentialsId: '3e336704-7d58-4dcb-88b6-1ef7b5392576', url: 'https://git.fet.at/bofh/fet2020.git'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('build Test') {
|
||||||
|
steps{
|
||||||
|
script {
|
||||||
|
app = docker.build("django2020test", "-f Dockerfile .")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Test Inside') {
|
||||||
|
steps{
|
||||||
|
script {
|
||||||
|
app.inside("-u root:root") {
|
||||||
|
sh 'ls && cd fet2020 && ls && ./manage.py test'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('build') {
|
||||||
|
steps{
|
||||||
|
script {
|
||||||
|
app = docker.build("fet2020django", "-f Dockerfile.test .")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy Image') {
|
||||||
|
steps{
|
||||||
|
script {
|
||||||
|
docker.withRegistry( 'https://docker.fet.at/', '3e336704-7d58-4dcb-88b6-1ef7b5392576') {
|
||||||
|
app.push("1.$BUILD_NUMBER")
|
||||||
|
app.push('latest')
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user