Skip to content

Commit

Permalink
[FIX] git directories removed
Browse files Browse the repository at this point in the history
  • Loading branch information
az-adhoc authored and jjscarafia committed Sep 12, 2024
1 parent 4084872 commit 965f50b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
ARG BASE_IMAGE_REPO
ARG BASE_IMAGE_REPO=adhoc/odoo
ARG BASE_IMAGE_TAG

FROM $BASE_IMAGE_REPO:$BASE_IMAGE_TAG

# Posiblemente no se usen
ARG GITHUB_USER
# Posiblemente no se usen
ARG GITHUB_TOKEN
ARG GITHUB_BOT_TOKEN
ARG GITLAB_TOKEN
ARG DOCKER_IMAGE
# Default = adhoc/odoo-adhoc
ARG DOCKER_IMAGE=adhoc/odoo-adhoc
ARG SAAS_PROVIDER_URL
ARG SAAS_PROVIDER_TOKEN
# Posiblemente no se usen
ENV GITHUB_USER="$GITHUB_USER"
# Posiblemente no se usen
ENV GITHUB_TOKEN="$GITHUB_TOKEN"
ENV GITHUB_BOT_TOKEN="$GITHUB_BOT_TOKEN"

Expand Down Expand Up @@ -47,8 +51,10 @@ RUN $RESOURCES/saas-build
USER odoo

# Aggregate new repositories of this image
RUN autoaggregate --config "$RESOURCES/saas-odoo_project_repos.yml" --output $SOURCES/repositories
RUN autoaggregate --config "$RESOURCES/saas-odoo_project_version_repos.yml" --output $SOURCES/repositories
RUN autoaggregate --config "$RESOURCES/saas-odoo_project_repos.yml" --output $SOURCES/repositories \
&& autoaggregate --config "$RESOURCES/saas-odoo_project_version_repos.yml" --output $SOURCES/repositories \
# Delete unused git from repositories
&& find $SOURCES -type d -name ".git" -exec rm -rf {} +

# Report to provider all repos HEADs
RUN find $SOURCES -name "*.git" -type d -execdir sh -c "pwd && echo , && git log -n 1 --remotes=origin --pretty=format:\"%H\" && echo \;; " \; | xargs -n3 > /tmp/repo_heads.txt ; curl -X POST $BASE_URL/report_sha$URL_SUFIX\&minor_version=`date -u +%Y.%m.%d` -H "Content-Type: application/json" -H "Accept: application/json" -d "@/tmp/repo_heads.txt"
Expand Down
21 changes: 21 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# README

## Para hacer el build en local

GITHUB_BOT_TOKEN ver en dockerhub
SAAS_PROVIDER_TOKEN ver en dockerhub
BASE_IMAGE_TAG=17.0

```sh
export DOCKER_BUILDKIT=1 \
&& docker build --no-cache \
-t adhoc/odoo-adhoc:17.3-dev \
--build-arg BASE_IMAGE_REPO=adhoc/odoo \
--build-arg BASE_IMAGE_TAG=17.0-dev \
--build-arg GITHUB_BOT_TOKEN= \
--build-arg SAAS_PROVIDER_TOKEN= \
--build-arg SAAS_PROVIDER_URL=https://www.adhoc.com.ar \
--build-arg DOCKER_IMAGE=adhoc/odoo-adhoc \
-f Dockerfile .
# docker push adhoc/odoo-adhoc:17.0-dev
```

0 comments on commit 965f50b

Please sign in to comment.