Skip to content

Commit

Permalink
fix(sztp): git ignore generated_config.json
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Jun 6, 2024
1 parent 4f0f1de commit 6b352aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sztp/generated-client/
sztp/generated-server/
sztp/generated_config.json
6 changes: 3 additions & 3 deletions sztp/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export SZTPD_NBI_PORT=$(awk '/SZTPD_NBI_PORT:/{print $2}' ../docker-compose.yml)
export SZTPD_SBI_PORT=$(awk '/SZTPD_SBI_PORT:/{print $2}' ../docker-compose.yml)

# generate template
envsubst "$(printf '${%s} ' ${names[@]})" < template.json > config.json
envsubst "$(printf '${%s} ' ${names[@]})" < template.json > generated_config.json

# check what changed
diff template.json config.json || true
diff template.json generated_config.json || true

# client
echo "Now COPY client files to the remote clients:"
Expand All @@ -44,6 +44,6 @@ echo scp ./generated-client/opi*.pem [email protected]:/mnt/
# server
echo "Now CONFIG server:"
echo curl --fail -i -X GET --user [email protected]:my-secret -H 'Accept:application/yang-data+json' "http://127.0.0.1:${SZTPD_INIT_PORT}/restconf/ds/ietf-datastores:running"
echo curl --fail -i -X PUT --user [email protected]:my-secret --data @./config.json -H 'Content-Type:application/yang-data+json' "http://127.0.0.1:${SZTPD_INIT_PORT}/restconf/ds/ietf-datastores:running"
echo curl --fail -i -X PUT --user [email protected]:my-secret --data @./generated_config.json -H 'Content-Type:application/yang-data+json' "http://127.0.0.1:${SZTPD_INIT_PORT}/restconf/ds/ietf-datastores:running"
echo curl --fail -i -X GET --user [email protected]:my-secret -H 'Accept:application/yang-data+json' "http://127.0.0.1:${SZTPD_NBI_PORT}/restconf/ds/ietf-datastores:running"
echo curl --fail -H Accept:application/yang-data+json "http://127.0.0.1:${SZTPD_NBI_PORT}/.well-known/host-meta"

0 comments on commit 6b352aa

Please sign in to comment.