Compare commits
19 Commits
master
...
csh-issue-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a47237ccb7 | ||
|
|
ab82140128 | ||
|
|
4d81b2ca53 | ||
|
|
c1eca448c5 | ||
|
|
d04df4ed75 | ||
|
|
d9f487efc4 | ||
|
|
02b5cc8efd | ||
|
|
f3c6756294 | ||
|
|
3ab407b91a | ||
|
|
0b40c8f79d | ||
|
|
882732d6a5 | ||
|
|
d934f96370 | ||
|
|
0f84c47bbe | ||
|
|
fdd87d77cc | ||
|
|
7ebc9b43a1 | ||
|
|
4c4dd64ca6 | ||
|
|
693b9e6193 | ||
|
|
65d416ee10 | ||
|
|
8f70dbd67b |
@@ -14,10 +14,14 @@ RUN npm run compile:all
|
|||||||
|
|
||||||
FROM node:10.15.0
|
FROM node:10.15.0
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
apt -y update && \
|
||||||
|
apt -y install moreutils
|
||||||
|
|
||||||
COPY --from=app /app /app
|
COPY --from=app /app /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
|
||||||
ENTRYPOINT ["/bin/sh", "entrypoint.sh"]
|
ENTRYPOINT ["/bin/bash", "entrypoint.sh"]
|
||||||
|
|
||||||
CMD ["node", "--expose-gc", "app.js"]
|
CMD ["node", "--expose-gc", "app.js"]
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -1,7 +1,7 @@
|
|||||||
# This file was auto-generated, do not edit it directly.
|
# This file was auto-generated, do not edit it directly.
|
||||||
# Instead run bin/update_build_scripts from
|
# Instead run bin/update_build_scripts from
|
||||||
# https://github.com/sharelatex/sharelatex-dev-environment
|
# https://github.com/sharelatex/sharelatex-dev-environment
|
||||||
# Version: 1.1.21
|
# Version: 1.1.22
|
||||||
|
|
||||||
BUILD_NUMBER ?= local
|
BUILD_NUMBER ?= local
|
||||||
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
@@ -35,7 +35,7 @@ test_clean:
|
|||||||
$(DOCKER_COMPOSE) down -v -t 0
|
$(DOCKER_COMPOSE) down -v -t 0
|
||||||
|
|
||||||
test_acceptance_pre_run:
|
test_acceptance_pre_run:
|
||||||
@[ ! -f test/acceptance/scripts/pre-run ] && echo "clsi has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/scripts/pre-run
|
@[ ! -f test/acceptance/js/scripts/pre-run ] && echo "clsi has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/js/scripts/pre-run
|
||||||
build:
|
build:
|
||||||
docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
||||||
--tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
--tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
METADATA=http://metadata.google.internal./computeMetadata/v1
|
|
||||||
SVC_ACCT=$METADATA/instance/service-accounts/default
|
|
||||||
PROJECT_URL=$METADATA/project/project-id
|
|
||||||
ACCESS_TOKEN=$(curl -s -H 'Metadata-Flavor: Google' $SVC_ACCT/token | cut -d'"' -f 4)
|
|
||||||
if [ -z "$ACCESS_TOKEN" ]; then
|
|
||||||
echo "No acccess token to download texlive-full images from google container, continuing without downloading. This is likely not a google cloud enviroment."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
PROJECT=$(curl -s -H 'Metadata-Flavor: Google' $PROJECT_URL)
|
|
||||||
if [ -z "$PROJECT" ]; then
|
|
||||||
echo "No project name to download texlive-full images from google container, continuing without downloading. This is likely not a google cloud enviroment."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
docker login -u '_token' -p $ACCESS_TOKEN https://gcr.io
|
|
||||||
docker pull --all-tags gcr.io/$PROJECT/texlive-full
|
|
||||||
cp /app/bin/synctex /app/bin/synctex-mount/synctex
|
|
||||||
|
|
||||||
echo "Finished downloading texlive-full images"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -4,5 +4,6 @@ clsi
|
|||||||
--acceptance-creds=None
|
--acceptance-creds=None
|
||||||
--dependencies=mongo,redis
|
--dependencies=mongo,redis
|
||||||
--docker-repos=gcr.io/overleaf-ops
|
--docker-repos=gcr.io/overleaf-ops
|
||||||
|
--env-pass-through=TEXLIVE_IMAGE
|
||||||
--build-target=docker
|
--build-target=docker
|
||||||
--script-version=1.1.21
|
--script-version=1.1.22
|
||||||
|
|||||||
39
cloudbuild.yaml
Normal file
39
cloudbuild.yaml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
steps:
|
||||||
|
- id: texlive
|
||||||
|
name: 'gcr.io/overleaf-ops/texlive-full:2017.1'
|
||||||
|
- id: build
|
||||||
|
name: 'gcr.io/overleaf-ops/cloud-builder'
|
||||||
|
args:
|
||||||
|
- 'build'
|
||||||
|
env:
|
||||||
|
- 'BUILD_NUMBER=$SHORT_SHA'
|
||||||
|
- 'BRANCH_NAME=$BRANCH_NAME'
|
||||||
|
waitFor: ['-']
|
||||||
|
- id: test_unit
|
||||||
|
name: 'gcr.io/overleaf-ops/cloud-builder'
|
||||||
|
args:
|
||||||
|
- 'test_unit'
|
||||||
|
env:
|
||||||
|
- 'DOCKER_COMPOSE_FLAGS=-f docker-compose.ci.yml'
|
||||||
|
- 'BUILD_NUMBER=$SHORT_SHA'
|
||||||
|
- 'BRANCH_NAME=$BRANCH_NAME'
|
||||||
|
waitFor:
|
||||||
|
- build
|
||||||
|
- id: test_acceptance
|
||||||
|
name: 'gcr.io/overleaf-ops/cloud-builder'
|
||||||
|
args:
|
||||||
|
- 'test_acceptance'
|
||||||
|
env:
|
||||||
|
- 'DOCKER_COMPOSE_FLAGS=-f docker-compose.ci.yml'
|
||||||
|
- 'BUILD_NUMBER=$SHORT_SHA'
|
||||||
|
- 'BRANCH_NAME=$BRANCH_NAME'
|
||||||
|
- 'TEXLIVE_IMAGE=gcr.io/overleaf-ops/texlive-full:2017.1'
|
||||||
|
waitFor:
|
||||||
|
- build
|
||||||
|
- texlive
|
||||||
|
images:
|
||||||
|
- 'gcr.io/$PROJECT_ID/clsi:${BRANCH_NAME}-${SHORT_SHA}'
|
||||||
|
timeout: 1800s
|
||||||
|
options:
|
||||||
|
diskSizeGb: 200
|
||||||
|
machineType: 'N1_HIGHCPU_8'
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# This file was auto-generated, do not edit it directly.
|
# This file was auto-generated, do not edit it directly.
|
||||||
# Instead run bin/update_build_scripts from
|
# Instead run bin/update_build_scripts from
|
||||||
# https://github.com/sharelatex/sharelatex-dev-environment
|
# https://github.com/sharelatex/sharelatex-dev-environment
|
||||||
# Version: 1.1.21
|
# Version: 1.1.22
|
||||||
|
|
||||||
version: "2"
|
version: "2"
|
||||||
|
|
||||||
@@ -26,6 +26,7 @@ services:
|
|||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: postgres
|
||||||
MOCHA_GREP: ${MOCHA_GREP}
|
MOCHA_GREP: ${MOCHA_GREP}
|
||||||
NODE_ENV: test
|
NODE_ENV: test
|
||||||
|
TEXLIVE_IMAGE:
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongo
|
- mongo
|
||||||
- redis
|
- redis
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# This file was auto-generated, do not edit it directly.
|
# This file was auto-generated, do not edit it directly.
|
||||||
# Instead run bin/update_build_scripts from
|
# Instead run bin/update_build_scripts from
|
||||||
# https://github.com/sharelatex/sharelatex-dev-environment
|
# https://github.com/sharelatex/sharelatex-dev-environment
|
||||||
# Version: 1.1.21
|
# Version: 1.1.22
|
||||||
|
|
||||||
version: "2"
|
version: "2"
|
||||||
|
|
||||||
|
|||||||
25
entrypoint.sh
Executable file → Normal file
25
entrypoint.sh
Executable file → Normal file
@@ -1,25 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
echo "Changing permissions of /var/run/docker.sock for sibling containers"
|
set -o pipefail
|
||||||
ls -al /var/run/docker.sock
|
|
||||||
docker --version
|
|
||||||
cat /etc/passwd
|
|
||||||
|
|
||||||
DOCKER_GROUP=$(stat -c '%g' /var/run/docker.sock)
|
/app/inner-entrypoint.sh "$@" 2>&1 | ts
|
||||||
groupadd --non-unique --gid ${DOCKER_GROUP} dockeronhost
|
|
||||||
usermod -aG dockeronhost node
|
|
||||||
|
|
||||||
mkdir -p /app/cache
|
|
||||||
chown -R node:node /app/cache
|
|
||||||
|
|
||||||
mkdir -p /app/compiles
|
|
||||||
chown -R node:node /app/compiles
|
|
||||||
|
|
||||||
chown -R node:node /app/bin/synctex
|
|
||||||
mkdir -p /app/test/acceptance/fixtures/tmp/
|
|
||||||
chown -R node:node /app
|
|
||||||
|
|
||||||
chown -R node:node /app/bin
|
|
||||||
|
|
||||||
./bin/install_texlive_gce.sh
|
|
||||||
exec runuser -u node -- "$@"
|
|
||||||
|
|||||||
27
inner-entrypoint.sh
Executable file
27
inner-entrypoint.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
date
|
||||||
|
echo "Changing permissions of /var/run/docker.sock for sibling containers"
|
||||||
|
ls -al /var/run/docker.sock
|
||||||
|
docker --version
|
||||||
|
cat /etc/passwd
|
||||||
|
|
||||||
|
DOCKER_GROUP=$(stat -c '%g' /var/run/docker.sock)
|
||||||
|
groupadd --non-unique --gid ${DOCKER_GROUP} dockeronhost
|
||||||
|
usermod -aG dockeronhost node
|
||||||
|
|
||||||
|
mkdir -p /app/cache
|
||||||
|
chown -R node:node /app/cache
|
||||||
|
|
||||||
|
mkdir -p /app/compiles
|
||||||
|
chown -R node:node /app/compiles
|
||||||
|
|
||||||
|
chown -R node:node /app/bin/synctex
|
||||||
|
mkdir -p /app/test/acceptance/fixtures/tmp/
|
||||||
|
chown -R node:node /app
|
||||||
|
|
||||||
|
chown -R node:node /app/bin
|
||||||
|
|
||||||
|
exec runuser -u node -- "$@"
|
||||||
Reference in New Issue
Block a user