-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
77 lines (72 loc) · 2.4 KB
/
.gitlab-ci.yml
File metadata and controls
77 lines (72 loc) · 2.4 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
stages:
# Habilita estos dos cuando tu runner vuelva a tener salida a Internet
# - build
# - upload
- release
- sonarqube-check
# ------------------------------------------
# build (opcional, comentado por ahora)
# ------------------------------------------
# build:
# stage: build
# only:
# - tags
# before_script:
# - apt-get update && apt-get install -y make zip composer
# - composer --version
# script:
# # Elimina la “v” inicial y pásala al Makefile
# - VERSION="${CI_COMMIT_TAG#v}" make package
# - ls -lh "documentate-${CI_COMMIT_TAG#v}.zip"
# artifacts:
# paths:
# - "documentate-${CI_COMMIT_TAG#v}.zip"
# expire_in: 1 week
# ------------------------------------------
# upload (opcional, comentado por ahora)
# ------------------------------------------
# upload:
# stage: upload
# image: curlimages/curl:latest
# only:
# - tags
# needs: [build]
# script:
# - PACKAGE_VERSION="${CI_COMMIT_TAG#v}"
# - PACKAGE_BINARY="documentate-${PACKAGE_VERSION}"
# - PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/documentate/${PACKAGE_VERSION}"
# - |
# curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" \
# --upload-file "${PACKAGE_BINARY}.zip" \
# "${PACKAGE_REGISTRY_URL}/${PACKAGE_BINARY}.zip"
# ------------------------------------------
# release
# ------------------------------------------
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
only:
- tags
script:
# Calcula versión y binario en shell (sí admite “#v”)
- PACKAGE_VERSION="${CI_COMMIT_TAG#v}"
- PACKAGE_BINARY="documentate-${PACKAGE_VERSION}"
- echo "Creating release for ${PACKAGE_BINARY}.zip"
# Crea la release y añade el asset link correcto
- |
release-cli create \
--name "Release ${PACKAGE_VERSION}" \
--tag-name "${CI_COMMIT_TAG}" \
--description "Release for ${PACKAGE_VERSION}" \
--assets-link "{\"name\":\"${PACKAGE_BINARY}.zip\",\"url\":\"https://github.com/ateeducacion/wp-documentate/releases/download/${CI_COMMIT_TAG}/${PACKAGE_BINARY}.zip\"}"
# ------------------------------------------
# sonarqube-check
# ------------------------------------------
sonarqube-check:
stage: sonarqube-check
image:
name: sonarsource/sonar-scanner-cli:11.5
entrypoint: [""]
script:
- sonar-scanner
when: manual