1616
1717# <cmd> || return is so the script can exit early without quitting your shell.
1818
19+ START_FULCIO=true
20+ START_REKOR=true
21+ START_TSA=true
22+ START_REKOR_TILES=true
23+
24+ while [[ " $# " -gt 0 ]]; do
25+ case $1 in
26+ --no-fulcio) START_FULCIO=false; ;;
27+ --no-rekor) START_REKOR=false; ;;
28+ --no-tsa) START_TSA=false; ;;
29+ --no-rekor-tiles) START_REKOR_TILES=false; ;;
30+ * ) echo " Unknown parameter passed: $1 " ; exit 1 ;;
31+ esac
32+ shift
33+ done
34+
1935CLONE_DIR=" ${CLONE_DIR:- $(mktemp -d)} "
2036CWD=" $( pwd) "
2137
@@ -43,36 +59,41 @@ popd || return
4359
4460echo " downloading service repos"
4561pushd " $CLONE_DIR " || return
46- FULCIO_REPO=" ${FULCIO_REPO:- sigstore/ fulcio} "
47- REKOR_REPO=" ${REKOR_REPO:- sigstore/ rekor} "
48- TIMESTAMP_AUTHORITY_REPO=" ${TIMESTAMP_AUTHORITY_REPO:- sigstore/ timestamp-authority} "
49- REKOR_TILES_REPO=" ${REKOR_TILES_REPO:- sigstore/ rekor-tiles} "
50- OWNER_REPOS=(
51- " $FULCIO_REPO "
52- " $REKOR_REPO "
53- " $TIMESTAMP_AUTHORITY_REPO "
54- " $REKOR_TILES_REPO "
55- )
62+ OWNER_REPOS=()
63+ if [ " $START_FULCIO " = true ]; then
64+ OWNER_REPOS+=(" ${FULCIO_REPO:- sigstore/ fulcio} " )
65+ fi
66+ if [ " $START_REKOR " = true ]; then
67+ OWNER_REPOS+=(" ${REKOR_REPO:- sigstore/ rekor} " )
68+ fi
69+ if [ " $START_TSA " = true ]; then
70+ OWNER_REPOS+=(" ${TIMESTAMP_AUTHORITY_REPO:- sigstore/ timestamp-authority} " )
71+ fi
72+ if [ " $START_REKOR_TILES " = true ]; then
73+ OWNER_REPOS+=(" ${REKOR_TILES_REPO:- sigstore/ rekor-tiles} " )
74+ fi
5675procs=${# OWNER_REPOS[@]}
5776for owner_repo in " ${OWNER_REPOS[@]} " ; do
58- repo=$( basename " $owner_repo " )
59- if [[ ! -d $repo ]]; then
60- echo " 'git clone https://github.com/${owner_repo} .git'"
61- else
62- echo " 'cd $repo && git pull'"
63- fi
77+ repo=$( basename " $owner_repo " )
78+ if [[ ! -d $repo ]]; then
79+ echo " 'git clone https://github.com/${owner_repo} .git'"
80+ else
81+ echo " 'cd $repo && git pull'"
82+ fi
6483done | xargs -P " $procs " -L1 bash -c
6584export CT_LOG_KEY=" $CLONE_DIR /fulcio/config/ctfe/pubkey.pem"
6685
6786echo " starting services"
6887export FULCIO_METRICS_PORT=2113
6988for owner_repo in " ${OWNER_REPOS[@]} " ; do
70- repo=$( basename " $owner_repo " )
71- echo " 'cd $repo && docker compose up --wait'"
89+ repo=$( basename " $owner_repo " )
90+ echo " 'cd $repo && docker compose up --wait'"
7291done | xargs -P " $procs " -L1 bash -c
7392# The fakeoidc service is in a separate Docker network. Connect the fakeoidc container to the Fulcio
7493# network to enable Fulcio to reach it for token verification.
75- docker network inspect fulcio_default | grep fakeoidc || docker network connect --alias fakeoidc fulcio_default fakeoidc || return
94+ if [ " $START_FULCIO " = true ]; then
95+ docker network inspect fulcio_default | grep fakeoidc || docker network connect --alias fakeoidc fulcio_default fakeoidc || return
96+ fi
7697export TSA_URL=" http://localhost:3004"
7798popd || return
7899
@@ -98,13 +119,20 @@ stop_services() {
98119
99120echo " building trusted root"
100121pushd " $CLONE_DIR " || return
101- " $CWD " /build-trusted-root.sh \
102- --fulcio http://localhost:5555 " $CLONE_DIR /fulcio/config/ctfe/pubkey.pem" \
103- --timestamp-url http://localhost:3004 \
104- --oidc-url http://localhost:8080 \
105- --rekor-v1-url http://localhost:3000 \
106- --rekor-v2 http://localhost:3003 " $CLONE_DIR /rekor-tiles/tests/testdata/pki/ed25519-pub-key.pem" " rekor-local" \
107- || return
122+ BUILD_CMD=(" $CWD /build-trusted-root.sh" --oidc-url http://localhost:8080)
123+ if [ " $START_FULCIO " = true ]; then
124+ BUILD_CMD+=(--fulcio http://localhost:5555 " $CLONE_DIR /fulcio/config/ctfe/pubkey.pem" )
125+ fi
126+ if [ " $START_TSA " = true ]; then
127+ BUILD_CMD+=(--timestamp-url http://localhost:3004)
128+ fi
129+ if [ " $START_REKOR " = true ]; then
130+ BUILD_CMD+=(--rekor-v1-url http://localhost:3000)
131+ fi
132+ if [ " $START_REKOR_TILES " = true ]; then
133+ BUILD_CMD+=(--rekor-v2 http://localhost:3003 " $CLONE_DIR /rekor-tiles/tests/testdata/pki/ed25519-pub-key.pem" " rekor-local" )
134+ fi
135+ " ${BUILD_CMD[@]} " || return
108136export TRUSTED_ROOT=" $CLONE_DIR /trusted_root.json"
109137export SIGNING_CONFIG=" $CLONE_DIR /signing_config.json"
110138export TRUST_CONFIG=" $CLONE_DIR /trust_config.json"
0 commit comments