1+ # Starter pipeline
2+ # Start with a minimal pipeline that you can customize to build and deploy your code.
3+ # Add steps that build, run tests, deploy, and more:
4+ # https://aka.ms/yaml
5+ resources :
6+ repositories :
7+ - repository : IntegrationTests
8+ type : git
9+ name : launcher-automation/IntegrationTests
10+ ref : azure-pipelines
11+ trigger :
12+ branches :
13+ include :
14+ - azure-pipelines
15+
16+ pr :
17+ - master
18+ - releases/*
19+
20+ pool :
21+ name : launcher-automation-pool
22+
23+ steps :
24+ - script : echo Hello, world!
25+ displayName : ' Run a one-line script'
26+ - checkout : self
27+ - checkout : IntegrationTests
28+
29+ - script : dir $(Build.SourcesDirectory)
30+
31+ - task : DownloadSecureFile@1
32+ name : java_dockerfile
33+ displayName : ' download Dockerfile'
34+ inputs :
35+ secureFile : ' java.Dockerfile'
36+
37+ - script : |
38+ echo "place java.Dockerfile"
39+ echo $(java_dockerfile.secureFilePath)
40+ cp $(java_Dockerfile.secureFilePath) code-examples-java-private/Dockerfile
41+ displayName : ' place Dockerfile'
42+
43+ - script : |
44+ allure –-version
45+ java --version
46+ javac --version
47+ mvn --version
48+ docker --version
49+
50+ - task : DownloadSecureFile@1
51+ name : tests_config_properties
52+ displayName : ' download config.properties'
53+ inputs :
54+ secureFile : ' tests_config.properties'
55+
56+
57+ - script : |
58+ echo "place config.properties"
59+ echo $(tests_config_properties.secureFilePath)
60+ cp $(tests_config_properties.secureFilePath) IntegrationTests/src/main/resources/config.properties
61+ displayName : ' place config.properties'
62+
63+ - task : DownloadSecureFile@1
64+ name : java_application
65+ displayName : ' download application.json'
66+ inputs :
67+ secureFile : ' java.application.json'
68+
69+
70+ - script : |
71+ echo "place application.json"
72+ cp $(java_application.secureFilePath) code-examples-java-private/src/main/resources/application.json
73+ displayName : ' place application.json'
74+
75+
76+ - task : DownloadSecureFile@1
77+ name : java_private_key
78+ displayName : ' download private.key'
79+ inputs :
80+ secureFile : ' private.key'
81+
82+
83+ - script : |
84+ echo "place private.key"
85+ cp $(java_private_key.secureFilePath) code-examples-java-private/src/main/resources/private.key
86+ displayName : ' place private.key'
87+
88+ - script : dir $(Build.SourcesDirectory)
89+
90+ - script : dir $(Build.SourcesDirectory)/code-examples-java-private
91+
92+ - script : dir $(Build.SourcesDirectory)/code-examples-java-private/src/main/resources
93+
94+ - task : Docker@2
95+ displayName : Build java image
96+ inputs :
97+ command : build
98+ repository : ' launcher-automation-java'
99+ dockerfile : ' $(Build.SourcesDirectory)/code-examples-java-private/Dockerfile'
100+ buildContext : ' $(Build.SourcesDirectory)/code-examples-java-private '
101+ tags : |
102+ latest
103+
104+ - script : |
105+ docker run -p 8080:8080 -d launcher-automation-java:latest
106+ displayName : ' start java app'
107+
108+ - script : |
109+ cd IntegrationTests
110+ mvn clean test -DsuiteXmlFile="java.xml"
111+ displayName : ' Java app tests'
112+
113+ - script : |
114+ docker stop $(docker ps -a -q)
115+ docker rm $(docker ps -a -q)
116+ displayName : ' stop java app'
0 commit comments