Skip to content

Commit

Permalink
sed install script
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Anderson authored and Calvin Winkowski (Telnoratti) committed Sep 29, 2016
1 parent 9648b35 commit 82eb6b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dataverse.json
Expand Up @@ -1250,7 +1250,7 @@
"\\n",
"\\n",
"\\n\" | docker run -i --name=dataverse-init ", { "Ref": "DockerRepoStringGlassfish" },
" bash -c \"cd dvinstall; sed -i 's/NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN/NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; grant $CONFIG_DEFAULTS{'POSTGRES_USER'} to postgres;/' install; ./install\"\n",
" bash -c \"cd dvinstall; ./install\"\n",
" docker stop dataverse-init\n",
" fleetctl submit /home/core/glassfish.service\n",
" curl http://127.0.0.1:2379/v2/keys/dvninit -XPUT -d value=done\n",
Expand Down
23 changes: 18 additions & 5 deletions docker/glassfish/Dockerfile
Expand Up @@ -29,21 +29,34 @@ RUN yum install -y java-1.8.0-openjdk-devel unzip perl postgresql
#RUN alternatives --set java /usr/lib/jvm/jre-1.8.0-openjdk.x86_64/bin/java

# Install glassfish
RUN curl -L http://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip -o /glassfish-4.1.zip && cd /usr/local && unzip /glassfish-4.1.zip && rm /glassfish-4.1.zip
RUN curl -L http://download.oracle.com/glassfish/4.1/release/glassfish-4.1.zip -o /glassfish-4.1.zip \
&& cd /usr/local \
&& unzip /glassfish-4.1.zip \
&& rm /glassfish-4.1.zip

# Patch Weld for dataverse
RUN rm /usr/local/glassfish4/glassfish/modules/weld-osgi-bundle.jar && cd /usr/local/glassfish4/glassfish/modules/ && curl -L http://central.maven.org/maven2/org/jboss/weld/weld-osgi-bundle/2.2.10.SP1/weld-osgi-bundle-2.2.10.SP1-glassfish4.jar -o weld-osgi-bundle-2.2.10.SP1-glassfish4.jar
RUN rm /usr/local/glassfish4/glassfish/modules/weld-osgi-bundle.jar \
&& cd /usr/local/glassfish4/glassfish/modules/ \
&& curl -L http://central.maven.org/maven2/org/jboss/weld/weld-osgi-bundle/2.2.10.SP1/weld-osgi-bundle-2.2.10.SP1-glassfish4.jar -o weld-osgi-bundle-2.2.10.SP1-glassfish4.jar

# Install dataverse, jq, jdbc driver, and jhove config
RUN curl -L https://github.com/IQSS/dataverse/releases/download/v4.5/dvinstall.zip -o /dvinstall.zip && unzip dvinstall.zip && rm dvinstall.zip && curl -L http://stedolan.github.io/jq/download/linux64/jq -o /usr/bin/jq && chmod u+x /usr/bin/jq && cp /dvinstall/pgdriver/postgresql-9.1-902.jdbc4.jar /usr/local/glassfish4/glassfish/lib/ && cp /dvinstall/jhove.conf /usr/local/glassfish4/glassfish/domains/domain1/config
RUN curl -L https://github.com/IQSS/dataverse/releases/download/v4.5/dvinstall.zip -o /dvinstall.zip \

This comment has been minimized.

Copy link
@pdurbin

pdurbin Oct 6, 2016

Member

Rather than hardcoding "https://github.com/IQSS/dataverse/releases/download" as the place we download dvinstall.zip from, can we make this a parameter? As part of the Dataverse release process we upload "dvinstall.zip" manually after we tag a release. If we're going to use dataverse-aws to deploy pre-release code, we need to automate the building of "dvinstall.zip" and put it in a known location, right? Where? S3? I'm open to suggestions! 😄

This comment has been minimized.

Copy link
@telnoratti

telnoratti Oct 6, 2016

Contributor

S3 would not be a bad location. We also discussed building a docker image from a commit itself. I see some projects integrate docker into their build process. So for each build they do, they have the option of generating a docker image. Something like make docker would create the image which could then be deployed to AWS. The idea here is that the docker image would be one of the packaging formats available.

&& unzip dvinstall.zip \
&& rm dvinstall.zip \
&& curl -L http://stedolan.github.io/jq/download/linux64/jq -o /usr/bin/jq \
&& chmod u+x /usr/bin/jq \
&& cp /dvinstall/pgdriver/postgresql-9.1-902.jdbc4.jar /usr/local/glassfish4/glassfish/lib/ \
&& cp /dvinstall/jhove.conf /usr/local/glassfish4/glassfish/domains/domain1/config

# Specify volume for shared storage
VOLUME /data/dvn:/usr/local/dvn/data

#
COPY run_dataverse.sh /run_dataverse.sh
RUN chmod u+x run_dataverse.sh
COPY install /dvinstall/install
RUN chmod u+x /dvinstall/install
#COPY install /dvinstall/install
#RUN chmod u+x /dvinstall/install
RUN sed -i -e "s/. \x22\x27 NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN\x22;/. \x22\x27 NOSUPERUSER CREATEDB CREATEROLE INHERIT LOGIN; grant $CONFIG_DEFAULTS{\x27POSTGRES_USER\x27} to postgres\x22;/g" /dvinstall/install

#
CMD /run_dataverse.sh

0 comments on commit 82eb6b5

Please sign in to comment.