Skip to content

Commit

Permalink
feat(ci): spin 3 agents
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
  • Loading branch information
glimchb committed Jun 13, 2024
1 parent 0a7c8c9 commit 76295a4
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ services:
set -euxo pipefail
env
apk add --no-cache --no-check-certificate curl make && rm -rf /var/cache/apk/*
rm -rf /tmp/sztpd-simulator
curl -kL https://watsen.net/support/sztpd-simulator-0.0.11.tgz | tar -zxvf - -C /tmp/
cd /tmp/sztpd-simulator/pki
echo "DNS.2 = bootstrap" >> sztpd1/sbi/end-entity/openssl.cnf
echo "DNS.3 = web" >> sztpd1/sbi/end-entity/openssl.cnf
echo "DNS.4 = redirecter" >> sztpd1/sbi/end-entity/openssl.cnf
sed -i 's/my-serial-number/third-serial-number/g' client/end-entity/openssl.cnf
make pki SHELL=/bin/ash
echo === SERVER SBI certificates ===
cat sztpd1/sbi/end-entity/my_cert.pem sztpd1/sbi/intermediate2/my_cert.pem > /tmp/cert_chain.pem
Expand All @@ -128,7 +128,28 @@ services:
/tmp/ta_cert_chain.cms \
/tmp/ta_cert_chain.pem \
/certs/server/
cp client/end-entity/private_key.pem client/end-entity/my_cert.pem /opi.pem /certs/client/
cp /opi.pem /certs/client/
echo === Generate Clients Endponts ===
sed -i 's/my-serial-number/third-serial-number/g' client/end-entity/openssl.cnf
make -C client/end-entity cert_request OPENSSL=openssl SHELL=/bin/ash
make -C client/intermediate2 sign_cert_request OPENSSL=openssl SHELL=/bin/ash REQDIR="../end-entity"
cp client/end-entity/private_key.pem /certs/client/third_private_key.pem
cp client/end-entity/my_cert.pem /certs/client/third_my_cert.pem
sed -i 's/third-serial-number/second-serial-number/g' client/end-entity/openssl.cnf
make -C client/end-entity cert_request OPENSSL=openssl SHELL=/bin/ash
make -C client/intermediate2 sign_cert_request OPENSSL=openssl SHELL=/bin/ash REQDIR="../end-entity"
cp client/end-entity/private_key.pem /certs/client/second_private_key.pem
cp client/end-entity/my_cert.pem /certs/client/second_my_cert.pem
sed -i 's/second-serial-number/first-serial-number/g' client/end-entity/openssl.cnf
make -C client/end-entity cert_request OPENSSL=openssl SHELL=/bin/ash
make -C client/intermediate2 sign_cert_request OPENSSL=openssl SHELL=/bin/ash REQDIR="../end-entity"
cp client/end-entity/private_key.pem /certs/client/first_private_key.pem
cp client/end-entity/my_cert.pem /certs/client/first_my_cert.pem
'
web:
Expand Down Expand Up @@ -174,7 +195,7 @@ services:
- opi
command: dhclient -d -v

agent:
agent3: &agent
image: ghcr.io/opiproject/opi-sztp-client:main
build:
context: sztp-agent
Expand All @@ -193,10 +214,26 @@ services:
- opi
command: ['/opi-sztp-agent', 'daemon',
'--bootstrap-trust-anchor-cert', '/certs/opi.pem',
'--device-end-entity-cert', '/certs/my_cert.pem',
'--device-private-key', '/certs/private_key.pem',
'--device-end-entity-cert', '/certs/third_my_cert.pem',
'--device-private-key', '/certs/third_private_key.pem',
'--serial-number', 'third-serial-number']

agent2:
<<: *agent
command: ['/opi-sztp-agent', 'daemon',
'--bootstrap-trust-anchor-cert', '/certs/opi.pem',
'--device-end-entity-cert', '/certs/second_my_cert.pem',
'--device-private-key', '/certs/second_private_key.pem',
'--serial-number', 'second-serial-number']

agent1:
<<: *agent
command: ['/opi-sztp-agent', 'daemon',
'--bootstrap-trust-anchor-cert', '/certs/opi.pem',
'--device-end-entity-cert', '/certs/first_my_cert.pem',
'--device-private-key', '/certs/first_private_key.pem',
'--serial-number', 'first-serial-number']

avahi:
image: docker.io/flungo/avahi:latest
environment:
Expand Down

0 comments on commit 76295a4

Please sign in to comment.