Skip to content
Snippets Groups Projects
Verified Commit 28a643f9 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: add aws doc update to tasks #126

parent cc8cca89
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@ in {
(inputs.bob.defaultPackage."${currentSystem}")
(inputs.version.defaultPackage."${currentSystem}")
awscli2
appimage-run
blackbox
coreutils-full
......@@ -259,6 +260,56 @@ ${pkgs.xdg-utils}/bin/xdg-open ''${TEST_PATH}web/test.html
'';
scripts.publish-doc.exec = ''
#!${pkgs.bash}/bin/bash
if [ -t 1 ]; then
RED='\033[0;31m'
GREEN='\033[0;32m'
RESET='\033[0m'
BOLD='\033[1m'
else
RED=""
GREEN=""
RESET=""
fi
profileExists=$(aws configure list-profiles | grep shopcloud | wc -l)
if [ "$profileExists" -eq "0" ]; then
echo "No shopcloud profile found. Exiting."
echo "Please run: aws configure --profile=shopcloud"
exit 1
fi
if [ -d ${config.devenv.root}/dist/doc ]; then
rm -rf ${config.devenv.root}/dist/doc
fi
build-doc
code=$?
if [ "$code" -ne "0" ]; then
echo -e "''${RED}✖ Generate doc failed.''${RESET}"
exit 1
fi
echo -e "''${GREEN}✔ Generate doc successful.''${RESET}"
if [ ! -d ${config.devenv.root}/dist/doc ]; then
echo -e "''${RED}✖ No doc found.''${RESET}"
exit 1
fi
${pkgs.awscli2}/bin/aws --profile=shopcloud s3 --recursive --only-show-errors cp ${config.devenv.root}/dist/doc/ s3://monsterjs.org/en/api/
code=$?
if [ "$code" -ne "0" ]; then
echo -e "''${RED}✖ Upload failed.''${RESET}"
exit 1
fi
echo -e "''${GREEN}✔ Upload successful.''${RESET}"
'';
scripts.build-doc.exec = ''
rm -rf ${config.devenv.root}/dist/doc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment