test: submodules

parent fe2edf06
node_modules
......@@ -9,3 +9,9 @@ variables:
PORT: 3000
VALUES_FILE: ./.k8s/app.values.yml # Your values
DOCKER_BUILD_ARGS: "--no-cache"
GIT_SUBMODULE_STRATEGY: none
Register image:
extends: .autodevops_register_image
variables:
GIT_SUBMODULE_STRATEGY: normal
[submodule "socialgouv/legi-data"]
branch = master
path = .submodules/socialgouv/legi-data
url = https://github.com/socialgouv/legi-data
[submodule "socialgouv/fiches-vdd"]
branch = master
path = .submodules/socialgouv/fiches-vdd
url = https://github.com/socialgouv/fiches-vdd
[submodule "socialgouv/kali-data"]
branch = master
path = .submodules/socialgouv/kali-data
url = https://github.com/socialgouv/kali-data
Subproject commit 1788bd43b9db88da1ddc534d16436fd8e12950eb
Subproject commit e8ea123435f45230c5c4c8cbadc46fccf123c95d
Subproject commit 4e6156773e329a4e275adaf18e7ebd608faa8201
FROM node:13-alpine
RUN apk add git
RUN apk add --update --no-cache git=~2
WORKDIR /app
COPY clone.sh .
# renovate: datasource=git-refs depName=socialgouv/legi-data
ARG LEGI_DATA_VERSION=1c4dbc6d9ebcb6481cf7f97c7d4535befbd26861
......@@ -15,12 +13,27 @@ ARG KALI_DATA_VERSION=557ce6d41cf86af1543b65d177fc57fc2a6a5821
# renovate: datasource=git-refs depName=socialgouv/fiches-vdd
ARG FICHES_VDD_VERSION=cad3f439d726d735e1579f065f59121582190628
RUN ./clone.sh
COPY package.json .
COPY yarn.lock .
COPY packages/frontend/package.json ./packages/frontend/package.json
COPY packages/git/package.json ./packages/git/package.json
RUN set -ex \
#
&& GIT_STORAGE=/tmp/clones \
&& mkdir -p $GIT_STORAGE || true \
#
&& git clone https://github.com/SocialGouv/legi-data $GIT_STORAGE/socialgouv/legi-data \
&& cd $GIT_STORAGE/socialgouv/legi-data \
&& echo "legi-data : `git log --pretty=format:'%H' -n 1`" \
#
&& git clone https://github.com/SocialGouv/kali-data $GIT_STORAGE/socialgouv/kali-data \
&& cd $GIT_STORAGE/socialgouv/kali-data \
&& echo "kali-data : `git log --pretty=format:'%H' -n 1`" \
#
&& git clone https://github.com/SocialGouv/fiches-vdd $GIT_STORAGE/socialgouv/fiches-vdd \
&& cd $GIT_STORAGE/socialgouv/fiches-vdd \
&& echo "fiches-vdd : `git log --pretty=format:'%H' -n 1`" \
;
COPY package.json yarn.lock /app/
COPY packages/frontend/package.json /app/packages/frontend/package.json
COPY packages/git/package.json /app/packages/git/package.json
RUN yarn
......
......@@ -11,7 +11,7 @@ API + UI pour reporter les changements de contenus sur des repos GIT.
## Dev
Utiliser [clone.sh](./clone.sh) pour récupérer les repos dans `/tmp/clones`.
Ensure that you have the data submodules (in .submodules)
```
yarn
......@@ -26,6 +26,15 @@ Actuellement les repos GIT sont récupérés via le `Dockerfile`, donc mis à jo
- [kali-data](https://github.com/SocialGouv/kali-data)
- [fiches-vdd](https://github.com/SocialGouv/fiches-vdd)
Add a data submodule with
```
$ git submodule add --depth 1 --name <repo> https://github.com/<user>/<repo> ./.submodules/<user>/<repo>
# Example
$ git submodule add --depth 1 --name socialgouv/legi-data https://github.com/socialgouv/legi-data ./.submodules/socialgouv/legi-data
$ git submodule add --depth 1 --name socialgouv/kali-data https://github.com/socialgouv/kali-data ./.submodules/socialgouv/kali-data
$ git submodule add --depth 1 --name socialgouv/fiches-vdd https://github.com/socialgouv/fiches-vdd ./.submodules/socialgouv/fiches-vdd
```
# Todo :
- continuous deployment with @renovate + @socialgouv
......
#!/bin/sh
GIT_STORAGE=/tmp/clones
mkdir -p $GIT_STORAGE || true
git clone https://github.com/SocialGouv/legi-data $GIT_STORAGE/socialgouv/legi-data || (cd $GIT_STORAGE/socialgouv/legi-data && git pull)
cd $GIT_STORAGE/socialgouv/legi-data && echo "legi-data : `git log --pretty=format:'%H' -n 1`"
git clone https://github.com/SocialGouv/kali-data $GIT_STORAGE/socialgouv/kali-data || (cd $GIT_STORAGE/socialgouv/kali-data && git pull)
cd $GIT_STORAGE/socialgouv/kali-data && echo "kali-data : `git log --pretty=format:'%H' -n 1`"
git clone https://github.com/SocialGouv/fiches-vdd $GIT_STORAGE/socialgouv/fiches-vdd || (cd $GIT_STORAGE/socialgouv/fiches-vdd && git pull)
cd $GIT_STORAGE/socialgouv/fiches-vdd && echo "fiches-vdd : `git log --pretty=format:'%H' -n 1`"
\ No newline at end of file
......@@ -4,7 +4,7 @@ import memoizee from "memoizee";
import { compareArticles } from "./compareArticles";
const GIT_STORAGE = "/tmp/clones";
const GIT_STORAGE = process.env.GIT_STORAGE || "../../.submodules";
// todo: ensure the diff is useful, exclude html/format changes
const compareLegiArticles = (tree1, tree2) =>
......
......@@ -3204,7 +3204,6 @@ fsevents@^1.2.7:
dependencies:
bindings "^1.5.0"
nan "^2.12.1"
node-pre-gyp "*"
fsevents@~2.1.2:
version "2.1.3"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment