Set up some barebones automated testing
This commit is contained in:
parent
acc4e3f324
commit
73cad693a1
@ -9,6 +9,7 @@ variables:
|
||||
CI_HUB_USERNAME: rehashedsalt
|
||||
stages:
|
||||
- build
|
||||
- test
|
||||
- push
|
||||
services:
|
||||
- docker:dind
|
||||
@ -19,6 +20,7 @@ before_script:
|
||||
after_script:
|
||||
- docker logout hub.docker.com
|
||||
|
||||
# BUILD
|
||||
Build:
|
||||
stage: build
|
||||
script:
|
||||
@ -31,6 +33,15 @@ Build:
|
||||
.
|
||||
- docker push $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
|
||||
|
||||
# TEST
|
||||
Test_HTTP_200:
|
||||
stage: test
|
||||
script:
|
||||
- docker run -d -p 8889:80 $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
|
||||
- curl localhost:8889 | grep -ie '200 OK'
|
||||
- docker kill $(docker ps -q)
|
||||
|
||||
# PUSH
|
||||
Push_When_Tag:
|
||||
stage: push
|
||||
only:
|
||||
@ -47,8 +58,7 @@ Push_When_Tag:
|
||||
$CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
|
||||
$CI_HUB_USERNAME/$CI_PROJECT_NAME:latest
|
||||
- docker push $CI_HUB_USERNAME/$CI_PROJECT_NAME:latest
|
||||
|
||||
Push_Latest:
|
||||
Push_Bleeding:
|
||||
stage: push
|
||||
script:
|
||||
- docker pull $CI_HUB_USERNAME/$CI_PROJECT_NAME:$CI_COMMIT_SHORT_SHA
|
||||
|
Loading…
Reference in New Issue
Block a user