Improved deployment

This commit is contained in:
George Kalampokis 2020-05-12 13:10:23 +03:00
parent e2b15f1b82
commit af62e192ae
17 changed files with 40 additions and 40 deletions

View File

@ -19,5 +19,5 @@ RUN mvn package
FROM openjdk:8-jre-alpine FROM openjdk:8-jre-alpine
WORKDIR /app WORKDIR /app
COPY --from=MAVEN_BUILD /build/web/target/web-1.0-SNAPSHOT.jar /app/app.jar 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/app.jar"] ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom" ,"-Dspring.profiles.active=${PROFILE}","-jar","/app.jar"]

View 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 notification.modifiedFinalised.subject=[OpenDMP] The {name} has been modified and finalised
#############LOGGING######### #############LOGGING#########
logging.config=file:/app/logging/logback-${spring.profiles.active}.xml logging.config=file:logging/logback-${spring.profiles.active}.xml
#############TEMP######### #############TEMP#########
temp.temp=tmp/ temp.temp=tmp/

View File

@ -3,6 +3,6 @@ setlocal
cd .. cd ..
for /F "tokens=*" %%p in ('type Docker\dmp-db.env') do SET %%p 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 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 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% -d dmptool -U dmptool -w -f %%f 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 endlocal

View File

@ -1,7 +1,7 @@
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 j in $(ls updates); do
for i in $(ls updates/$j/*.sql); do for i in $(ls updates/$j/*.sql); do
echo $i 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
done done

View 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'; 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'; 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" ( 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'; 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'; 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_ruleset UNIQUE ("Ruleset");
ALTER TABLE "DatasetProfile" ADD CONSTRAINT datasetprofile_unique_viewstyle UNIQUE ("Viewstyle"); 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'; COMMENT ON TABLE "DatasetProfile" IS 'Profiles for dmp datasets';
@ -163,7 +163,7 @@ CREATE TABLE "DatasetProfileRuleset" (
"Definition" xml NOT NULL "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'; COMMENT ON TABLE "DatasetProfileRuleset" IS 'Sets of Rules for dmp dataset profiles';
@ -174,7 +174,7 @@ CREATE TABLE "DatasetProfileViewstyle" (
"Definition" xml NOT NULL "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'; 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'; 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'; 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 "Definition" xml
); );
ALTER TABLE "Service" OWNER TO dmptool; ALTER TABLE "Service" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY "Service" ALTER TABLE ONLY "Service"
ADD CONSTRAINT "PKey_Service" PRIMARY KEY ("ID"); ADD CONSTRAINT "PKey_Service" PRIMARY KEY ("ID");
@ -409,7 +409,7 @@ CREATE TABLE "DataRepository" (
"Definition" xml "Definition" xml
); );
ALTER TABLE "DataRepository" OWNER TO dmptool; ALTER TABLE "DataRepository" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY "DataRepository" ALTER TABLE ONLY "DataRepository"
ADD CONSTRAINT "PKey_DataRepository" PRIMARY KEY ("ID"); ADD CONSTRAINT "PKey_DataRepository" PRIMARY KEY ("ID");
@ -428,7 +428,7 @@ CREATE TABLE "Registry" (
"Definition" xml "Definition" xml
); );
ALTER TABLE "Registry" OWNER TO dmptool; ALTER TABLE "Registry" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY "Registry" ALTER TABLE ONLY "Registry"
ADD CONSTRAINT "PKey_Registry" PRIMARY KEY ("ID"); ADD CONSTRAINT "PKey_Registry" PRIMARY KEY ("ID");
@ -442,7 +442,7 @@ CREATE TABLE "DatasetService" (
"ID" uuid DEFAULT uuid_generate_v4() NOT NULL "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'; COMMENT ON TABLE "DatasetService" IS 'Linking Dataset to Service';
@ -454,7 +454,7 @@ CREATE TABLE "DatasetRegistry" (
"ID" uuid DEFAULT uuid_generate_v4() NOT NULL "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'; 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'; 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 "UserInfo" OWNER TO :POSTGRES_USER;
ALTER TABLE "UserAuth" OWNER TO dmptool; ALTER TABLE "UserAuth" OWNER TO :POSTGRES_USER;
ALTER TABLE "UserDMP" OWNER TO dmptool; ALTER TABLE "UserDMP" OWNER TO :POSTGRES_USER;

View File

@ -32,12 +32,12 @@ TABLESPACE pg_default;
ALTER TABLE public."DMPDatasetProfile" ALTER TABLE public."DMPDatasetProfile"
-- OWNER to dmtadm; -- OWNER to dmtadm;
OWNER to dmptool; OWNER to :POSTGRES_USER;
ALTER TABLE public."UserDMP" ALTER TABLE public."UserDMP"
-- OWNER to dmtadm; -- OWNER to dmtadm;
OWNER to dmptool; OWNER to :POSTGRES_USER;
--INSERT INTO public."DMPDatasetProfile"( --INSERT INTO public."DMPDatasetProfile"(

View File

@ -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" ALTER TABLE ONLY public."Content"
ADD CONSTRAINT "Content_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "Content_pkey" PRIMARY KEY ("Id");

View File

@ -15,4 +15,4 @@ TABLESPACE pg_default;
ALTER TABLE public."LoginConfirmationEmail" ALTER TABLE public."LoginConfirmationEmail"
-- OWNER to dmtadm; -- OWNER to dmtadm;
OWNER to dmptool; OWNER to :POSTGRES_USER;

View 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" ALTER TABLE ONLY public."ExternalDataset"
ADD CONSTRAINT "ExternalDataset_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "ExternalDataset_pkey" PRIMARY KEY ("Id");

View File

@ -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" ALTER TABLE ONLY public."Credential"
ADD CONSTRAINT "Credential_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "Credential_pkey" PRIMARY KEY ("Id");

View File

@ -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" ALTER TABLE ONLY public."UserToken"
ADD CONSTRAINT "UserToken_pkey" PRIMARY KEY ("Token"); ADD CONSTRAINT "UserToken_pkey" PRIMARY KEY ("Token");

View File

@ -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" ALTER TABLE ONLY public."UserRole"
ADD CONSTRAINT "UserRole_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "UserRole_pkey" PRIMARY KEY ("Id");

View File

@ -6,7 +6,7 @@ CREATE TABLE public."DatasetExternalDataset" (
"Data" character varying "Data" character varying
); );
ALTER TABLE public."DatasetExternalDataset" OWNER TO dmptool; ALTER TABLE public."DatasetExternalDataset" OWNER TO :POSTGRES_USER;
ALTER TABLE ONLY public."DatasetExternalDataset" ALTER TABLE ONLY public."DatasetExternalDataset"
ADD CONSTRAINT "DatasetExternalDataset_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "DatasetExternalDataset_pkey" PRIMARY KEY ("Id");

View File

@ -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" ALTER TABLE ONLY public."Invitation"
ADD CONSTRAINT "Invitation_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "Invitation_pkey" PRIMARY KEY ("Id");

View File

@ -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" ALTER TABLE ONLY public."UserPreference"
ADD CONSTRAINT "UserPreference_pkey" PRIMARY KEY ("Id"); ADD CONSTRAINT "UserPreference_pkey" PRIMARY KEY ("Id");

View File

@ -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" ALTER TABLE ONLY public."UserAssociation"
ADD CONSTRAINT pk_user_association PRIMARY KEY (id); ADD CONSTRAINT pk_user_association PRIMARY KEY (id);

View File

@ -8,7 +8,7 @@ CREATE TABLE public."DoiFunder" (
ALTER TABLE ONLY public."DoiFunder" ALTER TABLE ONLY public."DoiFunder"
ADD CONSTRAINT "DoiFunder_pkey" PRIMARY KEY (id); 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 ('Australian Research Council', '10.13039/501100000923');
INSERT INTO public."DoiFunder"(name, doi) VALUES ('European Commission', '10.13039/501100000780'); INSERT INTO public."DoiFunder"(name, doi) VALUES ('European Commission', '10.13039/501100000780');