Skip to content

Commit

Permalink
fix(export): add missing cdtn-elasticsearch to Dockerfile (#1038)
Browse files Browse the repository at this point in the history
* fix(export): add missing cdtn-elasticsearch to Dockerfile

* fix(export): add missing cdtn-elasticsearch to Dockerfile
  • Loading branch information
m-maillot authored Sep 28, 2023
1 parent 68eaefa commit 390e646
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 45 deletions.
7 changes: 1 addition & 6 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lerna run \
--exclude-dependents \
--parallel 1 \
--since HEAD \
--stream \
;
yarn precommit;
12 changes: 0 additions & 12 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,16 @@ jobs:
with:
imagePackage: ingester
dockerfile: targets/ingester/Dockerfile
secrets:
npmTiptapToken:
secretName: npm-tiptap
secretKey: NPM_TIPTAP_TOKEN
build-alert:
use: build
with:
imagePackage: alert
dockerfile: targets/alert-cli/Dockerfile
secrets:
npmTiptapToken:
secretName: npm-tiptap
secretKey: NPM_TIPTAP_TOKEN
build-export:
use: build
with:
imagePackage: export
dockerfile: targets/export-elasticsearch/Dockerfile
secrets:
npmTiptapToken:
secretName: npm-tiptap
secretKey: NPM_TIPTAP_TOKEN
build-contributions:
use: build
with:
Expand Down
12 changes: 6 additions & 6 deletions README-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ $ yarn build
It's easy to setup a new environment with docker compose :

```sh
docker-compose up
docker compose up
```

The docker compose performs several steps.
Expand All @@ -82,7 +82,7 @@ A postgreSQL database is used to store the data exposed through a Hasura instanc
> Start only the postgreSQL instance:
>
> ```sh
> docker-compose up postgres
> docker compose up postgres
> ```

### Configure a Hasura instance
Expand All @@ -105,7 +105,7 @@ key).
> Start only the Hasura instance (it starts the postgreSQL as dependency):
>
> ```sh
> docker-compose up hasura
> docker compose up hasura
> ```

### Inject documents
Expand Down Expand Up @@ -138,7 +138,7 @@ Frontend is reachable at the address <http://localhost:3000>
> Run the frontend (it starts Hasura as dependency):
>
> ```sh
> docker-compose up www
> docker compose up www
> ```
>
> or via npm
Expand Down Expand Up @@ -192,15 +192,15 @@ récupérer les données de production dans un environnement de dev. Actuellemen
backup de la base de données à l'équipe SRE et d'exécuter les commandes suivantes :

```sh
docker-compose exec -T postgres pg_restore \
docker compose exec -T postgres pg_restore \
--dbname postgres --clean --if-exists --user postgres \
--no-owner --no-acl --verbose < ~/Downloads/hasura_prod_db.psql
```

et pour remettre les utilisateurs par défaut

```sh
docker-compose exec -T postgres psql \
docker compose exec -T postgres psql \
--dbname postgres --user postgres \
< .kontinuous/sql/post-restore.sql
```
Expand Down
9 changes: 1 addition & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ services:
context: .
dockerfile: targets/contributions/Dockerfile
shm_size: 512m
secrets:
- npmTiptapToken
depends_on:
- hasura
- www
Expand All @@ -71,8 +69,6 @@ services:
context: .
dockerfile: targets/ingester/Dockerfile
shm_size: 512m
secrets:
- npmTiptapToken
depends_on:
- hasura
env_file:
Expand Down Expand Up @@ -106,12 +102,11 @@ services:
- elasticsearch

export:
platform: linux/amd64
build:
context: .
dockerfile: targets/export-elasticsearch/Dockerfile
shm_size: 512m
secrets:
- npmTiptapToken
ports:
- 8787:8787
environment:
Expand All @@ -128,8 +123,6 @@ services:
build:
context: .
dockerfile: targets/alert-cli/Dockerfile
secrets:
- npmTiptapToken

volumes:
db_data:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"test": "nps test",
"k8s": "yarn --silent --cwd .k8s",
"prepare": "test -n \"$CI\" || husky install",
"clean": "lerna clean"
"clean": "lerna clean",
"precommit": "lerna run --exclude-dependents --parallel 1 --since HEAD --stream"
},
"workspaces": [
"shared/*",
Expand Down
4 changes: 1 addition & 3 deletions targets/alert-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ COPY yarn.lock .yarnrc.yml ./
COPY .yarn .yarn

# hadolint ignore=SC2046
RUN --mount=type=secret,id=npmTiptapToken,target=/secrets/npmTiptapToken \
export NPM_TIPTAP_TOKEN=$(cat /secrets/npmTiptapToken); \
yarn fetch workspaces focus alert-cli
RUN yarn fetch workspaces focus alert-cli

FROM deps AS build-graphql-client
COPY shared/graphql-client ./shared/graphql-client
Expand Down
4 changes: 1 addition & 3 deletions targets/contributions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ COPY yarn.lock .yarnrc.yml ./
COPY .yarn .yarn

# hadolint ignore=SC2046
RUN --mount=type=secret,id=npmTiptapToken,target=/secrets/npmTiptapToken \
export NPM_TIPTAP_TOKEN=$(cat /secrets/npmTiptapToken); \
yarn fetch workspaces focus @socialgouv/contibutions
RUN yarn fetch workspaces focus @socialgouv/contibutions

FROM deps AS build-graphql-client
COPY shared/graphql-client ./shared/graphql-client
Expand Down
5 changes: 2 additions & 3 deletions targets/export-elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ COPY yarn.lock .yarnrc.yml ./
COPY .yarn .yarn

# hadolint ignore=SC2046
RUN --mount=type=secret,id=npmTiptapToken,target=/secrets/npmTiptapToken \
export NPM_TIPTAP_TOKEN=$(cat /secrets/npmTiptapToken); \
yarn fetch workspaces focus export-elasticsearch
RUN yarn fetch workspaces focus export-elasticsearch

FROM deps AS build-graphql-client
COPY shared/graphql-client ./shared/graphql-client
Expand All @@ -29,6 +27,7 @@ RUN yarn workspace @socialgouv/cdtn-logger build
FROM deps AS build-elasticsearch-document-adapter
COPY --from=build-types /app/shared/types ./shared/types
COPY --from=build-cdtn-logger /app/shared/logger ./shared/logger
COPY shared/elasticsearch ./shared/elasticsearch
COPY shared/elasticsearch-document-adapter ./shared/elasticsearch-document-adapter
RUN yarn workspace @shared/elasticsearch-document-adapter build

Expand Down
4 changes: 1 addition & 3 deletions targets/ingester/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ COPY yarn.lock .yarnrc.yml ./
COPY .yarn .yarn

# hadolint ignore=SC2046
RUN --mount=type=secret,id=npmTiptapToken,target=/secrets/npmTiptapToken \
export NPM_TIPTAP_TOKEN=$(cat /secrets/npmTiptapToken); \
yarn fetch workspaces focus ingester
RUN yarn fetch workspaces focus ingester

FROM deps AS build-graphql-client
COPY shared/graphql-client ./shared/graphql-client
Expand Down

0 comments on commit 390e646

Please sign in to comment.