Skip to content

Commit e6d5894

Browse files
authored
Update Jenkinsfile
1 parent 1f3719e commit e6d5894

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Jenkinsfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@ pipeline {
55
}
66
stages {
77
stage("Build") {
8-
steps {
9-
sh "git clone https://github.com/codingelle/django-whatsapp-web-clone.git"
10-
dir("django-whatsapp-web-clone"){
11-
sh "podman build -t django-app ."
12-
}
8+
steps {
139
sh """
10+
git clone https://github.com/codingelle/django-whatsapp-web-clone.git
1411
podman pod create -n ci-pod -p 8081:80 -p 8082:8082 -p 6379:6379 -p 5432:5432
1512
podman run --pod=ci-pod -d --name redis-svc registry.redhat.io/rhel8/redis-5:1-160.1647451816
1613
podman run --pod=ci-pod -d --name postgres-svc --env-file=$MYHOME/.env registry.redhat.io/rhel8/postgresql-12:1-99.1647451835
17-
podman run --pod=ci-pod -d --name app-svc --env-file=$MYHOME/.env localhost/django-app:latest
1814
"""
15+
//podman run --pod=ci-pod -d --name app-svc --env-file=$MYHOME/.env localhost/django-app:latest
1916
}
2017
}
2118

2219
stage("Test") {
2320
steps {
24-
sh 'podman exec -ti app-svc bash -c "python manage.py test"'
21+
sh 'podman run -u root --pod ci-pod --name app-svc --env-file=$MYHOME/.env -v $MYHOME/:/opt/app-root/src/ registry.access.redhat.com/ubi8/python-38 bash -c "pip install -U pip && pip install -r requirements.txt && python manage.py migrate && python manage.py createsuperuser --no-input && python manage.py test"'
22+
//sh 'podman run -u root --pod ci-pod --name app-svc --env-file=$MYHOME/.env -v $MYHOME/:/opt/app-root/src/ registry.access.redhat.com/ubi8/python-38 bash -c "pip install -U pip && pip install -r requirements.txt && python manage.py migrate && python manage.py createsuperuser --no-input && daphne -b 0.0.0.0 -p 8080 django_channel_tutorial.asgi:application && python manage.py test"'
2523
}
2624
}
2725

0 commit comments

Comments
 (0)