-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
58 lines (51 loc) · 1.81 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Official docker image.
image: docker:latest
stages:
- build
- failure
services:
- docker:dind
build-main:
stage: build
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull --build-arg REACT_APP_BASE_URL=$REACT_APP_BASE_URL -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" -t "$CI_REGISTRY_IMAGE:latest" .
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
- docker push "$CI_REGISTRY_IMAGE:latest"
only:
- main
build-develop:
stage: build
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull --build-arg REACT_APP_BASE_URL=$REACT_APP_BASE_URL_DEV -t "$CI_REGISTRY_IMAGE:DEV-$CI_COMMIT_SHORT_SHA" -t "$CI_REGISTRY_IMAGE:DEV" .
- docker push "$CI_REGISTRY_IMAGE:DEV-$CI_COMMIT_SHORT_SHA"
- docker push "$CI_REGISTRY_IMAGE:DEV"
only:
- development
failure:
image: curlimages/curl:latest
stage: failure
script:
- curl -X "POST" --url "$DISCORDWEBHOOK" --header "Content-Type:application/json" -d '{"username":"CI-test User", "avatar_url":"", "content":"Falló el Build de CV Front :( "}'
when: on_failure
success:
image: curlimages/curl:latest
stage: build
needs: [build-main]
script:
- curl -X "POST" --url "$DISCORDWEBHOOK" --header "Content-Type:application/json" -d '{"username":"CI-test User", "avatar_url":"", "content":"Se hizo el Build de CV Front !"}'
when: on_success
only:
- main
successdev:
image: curlimages/curl:latest
stage: build
needs: [build-develop]
script:
- curl -X "POST" --url "$DISCORDWEBHOOK" --header "Content-Type:application/json" -d '{"username":"CI-test User", "avatar_url":"", "content":"Se hizo el Build de CV front dev !"}'
when: on_success
only:
- development