removed user temporarly, created make ci task
This commit is contained in:
@@ -23,5 +23,5 @@ RUN useradd --user-group --create-home --home-dir /app --shell /bin/false app
|
|||||||
|
|
||||||
RUN [ -e ./install_deps.sh ] && ./install_deps.sh
|
RUN [ -e ./install_deps.sh ] && ./install_deps.sh
|
||||||
|
|
||||||
USER app
|
# USER app
|
||||||
CMD ["node","app.js"]
|
CMD ["node","app.js"]
|
||||||
|
|||||||
22
Jenkinsfile
vendored
22
Jenkinsfile
vendored
@@ -9,27 +9,9 @@ pipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
stage('Build') {
|
stage('CI') {
|
||||||
steps {
|
steps {
|
||||||
sh 'make build'
|
sh 'make ci'
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Unit Tests') {
|
|
||||||
steps {
|
|
||||||
sh 'DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" make test_unit'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Acceptance Tests') {
|
|
||||||
steps {
|
|
||||||
sh 'DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" up --build test_acceptance'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Package and publish build') {
|
|
||||||
steps {
|
|
||||||
sh 'make publish'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
Makefile
12
Makefile
@@ -28,10 +28,22 @@ test_acceptance: test_clean # clear the database before each acceptance test run
|
|||||||
|
|
||||||
test_clean:
|
test_clean:
|
||||||
$(DOCKER_COMPOSE) down -t 0
|
$(DOCKER_COMPOSE) down -t 0
|
||||||
|
|
||||||
build:
|
build:
|
||||||
docker build --pull --tag quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) .
|
docker build --pull --tag quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) .
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
docker push quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
docker push quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
||||||
|
|
||||||
|
ci:
|
||||||
|
# On the CI server, we want to run our tests in the image that we
|
||||||
|
# have built for deployment, which is what the docker-compose.ci.yml
|
||||||
|
# override does.
|
||||||
|
PROJECT_NAME=$(PROJECT_NAME) \
|
||||||
|
BRANCH_NAME=$(BRANCH_NAME) \
|
||||||
|
BUILD_NUMBER=$(BUILD_NUMBER) \
|
||||||
|
DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" \
|
||||||
|
$(MAKE) build test
|
||||||
|
|
||||||
|
|
||||||
.PHONY: clean test test_unit test_acceptance test_clean build publish
|
.PHONY: clean test test_unit test_acceptance test_clean build publish
|
||||||
|
|||||||
@@ -12,17 +12,10 @@ services:
|
|||||||
|
|
||||||
test_acceptance:
|
test_acceptance:
|
||||||
build: .
|
build: .
|
||||||
image: quay.io/sharelatex/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
|
||||||
extends:
|
extends:
|
||||||
file: docker-compose-config.yml
|
file: docker-compose-config.yml
|
||||||
service: ci
|
service: ci
|
||||||
environment:
|
entrypoint: npm run test:acceptance
|
||||||
REDIS_HOST: redis
|
|
||||||
MONGO_HOST: mongo
|
|
||||||
depends_on:
|
|
||||||
- redis
|
|
||||||
- mongo
|
|
||||||
entrypoint: npm run test:acceptance:_run
|
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
|
|||||||
@@ -21,12 +21,6 @@ services:
|
|||||||
extends:
|
extends:
|
||||||
file: docker-compose-config.yml
|
file: docker-compose-config.yml
|
||||||
service: dev
|
service: dev
|
||||||
environment:
|
|
||||||
REDIS_HOST: redis
|
|
||||||
MONGO_HOST: mongo
|
|
||||||
depends_on:
|
|
||||||
- redis
|
|
||||||
- mongo
|
|
||||||
entrypoint: npm run test:acceptance
|
entrypoint: npm run test:acceptance
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
Reference in New Issue
Block a user