parent
2357d8551b
commit
4099b4cf13
@ -1,101 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: BB_PIPELINE
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: deploy-container-db
|
|
||||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
||||||
environment:
|
|
||||||
IMAGENAME: mariadb:10
|
|
||||||
CONTAINERNAME: bigbrotherdb
|
|
||||||
COMMAND: create
|
|
||||||
OVERWRITE: true
|
|
||||||
PRIVATE: true
|
|
||||||
CODEFIRST_CLIENTDRONE_ENV_MARIADB_ROOT_PASSWORD:
|
|
||||||
from_secret: db_root_password
|
|
||||||
CODEFIRST_CLIENTDRONE_ENV_MARIADB_DATABASE:
|
|
||||||
from_secret: db_database
|
|
||||||
CODEFIRST_CLIENTDRONE_ENV_MARIADB_USER:
|
|
||||||
from_secret: db_user
|
|
||||||
CODEFIRST_CLIENTDRONE_ENV_MARIADB_PASSWORD:
|
|
||||||
from_secret: db_password
|
|
||||||
|
|
||||||
- name: create-bigbrother-database
|
|
||||||
image: python:latest
|
|
||||||
commands:
|
|
||||||
- cd database/
|
|
||||||
- pip3 install mariadb
|
|
||||||
- python3 db-creation.py
|
|
||||||
environment:
|
|
||||||
MARIADB_USER:
|
|
||||||
from_secret: db_user
|
|
||||||
MARIADB_PASSWORD:
|
|
||||||
from_secret: db_password
|
|
||||||
MARIADB_DATABASE:
|
|
||||||
from_secret: db_database
|
|
||||||
depends_on: [ deploy-container-db ]
|
|
||||||
|
|
||||||
- name: build-image-server
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
dockerfile: callback-server/Dockerfile
|
|
||||||
context: ./
|
|
||||||
registry: hub.codefirst.iut.uca.fr
|
|
||||||
repo: hub.codefirst.iut.uca.fr/felix.mielcarek/big-brother-server
|
|
||||||
username:
|
|
||||||
from_secret: SECRET_REGISTRY_USERNAME
|
|
||||||
password:
|
|
||||||
from_secret: SECRET_REGISTRY_PASSWORD
|
|
||||||
environment:
|
|
||||||
MARIADB_USER:
|
|
||||||
from_secret: db_user
|
|
||||||
MARIADB_PASSWORD:
|
|
||||||
from_secret: db_password
|
|
||||||
MARIADB_DATABASE:
|
|
||||||
from_secret: db_database
|
|
||||||
CLIENT_ID:
|
|
||||||
from_secret: spotify_client_id
|
|
||||||
CLIENT_SECRET:
|
|
||||||
from_secret: spotify_client_secret
|
|
||||||
depends_on: [ create-bigbrother-database ]
|
|
||||||
|
|
||||||
- name: deploy-container-server
|
|
||||||
image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
||||||
environment:
|
|
||||||
IMAGENAME: hub.codefirst.iut.uca.fr/felix.mielcarek/big-brother-server:latest
|
|
||||||
CONTAINERNAME: bigbrotherserver
|
|
||||||
COMMAND: create
|
|
||||||
OVERWRITE: true
|
|
||||||
depends_on: [ build-image-server ]
|
|
||||||
|
|
||||||
# - name: build-image-script
|
|
||||||
# image: plugins/docker
|
|
||||||
# settings:
|
|
||||||
# dockerfile: script/Dockerfile
|
|
||||||
# context: ./
|
|
||||||
# registry: hub.codefirst.iut.uca.fr
|
|
||||||
# repo: hub.codefirst.iut.uca.fr/felix.mielcarek/big-brother
|
|
||||||
# username:
|
|
||||||
# from_secret: SECRET_REGISTRY_USERNAME
|
|
||||||
# password:
|
|
||||||
# from_secret: SECRET_REGISTRY_PASSWORD
|
|
||||||
# #depends_on: [ create-bigbrother-database ]
|
|
||||||
|
|
||||||
# - name: deploy-container-script
|
|
||||||
# image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
|
|
||||||
# environment:
|
|
||||||
# IMAGENAME: hub.codefirst.iut.uca.fr/felix.mielcarek/big-brother:latest
|
|
||||||
# CONTAINERNAME: bigbrotherscript
|
|
||||||
# COMMAND: create
|
|
||||||
# OVERWRITE: true
|
|
||||||
# MARIADB_USER:
|
|
||||||
# from_secret: db_user
|
|
||||||
# MARIADB_PASSWORD:
|
|
||||||
# from_secret: db_password
|
|
||||||
# MARIADB_DATABASE:
|
|
||||||
# from_secret: db_database
|
|
||||||
# CLIENT_ID:
|
|
||||||
# from_secret: spotify_client_id
|
|
||||||
# CLIENT_SECRET:
|
|
||||||
# from_secret: spotify_client_secret
|
|
||||||
# depends_on: [ build-image-script ]
|
|
@ -1,16 +0,0 @@
|
|||||||
FROM node:latest
|
|
||||||
|
|
||||||
# Set working directory inside the container
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
COPY callback-server/package*.json ./callback-server/
|
|
||||||
RUN npm install ./callback-server
|
|
||||||
COPY callback-server ./callback-server/
|
|
||||||
|
|
||||||
RUN env > .env
|
|
||||||
|
|
||||||
# Expose the port the app runs on
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
# Command to run the application
|
|
||||||
CMD ["node", "--env-file=.env" , "callback-server/app.js"]
|
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "bigbrother-callback-server",
|
"name": "bigbrother-callback-server",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"type": "module",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"keywords": [
|
"scripts": {
|
||||||
"big-brother",
|
"start": "node app.js"
|
||||||
"spotify"
|
},
|
||||||
],
|
|
||||||
"author": "Félix Mielcarek",
|
"author": "Félix Mielcarek",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.6.7",
|
"axios": "^1.6.7",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
"dotenv": "^16.4.5",
|
||||||
"express": "^4.18.3",
|
"express": "^4.18.3",
|
||||||
"fs": "^0.0.1-security",
|
"firebase": "^11.0.1",
|
||||||
"mariadb": "^3.3.0"
|
"firebase-admin": "^12.7.0",
|
||||||
|
"fs": "^0.0.1-security"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
FROM postgres:latest
|
|
||||||
|
|
||||||
ENV POSTGRES_DB=big-brother
|
|
||||||
ENV POSTGRES_PASSWORD=postgres
|
|
||||||
|
|
||||||
COPY init_db.py /docker-entrypoint-initdb.d/
|
|
||||||
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y python3 && \
|
|
||||||
apt install python3-psycopg2
|
|
||||||
|
|
||||||
EXPOSE 5432
|
|
@ -1,18 +0,0 @@
|
|||||||
import psycopg2
|
|
||||||
|
|
||||||
conn = psycopg2.connect(
|
|
||||||
database="big-brother", user='postgres', password='postgres', host='127.0.0.1', port= '5432'
|
|
||||||
)
|
|
||||||
cursor = conn.cursor()
|
|
||||||
|
|
||||||
cursor.execute("DROP TABLE IF EXISTS USERS")
|
|
||||||
|
|
||||||
sql ='''CREATE TABLE USERS(
|
|
||||||
SPOTIFY_ID VARCHAR(255) PRIMARY KEY,
|
|
||||||
ACCESS_TOKEN VARCHAR(255),
|
|
||||||
REFRESH_TOKEN VARCHAR(255)
|
|
||||||
)'''
|
|
||||||
cursor.execute(sql)
|
|
||||||
print("Table created successfully........")
|
|
||||||
conn.commit()
|
|
||||||
conn.close()
|
|
@ -1,23 +0,0 @@
|
|||||||
FROM node:latest
|
|
||||||
|
|
||||||
# Install Python and pip
|
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y python3 python3-pip && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Set working directory inside the container
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
COPY script/package*.json ./script/
|
|
||||||
RUN npm install ./script
|
|
||||||
|
|
||||||
COPY script ./script/
|
|
||||||
COPY common ./common/
|
|
||||||
RUN touch common/.env
|
|
||||||
|
|
||||||
# Expose the port the app runs on
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
# Command to run the application
|
|
||||||
CMD ["python3", "common/set-env-var.py"]
|
|
||||||
CMD ["node", "--env-file=common/.env" , "script/app.js"]
|
|
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "bigbrother-script",
|
"name": "bigbrother-script",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"type": "module",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"keywords": [
|
"scripts": {
|
||||||
"big-brother",
|
"start": "node app.js"
|
||||||
"spotify"
|
},
|
||||||
],
|
|
||||||
"author": "Félix Mielcarek",
|
"author": "Félix Mielcarek",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.7.2",
|
||||||
"mariadb": "^3.3.0"
|
"dotenv": "^16.4.5",
|
||||||
|
"firebase": "^11.0.1",
|
||||||
|
"firebase-admin": "^12.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue