-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
35 lines (29 loc) · 1.12 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
image: docker:stable
services:
- docker:dind
stages:
- build
- trigger
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
CONTAINER_IMAGE: registry.gitlab.com/hibou-io/hibou-odoo/odoo
GITLAB_BASE_URL: https://gitlab.com
SUITE_PROJECT_ID: 10003343
ENTERPRISE_PROJECT_ID: 10004745
before_script:
- RELEASE=$(echo $CI_COMMIT_REF_SLUG | sed "s/^\([[:digit:]][[:digit:]]\)-\([[:digit:]]\)/\1\.\2/g" | sed "s/-hibou//g")
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
build:
stage: build
script:
- docker pull $CONTAINER_IMAGE:$RELEASE || true
- docker build --pull -t $CONTAINER_IMAGE:$RELEASE .
- docker push $CONTAINER_IMAGE:$RELEASE
trigger:
variables:
GIT_STRATEGY: none
stage: trigger
script:
- docker run byrnedo/alpine-curl curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=$RELEASE $GITLAB_BASE_URL/api/v4/projects/$SUITE_PROJECT_ID/trigger/pipeline
- docker run byrnedo/alpine-curl curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=$CI_COMMIT_REF_NAME $GITLAB_BASE_URL/api/v4/projects/$ENTERPRISE_PROJECT_ID/trigger/pipeline