-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDevSetup.html
183 lines (163 loc) · 11.3 KB
/
DevSetup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Setting up dev environment — AppAPI latest documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/tabs.css?v=4c969af8" />
<link rel="stylesheet" type="text/css" href="_static/css/styles.css?v=92f2225a" />
<link rel="stylesheet" type="text/css" href="_static/css/dark.css?v=41caee7b" />
<link rel="stylesheet" type="text/css" href="_static/css/light.css?v=c3d70dd7" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=c6e86fd7"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=f281be69"></script>
<script src="_static/tabs.js?v=3ee01567"></script>
<script src="_static/js/script.js?v=783f4f19"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Notes for Developers" href="notes_for_developers/index.html" />
<link rel="prev" title="Other OCS APIs" href="tech_details/api/other_ocs.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
AppAPI
<img src="_static/logo.svg" class="logo" alt="Logo"/>
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="Installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="DeployConfigurations.html">Deployment configurations</a></li>
<li class="toctree-l1"><a class="reference internal" href="CreationOfDeployDaemon.html">Creation of Deploy Daemon</a></li>
<li class="toctree-l1"><a class="reference internal" href="TestDeploy.html">Test Deploy Daemon</a></li>
<li class="toctree-l1"><a class="reference internal" href="ManagingExternalApplications.html">Managing External Applications</a></li>
<li class="toctree-l1"><a class="reference internal" href="Concepts.html">Concepts</a></li>
<li class="toctree-l1"><a class="reference internal" href="tech_details/index.html">Technical details</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Setting up dev environment</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#get-last-version-from-github">Get last version from GitHub</a></li>
<li class="toctree-l2"><a class="reference internal" href="#in-place-of-a-conclusion">In Place of a Conclusion</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#docker-remote-api">Docker remote API</a></li>
<li class="toctree-l3"><a class="reference internal" href="#docker-by-socket">Docker by socket</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="notes_for_developers/index.html">Notes for Developers</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq/index.html">Frequently Asked Questions</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">AppAPI</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">Setting up dev environment</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/DevSetup.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="setting-up-dev-environment">
<span id="dev-setup"></span><h1>Setting up dev environment<a class="headerlink" href="#setting-up-dev-environment" title="Link to this heading"></a></h1>
<p>We highly recommend using <a class="reference external" href="https://github.com/juliushaertl/nextcloud-docker-dev">Julius Haertl docker setup</a> for the Nextcloud dev setup.</p>
<p>Suggested IDE: <strong>PhpStorm</strong>, though you can certainly use any IDE of your preference such as <strong>VS Code</strong> or <strong>Vim</strong>.</p>
<section id="get-last-version-from-github">
<h2>Get last version from GitHub<a class="headerlink" href="#get-last-version-from-github" title="Link to this heading"></a></h2>
<p>Assuming you’re in the <code class="docutils literal notranslate"><span class="pre">apps</span></code> folder of Nextcloud with command <strong class="command">git</strong>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">cloud</span><span class="o">-</span><span class="n">py</span><span class="o">-</span><span class="n">api</span><span class="o">/</span><span class="n">app_api</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
<p>Change to the <code class="docutils literal notranslate"><span class="pre">app_api</span></code> directory with <strong class="command">shell</strong>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">app_api</span>
</pre></div>
</div>
<p>Then, build frontend assets in development mode with <strong class="command">shell</strong>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">npm</span> <span class="n">ci</span> <span class="o">&&</span> <span class="n">npm</span> <span class="n">run</span> <span class="n">dev</span>
</pre></div>
</div>
<p>After this, you can enable it from the directory where the <code class="docutils literal notranslate"><span class="pre">occ</span></code> command resides, with <strong class="command">shell</strong>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">occ</span> <span class="n">app</span><span class="p">:</span><span class="n">enable</span> <span class="o">--</span><span class="n">force</span> <span class="n">app_api</span>
</pre></div>
</div>
</section>
<section id="in-place-of-a-conclusion">
<h2>In Place of a Conclusion<a class="headerlink" href="#in-place-of-a-conclusion" title="Link to this heading"></a></h2>
<p>There are several make commands available to ease frequent development actions.</p>
<p>To see the complete list, execute <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">help</span></code>.</p>
<section id="docker-remote-api">
<h3>Docker remote API<a class="headerlink" href="#docker-remote-api" title="Link to this heading"></a></h3>
<p>The Docker Engine remote API can be easily configured via <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">dock2port</span></code> command.
The command will create a docker container to provide remote Docker Engine API.</p>
<p>Afterward, register DaemonConfigs in Nextcloud using <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">dock-port</span></code> command.</p>
</section>
<section id="docker-by-socket">
<h3>Docker by socket<a class="headerlink" href="#docker-by-socket" title="Link to this heading"></a></h3>
<p>For Docker via socket, use the command <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">dock-sock</span></code>.
This registers DaemonConfigs in Nextcloud for the default socket connection (<code class="docutils literal notranslate"><span class="pre">/var/run/docker.sock</span></code>).</p>
<p>Make sure that socket has enough permissions for Nextcloud and webserver user to access it
and actually forwarded to the container:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">...</span>
<span class="n">volumes</span><span class="p">:</span>
<span class="o">...</span>
<span class="o">-</span> <span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">run</span><span class="o">/</span><span class="n">docker</span><span class="o">.</span><span class="n">sock</span><span class="p">:</span><span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">run</span><span class="o">/</span><span class="n">docker</span><span class="o">.</span><span class="n">sock</span>
<span class="o">...</span>
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="tech_details/api/other_ocs.html" class="btn btn-neutral float-left" title="Other OCS APIs" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="notes_for_developers/index.html" class="btn btn-neutral float-right" title="Notes for Developers" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2024 Nextcloud GmbH.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>