Skip to content

Repo for Electronic Business project - EShop, Docker, Bash

Notifications You must be signed in to change notification settings

Billypl/NazwaZespolu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

149 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An online shop

Online shop made with PrestaShop for Electronic Buisness class.
Oryginal page: https://www.pasart.pl/

Table of contents

Used software

  • Linux / WSL
  • PrestaShop 1.7.8.11
  • MariaDB 11.5.2
  • Docker
  • Selenium
  • Google Drive

Summary

This project was aimed for ease of run, so all proceses were automated with bash scripts. If you wish to learn more about encountered problems with different requirements, check out pull request messages and comments.

How to run locally (dev)?

TL;DR:

Just run quick_start.sh script or paste those commands:

cd integration/local
./run.sh -d
./restore_all.sh
# on windows
explorer.exe http://localhost:8080/
# on linux
xdg-open http://localhost:8080/

Detailed

!Notice -remember about database dumps/restores - read more in backup/restore section
Go to ./integration/local

To run the shop:

./run.sh # foreground
./run.sh -d # background

Then restore database (!).
After that you can access the shop on:

http://localhost:8080/ # front page
http://localhost:8080/admin-dev # admin panel
# login and password to admin panel
demo@prestashop.com
prestashop_demo

To stop the shop and cleanup docker:

./stop.sh

Database backup and restoration

!Notice - you need to have your shop running in order to make dump/restore
Learn when to create restore database.
Go to ./integration/local

For restoration:

# when first time running shop
./restore_all.sh
# when running every other time
./restore_db.sh

For backup creation:

./backup.sh
# Dump will be created in prestashop/dbdump

Important

Do database dump right before the GIT COMMIT to save changes.
Do database restore right after GIT PULL to load updated changes.

Explanation1: prestashop manages that database, so it may change when you change someting in admin panel - hence need for constant dumping
Explanation2: databse is not versioned directly, but rather through sql-dump - hence need for loading the dump into database

SSL certificate

SSL cert generation README.md were created with step by step tutorial on how to generate and setup certificate. Check it out for more information.

Tests

For complete info about selenium tests refer to tests README.md. Simple steps to run:

cd tests
./prepare.sh
./run.sh

Deployment on cluster

TL;DR

Just run ./deploy.sh

Detailed:

# transfering neccessary files to cluster
./transfer_file.sh ../../prestashop/docker-compose.prod.yaml docker-compose.yaml
./transfer_file.sh ../../prestashop/dbdump/dump.sql dump.sql 
./transfer_file.sh ./init_db.sh init_db.sh
qwe123 # type password 6 times
# getting to team folder
ssh rsww@172.20.83.101
qwe123
ssh hdoop@student-swarm01.maas
cd /opt/storage/actina15-20/block-storage/students/projects/students-swarm-services/BE_188898
# setting up stack
docker stack rm BE_188898
docker stack deploy -c docker-compose.prod.yaml BE_188898 --with-registry-auth

# check with `docker ps` what ID of prestashop container is - <container_id>
docker ps -q -f name="BE_188898_ps" # getting <container_id>
docker cp init_db.sh <container_id>:init_db.sh
docker cp dump.sql <container_id>:dump.sql
docker exec -it <container_id> bash
cd /
./init_db.sh

Accessing

# access shop page on https://localhost:18889/index.php
ssh -L 18889:student-swarm01.maas:18889  rsww@172.20.83.101
# view at database on https://localhost:9099 (username=root, password=student)
ssh -L 9099:student-swarm01.maas:9099  rsww@172.20.83.101

Image building and taging

docker build . -t billypl/be_188898_prestashop-v1:latest
docker push billypl/be_188898_prestashop-v1:latest

Team

  • Michał Pawiłojć 193159
  • Krzysztof Rzeszotarski 193627
  • Michał Węsiora 193126
  • Julian Kulikowski 188898

About

Repo for Electronic Business project - EShop, Docker, Bash

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •