-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathazure-pipelines-nightly-test.yml
More file actions
117 lines (103 loc) · 4.22 KB
/
Copy pathazure-pipelines-nightly-test.yml
File metadata and controls
117 lines (103 loc) · 4.22 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
name: snomio-$(Date:yyyyMMdd)$(Rev:.r)_$(Build.SourceBranchName)
trigger:
- main
#schedules:
# - cron: "0 11 * * *"
# displayName: Nightly Run
# branches:
# include:
# - main
# always: true
variables:
mavenCache: $(Pipeline.Workspace)/.m2/repository
mavenOptions: '-Dmaven.repo.local=$(mavenCache) -Dmaven.settings.security=never'
scheduledRun: $[eq(variables['Build.Reason'], 'Schedule')]
pool:
vmImage: ubuntu-latest
jobs:
- job: snomio_nightly_test
displayName: Run nightly test
# condition: eq(variables.scheduledRun, 'True')
timeoutInMinutes: 60
steps:
- task: Docker@2
displayName: 'Login to ACR'
inputs:
command: login
containerRegistry: $(containerRegistry)
- script: |
# Modify docker compose
sed -i 's/ims-username=.*/ims-username=$(imsUsername)/' ui/cypress/docker/docker-compose.yaml
sed -i 's/ims-password=.*/ims-password=$(imsPassword)/' ui/cypress/docker/docker-compose.yaml
sed -i 's/snomio.jira.users=.*/snomio.jira.users=$(imsUsername)/' ui/cypress/docker/docker-compose.yaml
cat ui/cypress/docker/docker-compose.yaml
# Create nginx directory if it doesn't exist
mkdir -p ui/cypress/docker/nginx
# Generate SSL certificates
openssl req -x509 -nodes -newkey rsa:2048 -keyout ui/cypress/docker/nginx/key.pem -out ui/cypress/docker/nginx/cert.pem -days 365 -subj "/C=AU/ST=QLD/L=Brisbane/O=CSIRO/OU=CSIRO Department/CN=snomio"
- task: DockerCompose@1
inputs:
containerregistrytype: 'Azure Container Registry'
azureContainerRegistry: $(dockerRegistry)
dockerComposeFile: 'ui/cypress/docker/docker-compose.yaml'
action: 'Run services'
projectName: snomio
buildImages: false
abortOnContainerExit: false
detached: true
- script: |
# Add entry to hosts file
echo "127.0.0.1 local-snomio.ihtsdotools.org" | sudo tee -a /etc/hosts
cat /etc/hosts
cd ui
npm install cypress --save-dev
npm install dotenv
export CYPRESS_BASE_URL="https://local-snomio.ihtsdotools.org:443"
export cypress_frontend_url="https://local-snomio.ihtsdotools.org:443"
export cypress_ims_username=$(imsUsername)
export cypress_ims_password=$(imsPassword)
export cypress_ims_url="https://dev-ims.ihtsdotools.org"
export cypress_apUrl="https://dev-snowstorm.ihtsdotools.org"
export cypress_apProjectKey="AUAMT"
export cypress_apDefaultBranch="MAIN/SNOMEDCT-AU/AUAMT"
npx cypress run
displayName: 'Set environment variables and run Cypress tests'
# - job: snomio_nightly_integration_test
# displayName: Run nightly Integration test
# condition: eq(variables.scheduledRun, 'True')
# timeoutInMinutes: 60
# pool:
# name: 'highmemory-pool'
# steps:
# - task: MavenAuthenticate@0
# inputs:
# artifactsFeeds: 'snomio'
#
# - task: Docker@2
# displayName: 'Login to ACR'
# inputs:
# command: login
# containerRegistry: $(containerRegistry)
#
# - task: Cache@2
# displayName: Cache Maven local repo
# inputs:
# key: 'maven | "$(Agent.OS)" | **/pom.xml'
# restoreKeys: |
# maven | "$(Agent.OS)"
# maven
# path: $(mavenCache)
#
# - task: Maven@3
# condition: eq(variables['runIntegrationTest'], 'true')
# displayName: 'Build and run integration test with Sergio Extension enabled'
# inputs:
# mavenPomFile: 'pom.xml'
# options: '-Ddocker.registry.host=$(dockerRegistry) -Dsnomio.extensions.sergio.enabled=true -DargLine="-Dims-username=$(imsUsername) -Dims-password=$(imsPassword)"'
# mavenOptions: '$(mavenOptions) -Xmx5072m -Dims-username=$(imsUsername) -Dims-password=$(imsPassword) -Dbuildnumber=$(buildInfo)'
# javaHomeOption: 'path'
# jdkUserInputPath: '/usr/lib/jvm/java-17-openjdk-amd64'
# jdkArchitectureOption: 'x64'
# publishJUnitResults: true
# testResultsFiles: '**/surefire-reports/TEST-*.xml'
# goals: 'test'