Key functionalities: | RESTful web service + CI |
Tech used: | Python, Django, PostgreSQL, Docker, Jenkins |
- Clone the repo
git clone https://github.com/hanjustin/Poll-Web.git
- Start Jenkins CI & Postgres
docker compose up
- Create database tables
python manage.py migrate
- Run
python manage.py runserver
- Use the webservice XXXX
curl -XGET -H "Content-type: application/json" -d '{"name": "Justin", "username": "hanjustin"}' 'http://localhost:8080/api/users/'
docker compose up
runs both Jenkins Postgres together. To run them separately, use the commands below:
- Build Jenkins image
docker build -t jenkinsimage .
- Run the image in Docker
docker run --name jenkins -p 8080:8080 --env JENKINS_ADMIN_ID=admin --env JENKINS_ADMIN_PASSWORD=password jenkinsimage
docker run --name postgres-test -e POSTGRES_DB=djangoPostgreSQL -e POSTGRES_USER=mydatabaseuser -e POSTGRES_PASSWORD=mypassword -p 5433:5432 postgres