-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
33 lines (30 loc) · 1.23 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
include:
- remote: https://raw.githubusercontent.com/edersonbrilhante/vilicus-gitlab/main/Vilicus.gitlab-ci.yml
start-crosscicd:
image: alpine
before_script:
- apk add --update curl && rm -rf /var/cache/apk/*
script: |
curl -H "Authorization: token ${GITHUB_TOKEN}" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/${GITHUB_REPO}/dispatches" \
-d '{"event_type": "gitlab_trigger_'${CI_PIPELINE_ID}'", "client_payload": {"registration_token": "'${GITLAB_REGISTRATION_TOKEN}'", "tag_list":"crosscicd-1"}}'
curl -H "Authorization: token ${GITHUB_TOKEN}" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/${GITHUB_REPO}/dispatches" \
-d '{"event_type": "gitlab_trigger_'${CI_PIPELINE_ID}'", "client_payload": {"registration_token": "'${GITLAB_REGISTRATION_TOKEN}'", "tag_list":"crosscicd-2"}}'
remote_image:
extends: .vilicus
variables:
IMAGE: python
tags:
- crosscicd-1
local_image:
extends: .vilicus
variables:
IMAGE: localhost:5000/local-image:${CI_COMMIT_SHORT_SHA}
script:
- docker build -t localhost:5000/local-image:${CI_COMMIT_SHORT_SHA} .
- ./run-job.sh
tags:
- crosscicd-2