Skip to content

Commit d744f51

Browse files
committed
chore: enhance Dockerfile and workflows for submodule management
- Added support for the 'papi' submodule in the Dockerfile, including a check to initialize submodules if not present. - Updated multiple GitHub workflows to verify the presence of the 'papi' submodule and added a token for secure access during checkout.
1 parent 6ac2aaa commit d744f51

File tree

6 files changed

+55
-0
lines changed

6 files changed

+55
-0
lines changed

.github/workflows/check_code_quality.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ jobs:
1515
- uses: actions/checkout@v5
1616
with:
1717
submodules: recursive
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Verify submodules
21+
run: |
22+
if [ ! -d "papi" ]; then
23+
echo "Error: papi submodule not found"
24+
exit 1
25+
fi
26+
echo "Submodule papi verified"
1827
1928
- name: Install Node
2029
uses: actions/setup-node@v5

.github/workflows/publish_docker_image.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
uses: actions/checkout@v5
1818
with:
1919
submodules: recursive
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Verify submodules
23+
run: |
24+
if [ ! -d "papi" ]; then
25+
echo "Error: papi submodule not found"
26+
exit 1
27+
fi
28+
echo "Submodule papi verified"
2029
2130
- name: Docker meta
2231
id: meta

.github/workflows/publish_docker_image_homolog.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
uses: actions/checkout@v5
1818
with:
1919
submodules: recursive
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Verify submodules
23+
run: |
24+
if [ ! -d "papi" ]; then
25+
echo "Error: papi submodule not found"
26+
exit 1
27+
fi
28+
echo "Submodule papi verified"
2029
2130
- name: Docker meta
2231
id: meta

.github/workflows/publish_docker_image_latest.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ jobs:
1717
uses: actions/checkout@v5
1818
with:
1919
submodules: recursive
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Verify submodules
23+
run: |
24+
if [ ! -d "papi" ]; then
25+
echo "Error: papi submodule not found"
26+
exit 1
27+
fi
28+
echo "Submodule papi verified"
2029
2130
- name: Docker meta
2231
id: meta

.github/workflows/security.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ jobs:
2828
uses: actions/checkout@v5
2929
with:
3030
submodules: recursive
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Verify submodules
34+
run: |
35+
if [ ! -d "papi" ]; then
36+
echo "Error: papi submodule not found"
37+
exit 1
38+
fi
39+
echo "Submodule papi verified"
3140
3241
- name: Initialize CodeQL
3342
uses: github/codeql-action/init@v3
@@ -51,5 +60,6 @@ jobs:
5160
uses: actions/checkout@v5
5261
with:
5362
submodules: recursive
63+
token: ${{ secrets.GITHUB_TOKEN }}
5464
- name: Dependency Review
5565
uses: actions/dependency-review-action@v4

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ COPY ./prisma ./prisma
2121
COPY ./manager ./manager
2222
COPY ./.env.example ./.env
2323
COPY ./runWithProvider.js ./
24+
COPY ./.gitmodules ./.gitmodules
25+
26+
# Copiar submódulo papi (necessário para o build)
27+
COPY ./papi ./papi
2428

2529
COPY ./Docker ./Docker
2630

2731
RUN chmod +x ./Docker/scripts/* && dos2unix ./Docker/scripts/*
2832

33+
# Se o diretório papi não existir, tentar inicializar submódulos (caso build via git clone)
34+
RUN if [ ! -d "./papi" ] && [ -f ".gitmodules" ]; then \
35+
git submodule update --init --recursive || echo "Submodules already initialized or not available"; \
36+
fi
37+
2938
RUN ./Docker/scripts/generate_database.sh
3039

3140
RUN npm run build

0 commit comments

Comments
 (0)