Skip to content

Commit c3f1162

Browse files
authored
Merge pull request #223 from Seluj78/feature/superlike
2 parents e9d6bfb + c2af866 commit c3f1162

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+288
-130
lines changed

.env.enc

480 Bytes
Binary file not shown.

.travis.yml

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,48 +9,55 @@ python:
99

1010
services:
1111
- mysql
12-
- redis-server
12+
- redis
1313

14-
install: pip install -r backend/requirements.txt
14+
# TODO: Reformat file as it is ugly. separatee jobs in yml, and lint as the last job to run
1515

1616
jobs:
1717
include:
18-
# - stage: build
19-
# script: make build
20-
- stage: lint
21-
script: black --check backend
22-
# script: make lint
23-
# - stage: tests
18+
- stage: build
19+
script:
20+
- openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
21+
# login to github registry
22+
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.pkg.github.com
23+
# build image
24+
- docker build -t docker.pkg.github.com/seluj78/pymatcha/pymatcha-api:latest .
25+
# push image
26+
- docker push docker.pkg.github.com/seluj78/pymatcha/pymatcha-api:latest
27+
# - stage: test
2428
# before_script:
25-
# - wget https://repo.mysql.com//mysql-apt-config_0.8.14-1_all.deb
26-
# - sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb
27-
# - sudo apt-get update -q
28-
# - sudo apt-get install -q -y --allow-unauthenticated -o Dpkg::Options::=--force-confnew mysql-server
29-
# - sudo systemctl restart mysql
30-
# - sudo mysql_upgrade
31-
# - mysql --version
32-
# - mysql -e 'CREATE DATABASE pymatcha;'
33-
# - npm install newman
34-
# - node_modules/.bin/newman --version
35-
# - python backend/app.py &
36-
# - sleep 5
37-
# script: node_modules/.bin/newman run --delay-request 20 --color on --verbose PyMatcha.postman_collection.json
38-
# - stage: deploy
39-
# script: ./deploy
29+
# - node --version
30+
# - npm --version
31+
# - npm install -g newman
32+
# - newman --version
33+
# script:
34+
# # login to github registry
35+
# - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin docker.pkg.github.com
36+
# # pull images
37+
# - docker pull docker.pkg.github.com/seluj78/pymatcha/pymatcha-api:latest
38+
# # decrypt the env file
39+
# - openssl aes-256-cbc -K $encrypted_3c84dcdc6bbe_key -iv $encrypted_3c84dcdc6bbe_iv -in .env.enc -out .env -d
40+
# # Run the backend api
41+
# - docker run -d -p 5000:5000 --restart always --env-file .env docker.pkg.github.com/seluj78/pymatcha/pymatcha-api:latest
42+
# # Wait for docker to be up
43+
# - sleep 10
44+
# # run newman tests
45+
# - newman run --color on 'PyMatcha.postman_collection.json'
46+
# after_script:
47+
# # stop and remove docker to prevent them from block port at next iteration/test
48+
# - docker stop $(docker ps -a -q)
49+
# - docker rm $(docker ps -a -q)
50+
- stage: lint
51+
before_script:
52+
- pip install -r backend/requirements.txt
53+
script:
54+
- black --check backend/
55+
- flake8 backend/
4056

4157
notifications:
4258
email:
4359
recipients:
4460
- jlasne@student.42.fr
45-
- gmorer@student.42.fr
61+
- lauris.skraucis@gmail.com
4662
on_success: change
4763
on_failure: always
48-
49-
50-
#deploy:
51-
# provider: heroku
52-
# api_key:
53-
# secure: kUtYCOzPTUlcJ8nicEynPq39xfVgUtl8LT2zdh/L1MQ6SRKYKT6V+TWSuGNXc9YRn7Sd6dVqYDimz3aK7eQrdBehZxuHy1FvL9qzdWsGeefrFDD5VKf5qyRFmX1+nSir/5WBsGRUhlcPiqMo2WvRWrrARiM+kscULJCpxUJ/rqk2XSxKY+UikWpKgmcgK8ONBdrmK0+ixEqwOHHLU/WfBPHOAdmZM7V3DIeWq75dYee7rfFSejHsUzm8nsMszy5kgsFWj82daYqUTWOVe92v/E5bwGHhqmX2qjXO9d5qm3dVwg7L7gUHB2cUL3sp5EXiH9OdmZhE+QHob155ApkwMqYJo5L7U7/4Az7i/6oiTOfbnUCyCK2g9D0Qng6T4OwlsfH1l182V5I4fWIN94sQuEhh2W+Auu5EjhmsSMwCdYYuI6K5V4ht2aCLVlQ5jdfG8rt78kjsrjLlw8Vu2aprkM1JrTiUFGr5legrAX40BpozOFl913waRScJc65BsBnVkrFeTrmlmWIXe63Gc4LKXc8XaAqVLl3cyhIIyQ4Q0km5UH8/nraKDzw0I0sLLmk2AXBDEnNHDt2E1QmacsfaX+XE2URT74YVBRmxRdpJv6vJsvZEtXpRMHrzf4DK4coS1q5rkHnUXpajf65tB//isrQkbtENnjFZ1EP0zE9OJwY=
54-
# app: pymatcha
55-
# on:
56-
# repo: Seluj78/PyMatcha

Dockerfile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
FROM node:14.3-alpine3.10 AS frontend
2-
WORKDIR /src
3-
ADD frontend .
4-
RUN npm i
5-
ADD .env .
6-
RUN export $(cat .env | xargs)
7-
RUN npm run build
8-
91
FROM python:3.8.3-buster
102
WORKDIR /www
113
ADD backend/requirements.txt .
124
ADD .env .
135
RUN export $(cat .env | xargs)
146
RUN pip install -r requirements.txt
157
ADD backend .
16-
COPY --from=frontend /src/build frontend
178
ENV PYTHONDONTWRITEBYTECODE 1
18-
ENV IS_DOCKER_COMPOSE true
199
EXPOSE 5000
20-
CMD gunicorn --chdir /www app:application -w 2 --threads 2 -b 0.0.0.0:5000
10+
CMD exec gunicorn --chdir /www --bind :5000 --workers 1 --threads 1 PyMatcha:application

0 commit comments

Comments
 (0)