-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitbucket-pipelines.yml
More file actions
119 lines (119 loc) · 4.63 KB
/
Copy pathbitbucket-pipelines.yml
File metadata and controls
119 lines (119 loc) · 4.63 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
image: python:3.12
# enable Docker for your repository
options:
docker: true
clone:
depth: full
pipelines:
# Heritage pipelines to combine common steps across different branches
custom:
parent-develop-pipeline-common:
import: luce-bitbucket-pipes:master:develop
parent-develop-deploy-azure:
import: luce-bitbucket-pipes:master:develop-deploy-azure
parent-staging-pipeline-common:
import: luce-bitbucket-pipes:master:staging
parent-staging-deploy-azure:
import: luce-bitbucket-pipes:master:staging-deploy-azure
parent-master-pipeline-common:
import: luce-bitbucket-pipes:master:master
parent-master-deploy-azure:
import: luce-bitbucket-pipes:master:master-deploy-azure
parent-post-deploy-testing:
import: luce-bitbucket-pipes:master:post-deploy-testing
parent-post-deploy-steps:
import: luce-bitbucket-pipes:master:post-deploy
parent-post-deploy-steps-with-mirror:
import: luce-bitbucket-pipes:master:post-deploy-mirror
parent-empty-deploy:
# This is a placeholder step for empty deployments.
- variables:
- name: DEPLOY_ENVIRONMENT
default: 'develop'
allowed-values:
- develop
- staging
- master
- step:
name: Empty Pipeline
script:
- echo "This is an empty pipeline step. You should replace the 'parent-empty-deploy' reference with the 'parent-[branch]-deploy-[cloud]' reference to deploy. Make sure to use the correct cloud provider (gcp or azure) as needed and configure the environment variables on the corresponding Bitbucket Deployment."
# Repository specific pipelines
default:
import: luce-bitbucket-pipes:master:default
pull-requests:
'{feature/*,fix/*,develop}':
import: luce-bitbucket-pipes:master:pull-requests
branches:
'{feature/*,fix/*}':
- step:
name: Lint & Tests
image: python:3.12
script:
- echo "Ejecutar lint y tests aquí"
# pip install -r requirements.txt
# pytest, flake8, etc.
develop:
- step:
name: Docker Build & Push
image: mcr.microsoft.com/azure-cli:latest
runs-on:
- self.hosted
- linux
- luceit
script:
- VERSION=$(cat .VERSION)
- DOCKER_IMAGE_VERSION=${DOCKER_IMAGE_NAME}:${VERSION}
- echo "Construimos imagen ${DOCKER_IMAGE_VERSION}"
- az login --service-principal --username ${AZURE_APP_ID} --password ${AZURE_APP_SECRET} --tenant ${AZURE_TENANT_ID}
- az acr build -r ${DOCKER_REGISTRY_SERVER} -t ${DOCKER_IMAGE_VERSION} .
- step:
name: Pipeline - Develop Common Steps
type: pipeline
custom: parent-develop-pipeline-common
- step:
name: Pipeline - Deploy to Develop
type: pipeline
custom: parent-develop-deploy-azure
staging:
- step:
name: Pipeline - Staging Common Steps
type: pipeline
custom: parent-staging-pipeline-common
- step:
name: Pipeline - Deploy to Staging
type: pipeline
custom: parent-staging-deploy-azure
script:
- VERSION=$(cat .VERSION)
- DOCKER_IMAGE_VERSION=${DOCKER_IMAGE_NAME}:${VERSION}
- echo "Construimos imagen ${DOCKER_IMAGE_VERSION}"
- az login --service-principal --username ${AZURE_APP_ID} --password ${AZURE_APP_SECRET} --tenant ${AZURE_TENANT_ID}
- az acr build -r ${DOCKER_REGISTRY_SERVER} -t ${DOCKER_IMAGE_VERSION} .
- step:
name: Pipeline - Post Deploy Testing
type: pipeline
custom: parent-post-deploy-testing
- step:
name: Pipeline - Post Deploy Steps
type: pipeline
custom: parent-post-deploy-steps
master:
- step:
name: Pipeline - Master Common Steps
type: pipeline
custom: parent-master-pipeline-common
- step:
name: Pipeline - Deploy to Production
type: pipeline
custom: parent-master-deploy-azure
script:
- VERSION=$(cat .VERSION)
- DOCKER_IMAGE_VERSION=${DOCKER_IMAGE_NAME}:${VERSION}
- echo "Construimos imagen ${DOCKER_IMAGE_VERSION}"
- az login --service-principal --username ${AZURE_APP_ID} --password ${AZURE_APP_SECRET} --tenant ${AZURE_TENANT_ID}
- az acr build -r ${DOCKER_REGISTRY_SERVER} -t ${DOCKER_IMAGE_VERSION} .
- step:
name: Pipeline - Post Deploy Steps
type: pipeline
custom: parent-post-deploy-steps