# Automating the installation process

**URL:** <https://meta.discourse.org/t/automating-the-installation-process/100996>\
**Category:** Support\
**Created:** [October 31, 2018, 4:44pm UTC](https://meta.discourse.org/t/automating-the-installation-process/100996 "2018-10-31T16:44:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![drmrbrewer](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@drmrbrewer](https://meta.discourse.org/u/drmrbrewer)\
**Post date:** [October 31, 2018, 4:44pm UTC](https://meta.discourse.org/t/automating-the-installation-process/100996/1 "2018-10-31T16:44:53Z")

</div>

I’m following the steps in the [install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md) and it works just fine. Now I’m considering how I can automate this process (as part of a script run when spinning up a new server).

When it comes to running `./discourse-setup` some manual input is presently required. Is it possible to pass arguments to this script in some way, or via an env var somehow, so that it can be run as part of a server init script?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [October 31, 2018, 5:27pm UTC](https://meta.discourse.org/t/automating-the-installation-process/100996/2 "2018-10-31T17:27:48Z")

</div>

You can pipe the input in to `discourse-setup`. That’s what my install script does. A year or so ago I changed the bit that creates the swap to have a delay rather than require an extra return so that the input that `discourse-setup` needs is always the same.

---

<div class="post-metadata">

**Author:** ![drmrbrewer](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@drmrbrewer](https://meta.discourse.org/u/drmrbrewer)\
**Post date:** [October 31, 2018, 6:12pm UTC](https://meta.discourse.org/t/automating-the-installation-process/100996/3 "2018-10-31T18:12:13Z")

</div>

Ah that’s good to know. How exactly do you pipe multiple inputs (including a delay) to the `discourse-setup` script?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [October 31, 2018, 6:29pm UTC](https://meta.discourse.org/t/automating-the-installation-process/100996/4 "2018-10-31T18:29:38Z")

</div>

something like

```plaintext
./discourse-setup<<EOF
the stuff
you pipe in
EOF

```

You don’t need to worry about the delays.

---

<div class="post-metadata">

**Author:** ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)\
**Post date:** [October 31, 2018, 11:00pm UTC](https://meta.discourse.org/t/automating-the-installation-process/100996/5 "2018-10-31T23:00:08Z")

</div>

> [@pfaffman](#):
>
> You can pipe the input

Technically, that is not a pipe but redirection.

The less than symbol “\<” is redirecting the standard input (stdin). A [pipe(-line)](https://en.wikipedia.org/wiki/Vertical_bar#Pipe) is denoted by a vertical bar “|”.

This pipe uses no file system operations:  
`command1 | command2`

Redirections can achieve the same sort of result mediated by a temporary file:  
`command1 > tempfile`  
`command2 < tempfile`

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [August 7, 2021, 2:55am UTC](https://meta.discourse.org/t/automating-the-installation-process/100996/6 "2021-08-07T02:55:08Z")

</div>


