Commit af62e192 authored by George Kalampokis's avatar George Kalampokis

Improved deployment

parent e2b15f1b
......@@ -19,5 +19,5 @@ RUN mvn package
FROM openjdk:8-jre-alpine
WORKDIR /app
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app/app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app/app.jar"]
\ No newline at end of file
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]
\ No newline at end of file
......@@ -90,7 +90,7 @@ notification.finalised.subject=[OpenDMP] The {name} has been finalised
notification.modifiedFinalised.subject=[OpenDMP] The {name} has been modified and finalised
#############LOGGING#########
logging.config=file:/app/logging/logback-${spring.profiles.active}.xml
logging.config=file:logging/logback-${spring.profiles.active}.xml
#############TEMP#########
temp.temp=tmp/
\ No newline at end of file
......@@ -3,6 +3,6 @@ setlocal
cd ..
for /F "tokens=*" %%p in ('type Docker\dmp-db.env') do SET %%p
psql -d postgres -U postgres -w --set=POSTGRES_USER=%POSTGRES_USER% --set=POSTGRES_PASSWORD=%POSTGRES_PASSWORD% --set=POSTGRES_DB=%POSTGRES_DB% -f main/createDatabase.sql
psql -d dmptool -U dmptool -w -f main/DataManagementPlanDB.sql
for /R "updates" %%f in (*.sql) do psql --set=ADMIN_USERNAME=%ADMIN_USERNAME% --set=ADMIN_PASSWORD=%ADMIN_PASSWORD% -d dmptool -U dmptool -w -f %%f
psql -d %POSTGRES_DB% -U %POSTGRES_USER% --set=POSTGRES_USER=%POSTGRES_USER% -w -f main/DataManagementPlanDB.sql
for /R "updates" %%f in (*.sql) do psql --set=ADMIN_USERNAME=%ADMIN_USERNAME% --set=ADMIN_PASSWORD=%ADMIN_PASSWORD% --set=POSTGRES_USER=%POSTGRES_USER% -d %POSTGRES_DB% -U %POSTGRES_USER% -w -f %%f
endlocal
\ No newline at end of file
psql -d dmptool -U dmptool -f main/DataManagementPlanDB.sql;
psql -d $POSTGRES_DB -U $POSTGRES_USER --set=POSTGRES_USER="$POSTGRES_USER" -f main/DataManagementPlanDB.sql;
for j in $(ls updates); do
for i in $(ls updates/$j/*.sql); do
echo $i
psql --set=ADMIN_USERNAME="$ADMIN_USERNAME" --set=ADMIN_PASSWORD="$ADMIN_PASSWORD" -d dmptool -U dmptool -f $i;
psql --set=ADMIN_USERNAME="$ADMIN_USERNAME" --set=ADMIN_PASSWORD="$ADMIN_PASSWORD" --set=POSTGRES_USER="$POSTGRES_USER" -d $POSTGRES_DB -U $POSTGRES_USER -f $i;
done
done
\ No newline at end of file
......@@ -59,7 +59,7 @@ CREATE TABLE "DMP" (
);
ALTER TABLE "DMP" OWNER TO dmptool;
ALTER TABLE "DMP" OWNER TO :POSTGRES_USER;
COMMENT ON COLUMN "DMP"."ProfileData" IS 'More data about the DMP as defined by the profile';
......@@ -73,7 +73,7 @@ CREATE TABLE "DMPOrganisation" (
);
ALTER TABLE "DMPOrganisation" OWNER TO dmptool;
ALTER TABLE "DMPOrganisation" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DMPOrganisation" IS 'Linking of DMPs to Organisations';
......@@ -92,7 +92,7 @@ CREATE TABLE "DMPProfile" (
);
ALTER TABLE "DMPProfile" OWNER TO dmptool;
ALTER TABLE "DMPProfile" OWNER TO :POSTGRES_USER;
CREATE TABLE "DMPResearcher" (
......@@ -103,7 +103,7 @@ CREATE TABLE "DMPResearcher" (
);
ALTER TABLE "DMPResearcher" OWNER TO dmptool;
ALTER TABLE "DMPResearcher" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DMPResearcher" IS 'Linking of DMPs to researchers';
......@@ -126,7 +126,7 @@ CREATE TABLE "Dataset" (
);
ALTER TABLE "Dataset" OWNER TO dmptool;
ALTER TABLE "Dataset" OWNER TO :POSTGRES_USER;
COMMENT ON COLUMN "Dataset"."Uri" IS 'URI of item';
......@@ -151,7 +151,7 @@ CREATE TABLE "DatasetProfile" (
ALTER TABLE "DatasetProfile" ADD CONSTRAINT datasetprofile_unique_ruleset UNIQUE ("Ruleset");
ALTER TABLE "DatasetProfile" ADD CONSTRAINT datasetprofile_unique_viewstyle UNIQUE ("Viewstyle");
ALTER TABLE "DatasetProfile" OWNER TO dmptool;
ALTER TABLE "DatasetProfile" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DatasetProfile" IS 'Profiles for dmp datasets';
......@@ -163,7 +163,7 @@ CREATE TABLE "DatasetProfileRuleset" (
"Definition" xml NOT NULL
);
ALTER TABLE "DatasetProfileRuleset" OWNER TO dmptool;
ALTER TABLE "DatasetProfileRuleset" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DatasetProfileRuleset" IS 'Sets of Rules for dmp dataset profiles';
......@@ -174,7 +174,7 @@ CREATE TABLE "DatasetProfileViewstyle" (
"Definition" xml NOT NULL
);
ALTER TABLE "DatasetProfileViewstyle" OWNER TO dmptool;
ALTER TABLE "DatasetProfileViewstyle" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DatasetProfileViewstyle" IS 'Style sets for dmp dataset profiles';
......@@ -192,7 +192,7 @@ CREATE TABLE "Organisation" (
);
ALTER TABLE "Organisation" OWNER TO dmptool;
ALTER TABLE "Organisation" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "Organisation" IS 'Table of organizations utilized in the project';
......@@ -227,7 +227,7 @@ CREATE TABLE "Project" (
);
ALTER TABLE "Project" OWNER TO dmptool;
ALTER TABLE "Project" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "Project" IS 'Table of project managed in the system';
......@@ -268,7 +268,7 @@ CREATE TABLE "Researcher" (
);
ALTER TABLE "Researcher" OWNER TO dmptool;
ALTER TABLE "Researcher" OWNER TO :POSTGRES_USER;
......@@ -391,7 +391,7 @@ CREATE TABLE "Service" (
"Definition" xml
);
ALTER TABLE "Service" OWNER TO dmptool;
ALTER TABLE "Service" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY "Service"
ADD CONSTRAINT "PKey_Service" PRIMARY KEY ("ID");
......@@ -409,7 +409,7 @@ CREATE TABLE "DataRepository" (
"Definition" xml
);
ALTER TABLE "DataRepository" OWNER TO dmptool;
ALTER TABLE "DataRepository" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY "DataRepository"
ADD CONSTRAINT "PKey_DataRepository" PRIMARY KEY ("ID");
......@@ -428,7 +428,7 @@ CREATE TABLE "Registry" (
"Definition" xml
);
ALTER TABLE "Registry" OWNER TO dmptool;
ALTER TABLE "Registry" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY "Registry"
ADD CONSTRAINT "PKey_Registry" PRIMARY KEY ("ID");
......@@ -442,7 +442,7 @@ CREATE TABLE "DatasetService" (
"ID" uuid DEFAULT uuid_generate_v4() NOT NULL
);
ALTER TABLE "DatasetService" OWNER TO dmptool;
ALTER TABLE "DatasetService" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DatasetService" IS 'Linking Dataset to Service';
......@@ -454,7 +454,7 @@ CREATE TABLE "DatasetRegistry" (
"ID" uuid DEFAULT uuid_generate_v4() NOT NULL
);
ALTER TABLE "DatasetRegistry" OWNER TO dmptool;
ALTER TABLE "DatasetRegistry" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DatasetRegistry" IS 'Linking Dataset to Registry';
......@@ -467,7 +467,7 @@ CREATE TABLE "DatasetDataRepository" (
);
ALTER TABLE "DatasetDataRepository" OWNER TO dmptool;
ALTER TABLE "DatasetDataRepository" OWNER TO :POSTGRES_USER;
COMMENT ON TABLE "DatasetDataRepository" IS 'Linking Dataset to DataRepository';
......@@ -543,9 +543,9 @@ ALTER TABLE "Project" ADD CONSTRAINT fk_project_creator FOREIGN KEY ("CreationUs
ALTER TABLE "UserInfo" OWNER TO dmptool;
ALTER TABLE "UserAuth" OWNER TO dmptool;
ALTER TABLE "UserDMP" OWNER TO dmptool;
ALTER TABLE "UserInfo" OWNER TO :POSTGRES_USER;
ALTER TABLE "UserAuth" OWNER TO :POSTGRES_USER;
ALTER TABLE "UserDMP" OWNER TO :POSTGRES_USER;
......
......@@ -32,12 +32,12 @@ TABLESPACE pg_default;
ALTER TABLE public."DMPDatasetProfile"
-- OWNER to dmtadm;
OWNER to dmptool;
OWNER to :POSTGRES_USER;
ALTER TABLE public."UserDMP"
-- OWNER to dmtadm;
OWNER to dmptool;
OWNER to :POSTGRES_USER;
--INSERT INTO public."DMPDatasetProfile"(
......
......@@ -8,7 +8,7 @@ CREATE TABLE public."Content" (
);
ALTER TABLE public."Content" OWNER TO dmptool;
ALTER TABLE public."Content" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."Content"
ADD CONSTRAINT "Content_pkey" PRIMARY KEY ("Id");
......
......@@ -15,4 +15,4 @@ TABLESPACE pg_default;
ALTER TABLE public."LoginConfirmationEmail"
-- OWNER to dmtadm;
OWNER to dmptool;
\ No newline at end of file
OWNER to :POSTGRES_USER;
\ No newline at end of file
......@@ -8,7 +8,7 @@ CREATE TABLE public."ExternalDataset" (
);
ALTER TABLE public."ExternalDataset" OWNER TO dmptool;
ALTER TABLE public."ExternalDataset" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."ExternalDataset"
ADD CONSTRAINT "ExternalDataset_pkey" PRIMARY KEY ("Id");
......
......@@ -11,7 +11,7 @@ CREATE TABLE public."Credential" (
);
ALTER TABLE public."Credential" OWNER TO dmptool;
ALTER TABLE public."Credential" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."Credential"
ADD CONSTRAINT "Credential_pkey" PRIMARY KEY ("Id");
......
......@@ -6,7 +6,7 @@ CREATE TABLE public."UserToken" (
);
ALTER TABLE public."UserToken" OWNER TO dmptool;
ALTER TABLE public."UserToken" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."UserToken"
ADD CONSTRAINT "UserToken_pkey" PRIMARY KEY ("Token");
......
......@@ -5,7 +5,7 @@ CREATE TABLE public."UserRole" (
);
ALTER TABLE public."UserRole" OWNER TO dmptool;
ALTER TABLE public."UserRole" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."UserRole"
ADD CONSTRAINT "UserRole_pkey" PRIMARY KEY ("Id");
......
......@@ -6,7 +6,7 @@ CREATE TABLE public."DatasetExternalDataset" (
"Data" character varying
);
ALTER TABLE public."DatasetExternalDataset" OWNER TO dmptool;
ALTER TABLE public."DatasetExternalDataset" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."DatasetExternalDataset"
ADD CONSTRAINT "DatasetExternalDataset_pkey" PRIMARY KEY ("Id");
......
......@@ -9,7 +9,7 @@ CREATE TABLE public."Invitation" (
);
ALTER TABLE public."Invitation" OWNER TO dmptool;
ALTER TABLE public."Invitation" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."Invitation"
ADD CONSTRAINT "Invitation_pkey" PRIMARY KEY ("Id");
......
......@@ -6,7 +6,7 @@ CREATE TABLE public."UserPreference" (
);
ALTER TABLE public."UserPreference" OWNER TO dmptool;
ALTER TABLE public."UserPreference" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."UserPreference"
ADD CONSTRAINT "UserPreference_pkey" PRIMARY KEY ("Id");
......
......@@ -5,7 +5,7 @@ CREATE TABLE public."UserAssociation" (
);
ALTER TABLE public."UserAssociation" OWNER TO dmptool;
ALTER TABLE public."UserAssociation" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."UserAssociation"
ADD CONSTRAINT pk_user_association PRIMARY KEY (id);
......
......@@ -8,7 +8,7 @@ CREATE TABLE public."DoiFunder" (
ALTER TABLE ONLY public."DoiFunder"
ADD CONSTRAINT "DoiFunder_pkey" PRIMARY KEY (id);
ALTER TABLE public."DoiFunder" OWNER TO dmptool;
ALTER TABLE public."DoiFunder" OWNER TO :POSTGRES_USER;
INSERT INTO public."DoiFunder"(name, doi) VALUES ('Australian Research Council', '10.13039/501100000923');
INSERT INTO public."DoiFunder"(name, doi) VALUES ('European Commission', '10.13039/501100000780');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment