-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
160 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: friday | ||
time: "18:00" | ||
timezone: Europe/Madrid | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: docker | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: friday | ||
time: "18:00" | ||
timezone: Europe/Madrid | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Backend Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and push Frotnend image | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: hugo19941994 | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
repository: hugo19941994/moviepepper-backend | ||
tags: latest | ||
|
||
- name: Install doctl | ||
uses: digitalocean/action-doctl@v2 | ||
with: | ||
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} | ||
|
||
- name: Save DigitalOcean kubeconfig | ||
run: doctl kubernetes cluster kubeconfig save k8s-1-18-6-do-0-lon1-1595844489030 | ||
|
||
- name: Deploy to DigitalOcean Kubernetes | ||
run: kubectl apply -f manifest.yaml | ||
|
||
- name: Deploy to DigitalOcean Kubernetes | ||
run: kubectl rollout restart deployment/moviepepper-backend | ||
|
||
- name: Verify deployment | ||
run: kubectl rollout status deployment/moviepepper-backend | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Backend CI | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.8.x] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
node-version: ${{ matrix.python-version }} | ||
|
||
- name: Install pipenv | ||
run: sudo pip install pipenv | ||
|
||
- name: Install dependencies using Pipenv | ||
run: pipenv install --deploy --system | ||
|
||
- name: Download deps | ||
run: | | ||
python -m textblob.download_corpora | ||
python -m nltk.downloader stopwords | ||
- name: Test moviepepper-backend | ||
run: | | ||
coverage run --concurrency=multiprocessing tests.py | ||
coverage combine | ||
coveralls | ||
env: | ||
CI: true | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM python:3.8-slim | ||
|
||
RUN pip install pipenv | ||
|
||
WORKDIR /app | ||
COPY Pipfile* /app/ | ||
|
||
RUN pipenv install --system | ||
|
||
COPY . /app/ | ||
|
||
# 1 scrape | ||
WORKDIR /app/movie_scrape | ||
RUN START_URL="http://www.imdb.com/search/title?groups=top_1000&sort=user_rating,desc&page=1&ref" ./scrap.sh | ||
|
||
# 2 Calculate recommendations | ||
WORKDIR /app | ||
RUN python tfidf-lsa.py | ||
RUN python doc2vec.py | ||
|
||
# 3 Serve server | ||
CMD python server.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: moviepepper-backend | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: moviepepper-backend | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 80 | ||
targetPort: 3000 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: moviepepper-backend | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: moviepepper-backend | ||
template: | ||
metadata: | ||
labels: | ||
app: moviepepper-backend | ||
spec: | ||
containers: | ||
- name: moviepepper-backend | ||
image: hugo19941994/moviepepper-backend | ||
ports: | ||
- containerPort: 5000 | ||
protocol: TCP | ||
|
||
|