Skip to content
Snippets Groups Projects
Commit 67f0e06f authored by Martin Jeppesen's avatar Martin Jeppesen
Browse files

Fix node version. Fix robustness to errors.

parent bcc749d0
No related branches found
No related tags found
No related merge requests found
......@@ -17,9 +17,6 @@ RUN cp /usr/bin/parallel /tmp
RUN apt-get -y -qq install moreutils
RUN mv /tmp/parallel /usr/bin/
COPY get-pdf.sh /
COPY mod_caption.rb /
COPY run-server.sh /
COPY create_sshd_privsep_dir.sh /
RUN ln -s /bin/bash /usr/bin/bash
......@@ -28,14 +25,6 @@ RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/s
RUN sed -ri 's/#?LogLevel INFO/LogLevel VERBOSE/' /etc/ssh/sshd_config
RUN bash -c -l /create_sshd_privsep_dir.sh
## install RVM, Ruby, and Bundler
#RUN gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
#RUN \curl -L https://get.rvm.io | bash -s stable
#RUN /bin/bash -l -c "rvm requirements"
#RUN /bin/bash -l -c "rvm install 2.2.4"
#RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"
#RUN echo "source /etc/profile.d/rvm.sh" >> ~/.bashrc
RUN apt-get -y -qq install ruby ruby-bundler
RUN mkdir /getpdf-server
......@@ -43,10 +32,20 @@ COPY getpdf-server /getpdf-server
WORKDIR /getpdf-server
RUN . $NVM_DIR/nvm.sh \
&& npm install lts/carbon \
&& nvm install lts/carbon
RUN . $NVM_DIR/nvm.sh \
&& nvm use lts/carbon \
&& npm install \
&& npm run build \
&& npm install forever -g
RUN echo . $NVM_DIR/nvm.sh >> ~/.bashrc
COPY get-pdf.sh /
COPY mod_caption.rb /
COPY run-server.sh /
WORKDIR .
ENTRYPOINT ["/bin/bash", "-l", "-c", "/run-server.sh"]
......
......@@ -70,6 +70,7 @@ export function initAgenda(dbs) {
a.on('start', function (job) {
job.attrs.status = 'running';
job.attrs.data.status = 'running';
job.attrs.data.logs = [`Started at ${new Date()}`];
job.save();
logger.info('Job %s starting', job.attrs.name);
});
......@@ -77,7 +78,10 @@ export function initAgenda(dbs) {
a.on('complete', function (job) {
if (job.attrs.status !== 'failed') {
if (job.attrs.failReason) {
if (job.attrs.data.logs)
job.attrs.data.logs.push(job.attrs.failReason);
else
job.attrs.data.logs = [job.attrs.failReason];
job.attrs.status = 'failed';
job.attrs.data.status = 'failed';
} else {
......@@ -90,6 +94,17 @@ export function initAgenda(dbs) {
});
a.on('fail', function (job) {
if (!job) {
logger.error('Job FAILED, but no job passed in!');
return;
}
if (!job.attrs) {
logger.error('Job FAILED, but no job attrs passed in!');
logger.error(job);
return;
}
job.attrs.status = 'failed';
job.attrs.data.status = 'failed';
job.save();
......
......@@ -2,8 +2,9 @@
pushd /getpdf-server
#. $NVM_DIR/nvm.sh
# sleep 10
. $NVM_DIR/nvm.sh
nvm use lts/carbon
mkdir -p /var/lib/sharelatex/backups
......@@ -12,6 +13,7 @@ mkdir -p /var/lib/sharelatex/backups
node --version | grep v8\.
if [ $? -ne 0 ]; then
echo "node 8 required!"
node --version
exit 1
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment