Files
libsession-util/utils/ci/drone-docs-upload.sh
Jason Rhinelander c7ce6dc1e4 Docs: various changes to make easier to write/generate
- Generic cpp/c api docs into different directories so that you can
  generate both at once without trampling one or the other.
  - `make` with no args now does both by default.
- Combine doc-building CI jobs into one job that builds and then uploads
  both at once.
- Move CI-specific upload script into `/utils/ci`
- Remove most `Declaration:` sections: if no such section is found, we
  now scrape the source code for the code immediately following the
  comment and use that.  Declaration: is now only used where that isn't
  the same, or where it has multiple declarations in one.
- Remove most of the C++ Declaration:s (the C ones seem different
  enough from the actual code items).
- Make `Outputs:` optional and remove all the superflous `void` output
  descriptions.
2023-07-24 17:00:05 -03:00

29 lines
726 B
Bash
Executable File

#!/bin/bash
# Script used with Drone CI to upload docs
set -o errexit
if [ -z "$SSH_KEY" ]; then
echo -e "\n\n\n\e[31;1mUnable to upload debs: SSH_KEY not set\e[0m"
# Just warn but don't fail, so that this doesn't trigger a build failure for untrusted builds
exit 0
fi
echo "$SSH_KEY" >~/ssh_key
set -o xtrace # Don't start tracing until *after* we write the ssh key
chmod 600 ~/ssh_key
sftp -i ~/ssh_key -b - -o StrictHostKeyChecking=off [email protected] <<SFTP
put -r ./libsession-util-c/* /home/apidocs/www/libsession-util-c/
put -r ./libsession-util-cpp/* /home/apidocs/www/libsession-util-cpp/
SFTP
set +o xtrace
echo -e "\n\n\n\n\e[32;1mUploaded docs to https://api.oxen.io/\e[0m\n\n\n"