diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 962d818b..53e43c6f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ services: stages: - build + - release - trigger variables: @@ -15,7 +16,9 @@ variables: before_script: - RELEASE=$(echo $CI_COMMIT_REF_NAME | sed "s{.*\/\(.*\)\/.*{\1{g") + - RELEASE_DATE="$(date '+%Y-%m-%d')" - IMAGE_TAG=$(echo $CI_COMMIT_REF_SLUG | sed "s/^\([[:digit:]][[:digit:]]\)-\([[:digit:]]\)/\1\.\2/g") + - IMAGE_TAG_DATE="${IMAGE_TAG}-${RELEASE_DATE}" - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com merge_request: @@ -32,15 +35,28 @@ merge_request: - docker run $ENVS flow gitlab-automerge --remove-source build: + variables: + GIT_SUBMODULE_STRATEGY: recursive stage: build script: - - apk add git - - git submodule sync --recursive - - git submodule update --init --recursive - sed -i "s/RELEASE/$RELEASE/g" Dockerfile-GitLab - docker build --pull -t $CONTAINER_IMAGE:$IMAGE_TAG -f Dockerfile-GitLab . - docker push $CONTAINER_IMAGE:$IMAGE_TAG +release: + stage: release + variables: + GIT_STRATEGY: none + script: + - apk add python3 + - docker pull registry.gitlab.com/hibou-io/hibou-odoo/flow + - docker tag registry.gitlab.com/hibou-io/hibou-odoo/flow flow + - docker run -v "${PWD}/.local:/dest" flow self-install /dest + - cd .local/flow + - ./entrypoint.sh docker-release $CONTAINER_IMAGE:$IMAGE_TAG $CONTAINER_IMAGE:$IMAGE_TAG_DATE + only: + - /^\d+\.\d+$/ + publish: stage: build script: diff --git a/.gitmodules b/.gitmodules index 562103ad..9019ea94 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,3 +19,7 @@ [submodule "external/hibou-shipbox"] path = external/hibou-shipbox url = https://gitlab.com/hibou-io/hibou-odoo/shipbox.git +[submodule "external/hibou-oca/queue"] + path = external/hibou-oca/queue + url = https://github.com/hibou-io/oca-queue.git + diff --git a/external/hibou-oca/queue b/external/hibou-oca/queue new file mode 160000 index 00000000..a089cb18 --- /dev/null +++ b/external/hibou-oca/queue @@ -0,0 +1 @@ +Subproject commit a089cb18d591f6e7b24bd32fc1db8655526b1419 diff --git a/queue_job b/queue_job new file mode 120000 index 00000000..bf3ebe44 --- /dev/null +++ b/queue_job @@ -0,0 +1 @@ +./external/hibou-oca/queue/queue_job \ No newline at end of file diff --git a/queue_job_cron b/queue_job_cron new file mode 120000 index 00000000..8dfd2d47 --- /dev/null +++ b/queue_job_cron @@ -0,0 +1 @@ +./external/hibou-oca/queue/queue_job_cron \ No newline at end of file diff --git a/queue_job_subscribe b/queue_job_subscribe new file mode 120000 index 00000000..3c9f9bd1 --- /dev/null +++ b/queue_job_subscribe @@ -0,0 +1 @@ +./external/hibou-oca/queue/queue_job_subscribe \ No newline at end of file