From 7d9df34c694a11779df4e90a7f7f69194eca23cc Mon Sep 17 00:00:00 2001 From: Dorian HODIN Date: Sat, 26 Nov 2022 16:45:17 +0100 Subject: [PATCH] .drone.yml, Dockerfile update and new location.sql script --- .drone.yml | 2 ++ Sources/db_script/Dockerfile | 5 ++++- Sources/db_script/sql/location.sql | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Sources/db_script/sql/location.sql diff --git a/.drone.yml b/.drone.yml index 1d71257..d8ae24a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -107,6 +107,8 @@ steps: COMMAND: create OVERWRITE: true # PRIVATE: true + CODEFIRST_CLIENTDRONE_ENV_ROOT_PASSWORD: + from_secret: db_root_password CODEFIRST_CLIENTDRONE_ENV_SQL_DATABASE: from_secret: db_database CODEFIRST_CLIENTDRONE_ENV_SQL_USER: diff --git a/Sources/db_script/Dockerfile b/Sources/db_script/Dockerfile index 4ddc946..be3c247 100644 --- a/Sources/db_script/Dockerfile +++ b/Sources/db_script/Dockerfile @@ -1,5 +1,8 @@ FROM mcr.microsoft.com/mssql/server:2022-latest USER root +ENV ACCEPT_EULA=Y +ENV MSSQL_SA_PASSWORD="$ROOT_PASSWORD" +ENV MSSQL_PID=Developer RUN apt-get update && apt-get upgrade -y COPY ./sql /var/lib/mysql -CMD ./sql/create.sql \ No newline at end of file +CMD ./sql/location.sql \ No newline at end of file diff --git a/Sources/db_script/sql/location.sql b/Sources/db_script/sql/location.sql new file mode 100644 index 0000000..b318193 --- /dev/null +++ b/Sources/db_script/sql/location.sql @@ -0,0 +1,18 @@ +CREATE DATABASE IF NOT EXISTS positiondaflmusic; + +CREATE USER 'dafldev'@'%' IDENTIFIED BY 'wrap; + +GRANT ALL PRIVILEGES ON * . * TO 'dafldev'@'%'; + +FLUSH PRIVILEGES; + +CREATE TABLE gps ( + id varchar(30) PRIMARY KEY, + latitude double NOT NULL, + longitude double NOT NULL, + idMusic varchar(100) NOT NULL, + dateLog datetime NOT NULL +); + + +