unit-test2 #10
					 2 changed files with 29 additions and 0 deletions
				
			
		| 
						 | 
					@ -96,6 +96,13 @@ steps:
 | 
				
			||||||
      exclude:
 | 
					      exclude:
 | 
				
			||||||
      - master
 | 
					      - master
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: test staging
 | 
				
			||||||
 | 
					  image: ellerbrock/alpine-bash-curl-ssl
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    BRANCH: ${DRONE_COMMIT_BRANCH}
 | 
				
			||||||
 | 
					  commands:
 | 
				
			||||||
 | 
					  - bash staging_tests.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: deploy live
 | 
					- name: deploy live
 | 
				
			||||||
  image: sinlead/drone-kubectl
 | 
					  image: sinlead/drone-kubectl
 | 
				
			||||||
  settings:
 | 
					  settings:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										22
									
								
								staging_tests.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								staging_tests.sh
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,22 @@
 | 
				
			||||||
 | 
					if [ ${BRANCH} == 'master' ]; then
 | 
				
			||||||
 | 
						TEST_URL='http://beer.k3s.kleph.eu'
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
						TEST_URL='http://staging.beer.k3s.kleph.eu'
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CURL_OPTS='-s'
 | 
				
			||||||
 | 
					# default
 | 
				
			||||||
 | 
					curl ${CURL_OPTS} ${TEST_URL} | grep -q 'setHours( 17, 0);'
 | 
				
			||||||
 | 
					[ $? -ne 0 ] && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# set 1 parameter
 | 
				
			||||||
 | 
					hours=18
 | 
				
			||||||
 | 
					curl ${CURL_OPTS} ${TEST_URL}/${hours} | grep -q "setHours( ${hours}, 0);"
 | 
				
			||||||
 | 
					[ $? -ne 0 ] && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# set 2 parameters
 | 
				
			||||||
 | 
					minutes=30
 | 
				
			||||||
 | 
					curl ${CURL_OPTS} ${TEST_URL}/${hours}/${minutes} | grep -q "setHours( ${hours}, ${minutes});"
 | 
				
			||||||
 | 
					[ $? -ne 0 ] && exit 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					exit 0
 | 
				
			||||||
		Loading…
	
		Reference in a new issue