{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 情報を書き戻す\n", "変更内容をデータガバナンス機能へ書き戻す。" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. 書き戻しの準備を行う" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from datalad import api\n", "\n", "api.save(message=SAVE_MESSAGE)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "os.chdir(\"/home/jovyan\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%%sh\n", "chmod 600 /home/jovyan/.ssh/id_rsa" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. 書き戻す" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from datalad import api\n", "\n", "try:\n", " api.siblings(action='add', name=SIBLING_NAME, url=SSH_PUSH_URL)\n", "except:\n", " pass\n", "\n", "api.push(to=SIBLING_NAME, result_renderer='default')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.8" } }, "nbformat": 4, "nbformat_minor": 4 }