Skip to content

Commit

Permalink
Merge pull request #73 from containerish/adding-scripts
Browse files Browse the repository at this point in the history
Chore: added recreating.sh script to replicate the results
  • Loading branch information
jay-dee7 authored Nov 26, 2021
2 parents d42c758 + 300c934 commit 45166d4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions scripts/recreating.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# This script will build and run OpenRegistry, then build and run
# the OCI conformance tests against it.
# It depends on bash, docker and git being available.

set -eu

spec_name=distribution-spec
spec_version=v1.0.1
OPENREGISTRY_IMAGE_NAME="openregistry-distribution-build:v$(date +%Y%m%d%H%M%S)"

# check out to OpenRegistry repo
rm -rf OpenRegistry && git clone git@github.com:containerish/OpenRegistry.git
pushd OpenRegistry
docker build -f ./Dockerfile -t "${OPENREGISTRY_IMAGE_NAME}" .

IP=`hostname -I | awk '{print $1}'`
sed -in "s/OPEN_REGISTRY_ENVIRONMENT=local/OPEN_REGISTRY_ENVIRONMENT=ci/g" env-vars.example
sed -in "s/OCI_ROOT_URL=http:\/\/0.0.0.0:5000/OCI_ROOT_URL=http:\/\/$IP:5000/g" conformance.vars

echo CI_SYS_ADDR="$IP":5000 >> env-vars.example

docker run --rm -p 5000:5000 --name openregistry -d --env-file=env-vars.example "${OPENREGISTRY_IMAGE_NAME}"
sleep 5
curl -XPOST -d '{"email":"johndoe@example.com","username":"johndoe","password":"Qwerty@123"}' "http://0.0.0.0:5000/auth/signup"
popd

# check out conformance repo
rm -rf conf-tmp && git clone https://github.com/opencontainers/${spec_name}.git conf-tmp
pushd conf-tmp/conformance && docker build -t conformance:latest -f Dockerfile .
popd

docker run --rm \
-v $(pwd)/results:/results \
-w /results \
--env-file=OpenRegistry/conformance.vars \
conformance:latest

cp results/report.html ./
cp results/junit.xml ./
rm -rf conf-tmp
docker rm -f openregistry

0 comments on commit 45166d4

Please sign in to comment.