You've already forked sap-jenkins-library
							
							
				mirror of
				https://github.com/SAP/jenkins-library.git
				synced 2025-10-30 23:57:50 +02:00 
			
		
		
		
	Create s4sdk consumer tests for neo environment (#524)
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -16,4 +16,4 @@ target/ | ||||
| targets/ | ||||
| documentation/docs-gen | ||||
|  | ||||
| consumer-test/workspace | ||||
| consumer-test/**/workspace | ||||
|   | ||||
| @@ -35,8 +35,10 @@ jobs: | ||||
|         cp -r documentation/docs documentation/docs-tmp | ||||
|         documentation/bin/createDocu.sh vars documentation/docs-tmp/steps | ||||
|         docker run --rm -it -v ${TRAVIS_BUILD_DIR}:/docs -w /docs/documentation squidfunk/mkdocs-material:3.0.4 build --clean --verbose --strict | ||||
|     - name: Consumer Tests for s4sdk pipeline | ||||
|       script: cd consumer-test && chmod +x runTests.sh && ./runTests.sh | ||||
|     - name: Consumer Tests for s4sdk pipeline (CloudFoundry) | ||||
|       script: cd consumer-test/s4sdk/CloudFoundry && chmod +x runTests.sh && ./runTests.sh | ||||
|     - name: Consumer Tests for s4sdk pipeline (Neo Environment) | ||||
|       script: cd consumer-test/s4sdk/NeoEnvironment && chmod +x runTests.sh && ./runTests.sh | ||||
|  | ||||
|     - stage: Docs | ||||
|       name: Deploy | ||||
|   | ||||
| @@ -1,14 +0,0 @@ | ||||
| #!/bin/bash -e | ||||
|  | ||||
| LIBRARY_VERSION_UNDER_TEST=$(git log --format="%H" -n 1) | ||||
| REPOSITORY_UNDER_TEST=${TRAVIS_REPO_SLUG:-SAP/jenkins-library} | ||||
|  | ||||
| rm -rf workspace | ||||
| git clone -b consumer-test https://github.com/sap/cloud-s4-sdk-book workspace | ||||
| cp -f jenkins.yml workspace | ||||
| cd workspace | ||||
| sed -i -e "s:__REPO_SLUG__:${REPOSITORY_UNDER_TEST}:g" jenkins.yml | ||||
| echo "@Library(\"piper-library-os@$LIBRARY_VERSION_UNDER_TEST\") _" | cat - Jenkinsfile > temp && mv temp Jenkinsfile | ||||
| git commit --all --author="piper-testing-bot <null@null.com>" --message="Set piper lib version for test" | ||||
|  | ||||
| docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}":/workspace -v /tmp -e CASC_JENKINS_CONFIG=/workspace/jenkins.yml -e CX_INFRA_IT_CF_USERNAME -e CX_INFRA_IT_CF_PASSWORD -e BRANCH_NAME=consumer-test ppiper/jenkinsfile-runner | ||||
							
								
								
									
										6
									
								
								consumer-test/s4sdk/CloudFoundry/runTests.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										6
									
								
								consumer-test/s4sdk/CloudFoundry/runTests.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| #!/bin/bash -e | ||||
|  | ||||
| source ../prepareTests.sh consumer-test | ||||
|  | ||||
| docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}":/workspace -v /tmp -e CASC_JENKINS_CONFIG=/workspace/jenkins.yml \ | ||||
|     -e CX_INFRA_IT_CF_USERNAME -e CX_INFRA_IT_CF_PASSWORD -e BRANCH_NAME=consumer-test ppiper/jenkinsfile-runner | ||||
							
								
								
									
										6
									
								
								consumer-test/s4sdk/NeoEnvironment/runTests.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										6
									
								
								consumer-test/s4sdk/NeoEnvironment/runTests.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| #!/bin/bash -e | ||||
|  | ||||
| source ../prepareTests.sh consumer-test-neo | ||||
|  | ||||
| docker run -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}":/workspace -v /tmp -e CASC_JENKINS_CONFIG=/workspace/jenkins.yml \ | ||||
|     -e CX_INFRA_IT_CF_USERNAME -e CX_INFRA_IT_CF_PASSWORD -e BRANCH_NAME=consumer-test-neo ppiper/jenkinsfile-runner | ||||
							
								
								
									
										20
									
								
								consumer-test/s4sdk/prepareTests.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										20
									
								
								consumer-test/s4sdk/prepareTests.sh
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| #!/usr/bin/env bash | ||||
|  | ||||
| EXAMPLE_PROJECT_BRANCH=$1 | ||||
|  | ||||
| LIBRARY_VERSION_UNDER_TEST=$(git log --format="%H" -n 1) | ||||
| REPOSITORY_UNDER_TEST=${TRAVIS_REPO_SLUG:-SAP/jenkins-library} | ||||
|  | ||||
| rm -rf workspace | ||||
| git clone -b "${EXAMPLE_PROJECT_BRANCH}" https://github.com/sap/cloud-s4-sdk-book workspace | ||||
| cp -f ../jenkins.yml workspace | ||||
| cd workspace || exit 1 | ||||
|  | ||||
| # Configure path to library-repository under test in Jenkins config | ||||
| sed -i -e "s:__REPO_SLUG__:${REPOSITORY_UNDER_TEST}:g" jenkins.yml | ||||
|  | ||||
| # Force usage of library version under test by setting it in the Jenkinsfile which is then the first definition and thus has the highest precedence | ||||
| echo "@Library(\"piper-library-os@$LIBRARY_VERSION_UNDER_TEST\") _" | cat - Jenkinsfile > temp && mv temp Jenkinsfile | ||||
|  | ||||
| # Commit the changed version because artifactSetVersion expects the git repo not to be dirty | ||||
| git commit --all --author="piper-testing-bot <piper-testing-bot@example.com>" --message="Set piper lib version for test" | ||||
		Reference in New Issue
	
	Block a user