Skip to content

Commit

Permalink
Merge pull request #351 from lsst-ts/tickets/LOVE-58
Browse files Browse the repository at this point in the history
Refactor docker files path
  • Loading branch information
fdelcampo authored Mar 2, 2022
2 parents cc5e553 + 9791aaf commit 1b2885e
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 29 deletions.
10 changes: 8 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipeline {
}
dockerImageName = dockerImageName + image_tag
echo "dockerImageName: ${dockerImageName}"
dockerImage = docker.build dockerImageName
dockerImage = docker.build(dockerImageName, "-f docker/Dockerfile .")
}
}
}
Expand All @@ -61,12 +61,18 @@ pipeline {
stage("Run tests") {
when {
anyOf {
branch "main"
branch "develop"
branch "bugfix/*"
branch "hotfix/*"
branch "release/*"
branch "tickets/*"
branch "PR-*"
}
}
steps {
script {
sh "docker image build -f Dockerfile-test -t love-frontend-test ."
sh "docker build -f docker/Dockerfile-test -t love-frontend-test ."
sh "docker run love-frontend-test"
}
}
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ See the documentation here: https://lsst-ts.github.io/LOVE-frontend
In order to use the LOVE-frontend as part of the LOVE system we recommend to use the docker-compose and configuration files provided in the [LOVE-integration-tools](https://github.com/lsst-ts/LOVE-integration-tools) repo. Please follow the instructions there.

## 2. Local load for development
We provide a docker image and a docker-compose file in order to load the LOVE-frontend locally for development purposes, i.e. run tests and build documentation.
We provide docker images and a docker-compose file in order to load the LOVE-frontend locally for development purposes, i.e. run tests and build documentation.

This docker-compose does not copy the code into the image, but instead it mounts the repository inside the image, this way you can edit the code from outside the docker container with no need to rebuild or restart.

Expand All @@ -17,8 +17,9 @@ Follow these instructions to run the application in a docker container and get i

1. Launch and get into the container:
```
docker-compose up -d
docker-exec frontend sh
cd docker/
docker-compose up -d --build
docker-compose exec frontend sh
```

### 2.2 Run tests
Expand All @@ -38,6 +39,7 @@ If rather than build you want to launch a development server for the documentati
```
yarn guide:start
```
**INFO:**

### Linting & Formatting
In order to maintaing code linting and formatting we use `pre-commit` that runs **ESLint** (https://eslint.org/) and **Prettier** (https://prettier.io/) using Git Hooks. To enable this you have to:
Expand All @@ -52,5 +54,5 @@ pip install pre-commit
pre-commit install
```

3. Start developing! Linter and Formatter will be executed on every commit you make
3. Start developing! Linter and Formatter will be executed on every commit you make.

20 changes: 0 additions & 20 deletions docker-compose.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Dockerfile-test → docker/Dockerfile-test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ COPY love/yarn.lock .
RUN yarn install

COPY love .
COPY run_tests.sh .
COPY docker/run-tests.sh .

CMD ["sh", "/usr/src/love/run_tests.sh"]
CMD ["/usr/src/love/run-tests.sh"]
14 changes: 14 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.7"

services:
frontend:
container_name: love-frontend-mount
build:
context: ..
dockerfile: docker/Dockerfile-dev
image: love-frontend-mount-image
ports:
- 3000:3000
volumes:
- ..:/usr/src/love
- /usr/src/love/love/node_modules
1 change: 1 addition & 0 deletions docker/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CI=true yarn test --testPathPattern=redux
1 change: 0 additions & 1 deletion run_tests.sh

This file was deleted.

0 comments on commit 1b2885e

Please sign in to comment.