-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathutplsql-cicd-flyway-demo.yml
134 lines (130 loc) · 5.09 KB
/
utplsql-cicd-flyway-demo.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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
trigger:
- none
pool:
vmImage: ubuntu-latest
variables:
# Using this variable, the template references the correct variable template file (vars-dev.yaml, vars-qa.yaml or vars-prd.yaml) from the vars folder.
- template: .azure_templates/vars/vars-global.yml
- name: SQLCL_DIR
value: $(Build.BinariesDirectory)/sqlcl
- name : UTPLSQL_DIR
value: $(Build.BinariesDirectory)/utPLSQL
- name : UTPLSQL_CLI_DIR
value: $(Build.BinariesDirectory)/utPLSQL-cli
- name : UTPLSQL_CLI_VERSION
value: '3.1.9'
- name : UTPLSQL_VERSION
value: 'v3.1.13'
- name : DB_USER
value: ut3_demo
- name : DB_PASS
value: ut3_demo
- name: artifactName
value: ReleaseArtifact
extends:
template: .azure_templates/t-pipeline-extend-cicd.yml
parameters:
enableBuild: true
enableDeployment: true
enableAnalysis: false
releaseMethod: "flyway"
buildDatabase:
- name: BuildDatabase
containerRegistry: ${{ variables.containerRegistry }}
dockerRepo: ${{ variables.dockerRepo }}
connectionString: "127.0.0.1:1521/XE"
jdbcConnectionString: "UTBUILD:1521:XE"
environment: "build"
artifactName: ${{ variables.artifactName }}
packages:
- name: downloadSqlcl
download_location: "$(Build.BinariesDirectory)/sqlcl-latest.zip"
unpack_location: "$(Build.BinariesDirectory)"
url: ${{ variables.sqlclUrl }}
archive: "zip"
addtoPath: "$(SQLCL_DIR)/bin"
- name: downloadUtlplsqlcli
download_location: "$(Build.BinariesDirectory)/utPLSQL-cli.zip"
unpack_location: "$(Build.BinariesDirectory)"
url: ${{ variables.utplsqlcliUrl }}
archive: "zip"
addToPath: "$(UTPLSQL_CLI_DIR)/bin"
- name: DownloadOjdbc8
download_location: "$(Build.BinariesDirectory)/ojdbc8.jar "
url: ${{ variables.ojdbcurl }}
createDatabase:
- dbname: UTBUILD
oracleVersion: "21-slim"
dockerPortMap: "1521"
dockerOptions: ""
scripts:
- displayName: "Install utPLSQL"
user: "sys"
password: "oracle"
script: "install_headless.sql UT3 UT3 users"
work_dir: "${UTPLSQL_DIR}/source"
- displayName: "Create Test User"
user: "sys"
password: "oracle"
script: "source/create_user.sql"
work_dir: "$(Build.SourcesDirectory)"
- displayName: "Install Tests"
user: "$(DB_USER)"
password: "$(DB_PASS)"
script: "test/install.sql"
work_dir: "$(Build.SourcesDirectory)"
runflyway:
- config_dir: "$(Build.SourcesDirectory)"
config_file: "utplsql_flyway.conf"
migrations_dir: "$(Build.SourcesDirectory)/source"
driver_dir: "$(Build.BinariesDirectory)"
user: $(DB_USER)
password: $(DB_PASS)
gitCheckoutDetails:
- gitRepo: ${{ variables.gitRepo }}
branch: $(UTPLSQL_VERSION)
checkoutDir: $(UTPLSQL_DIR)
execute_tests:
- work_dir: $(Build.SourcesDirectory)
test_user: $(DB_USER)
test_pwd: $(DB_PASS)
source_path: "source"
test_path: "test"
options: "--debug --failure-exit-code=0"
deployStages:
- name: ReleaseCode
display_name: Deploy code to Test Env
dependsOn: BuildDatabase
target_environment: TEST
connectionString: "127.0.0.1:1521/XE"
jdbcConnectionString: "UTTEST:1521:XE"
containerRegistry: ${{ variables.containerRegistry }}
dockerRepo: ${{ variables.dockerRepo }}
createDatabase:
- dbname: UTTEST
oracleVersion: "21-slim"
dockerPortMap: "1521"
dockerOptions: ""
packages:
- name: sqlcl
download_location: "$(Build.BinariesDirectory)/sqlcl-latest.zip"
unpack_location: "$(Build.BinariesDirectory)"
url: ${{ variables.sqlclUrl }}
archive: "zip"
addtoPath: "$(SQLCL_DIR)/bin"
- name: DownloadOjdbc8
download_location: "$(Build.BinariesDirectory)/ojdbc8.jar "
url: ${{ variables.ojdbcurl }}
scripts:
- displayName: "Create Test User"
user: "sys"
password: "oracle"
script: "source/create_user.sql"
work_dir: "$(Pipeline.Workspace)/${{ variables.artifactName }}"
runflyway:
- config_dir: "$(Pipeline.Workspace)/${{ variables.artifactName }}"
config_file: "utplsql_flyway.conf"
migrations_dir: "$(Pipeline.Workspace)/${{ variables.artifactName }}/source"
driver_dir: "$(Build.BinariesDirectory)"
user: $(DB_USER)
password: $(DB_PASS)