Skip to content

Commit

Permalink
in e2e_tsa_mtls.sh, build timestamp-server only if not found
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S <[email protected]>
  • Loading branch information
dmitris committed Jul 18, 2023
1 parent 0e15d3d commit 3fe9281
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
20 changes: 12 additions & 8 deletions test/e2e_tsa_mtls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ TIMESTAMP_SERVER_KEY=$CERT_BASE/tsa-mtls-server.key
TIMESTAMP_SERVER_NAME="server.example.com"
TIMESTAMP_SERVER_URL=https://localhost:3000/api/v1/timestamp

rm -fr /tmp/timestamp-authority
git clone https://github.com/sigstore/timestamp-authority /tmp/timestamp-authority
pushd /tmp/timestamp-authority
make
popd
/tmp/timestamp-authority/bin/timestamp-server serve --disable-ntp-monitoring --tls-host 0.0.0.0 --tls-port 3000 \
--scheme https --tls-ca $TIMESTAMP_CACERT --tls-key $TIMESTAMP_SERVER_KEY --tls-certificate $TIMESTAMP_SERVER_CERT &
export PATH="/tmp/timestampserver:$PATH"
command -v timestamp-server >& /dev/null
if [[ $? != 0 ]]; then
rm -fr /tmp/timestamp-authority
git clone https://github.com/sigstore/timestamp-authority /tmp/timestamp-authority
pushd /tmp/timestamp-authority
make
export PATH="/tmp/timestamp-authority:$PATH"
popd
fi
timestamp-server serve --disable-ntp-monitoring --tls-host 0.0.0.0 --tls-port 3000 \
--scheme https --tls-ca $TIMESTAMP_CACERT --tls-key $TIMESTAMP_SERVER_KEY --tls-certificate $TIMESTAMP_SERVER_CERT &


IMG=${IMAGE_URI_DIGEST:-}
if [[ "$#" -ge 1 ]]; then
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/gen-tsa-mtls-certs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# This script generates certificates for testing
# mTLS connection from 'cosign' command to the TSA server.
Expand Down

0 comments on commit 3fe9281

Please sign in to comment.