Created
March 9, 2015 21:50
-
-
Save daviddavis/1e90a4bbe2836a6bd91b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bats | |
# vim: ft=sh:sw=2:et:tw=100 | |
@test "create a product" { | |
hammer -u admin -p changeme product create --organization="Default Organization" \ | |
--name="Docker Product" | grep -q "Product created" | |
} | |
@test "create Docker repository" { | |
hammer -u admin -p changeme repository create --organization="Default Organization" \ | |
--product="Docker Product" --content-type="docker" --name "busybox" \ | |
--url https://registry.hub.docker.com --docker-upstream-name busybox | \ | |
grep -q "Repository created" | |
} | |
@test "sync Docker repository" { | |
hammer -u admin -p changeme repository synchronize --organization="Default Organization" \ | |
--product="Docker Product" --name="busybox" | |
} | |
@test "create lifecycle environment" { | |
hammer -u admin -p changeme lifecycle-environment create --organization="Default Organization" \ | |
--prior="Library" --name="Dev" | grep -q "Environment created" | |
} | |
@test "create content view" { | |
hammer -u admin -p changeme content-view create --organization="Default Organization" \ | |
--name="Docker CV" | grep -q "Content view created" | |
} | |
@test "add repo to content view" { | |
repo_id=$(hammer -u admin -p changeme repository list --organization="Default Organization" \ | |
| grep busybox | cut -d\| -f1 | egrep -i '[0-9]+') | |
hammer -u admin -p changeme content-view add-repository --organization="Default Organization" \ | |
--name="Docker CV" --repository-id=$repo_id | grep -q "The repository has been associated" | |
} | |
@test "publish content view" { | |
hammer -u admin -p changeme content-view publish --organization="Default Organization" \ | |
--name="Docker CV" | |
} | |
@test "promote content view" { | |
hammer -u admin -p changeme content-view version promote --organization="Default Organization" \ | |
--content-view="Docker CV" --to-lifecycle-environment="Dev" --version 1 | |
} | |
@test "docker tag list" { | |
hammer -u admin -p changeme docker tag list --organization="Default Organization" \ | |
--content-view="Docker CV" --environment="Dev" | grep -q "latest" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment