Преглед изворни кода

Move elixir to its own file

Bob Mottram пре 7 година
родитељ
комит
b9f01c1985
2 измењених фајлова са 64 додато и 25 уклоњено
  1. 1
    25
      src/freedombone-app-pleroma
  2. 63
    0
      src/freedombone-utils-elixir

+ 1
- 25
src/freedombone-app-pleroma Прегледај датотеку

@@ -902,7 +902,7 @@ function remove_pleroma {
902 902
     rm /etc/systemd/system/pleroma.service
903 903
 
904 904
     userdel pleroma
905
-    #apt-get -yq remove esl-erlang elixir erlang-xmerl erlang-dev erlang-parsetools
905
+    #remove_elixir
906 906
 
907 907
     function_check remove_nodejs
908 908
     remove_nodejs pleroma-backend
@@ -936,30 +936,6 @@ function remove_pleroma {
936 936
     remove_ddns_domain "$PLEROMA_DOMAIN_NAME"
937 937
 }
938 938
 
939
-function install_elixir {
940
-    apt-get -yq install wget build-essential
941
-
942
-    if [ ! -d "$INSTALL_DIR" ]; then
943
-        mkdir -p "$INSTALL_DIR"
944
-    fi
945
-
946
-    cd "$INSTALL_DIR" || exit 768345274
947
-    erlang_package=erlang-solutions_1.0_all.deb
948
-    wget https://packages.erlang-solutions.com/$erlang_package
949
-    if [ ! -f "$INSTALL_DIR/$erlang_package" ]; then
950
-        exit 72853
951
-    fi
952
-    dpkg -i $erlang_package
953
-    apt-get -yq update
954
-    apt-get -yq install esl-erlang
955
-    apt-get -yq install elixir erlang-xmerl erlang-dev erlang-parsetools
956
-
957
-    if [ ! -f /usr/local/bin/mix ]; then
958
-        echo $'/usr/local/bin/mix not found after elixir installation'
959
-        exit 629352
960
-    fi
961
-}
962
-
963 939
 function install_pleroma {
964 940
     if [ ! $ONION_ONLY ]; then
965 941
         ONION_ONLY='no'

+ 63
- 0
src/freedombone-utils-elixir Прегледај датотеку

@@ -0,0 +1,63 @@
1
+#!/bin/bash
2
+#
3
+# .---.                  .              .
4
+# |                      |              |
5
+# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
+# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
+# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
+#
9
+#                    Freedom in the Cloud
10
+#
11
+# Elixir functions
12
+#
13
+# There's a problem with installing this onto mesh images, which is
14
+# that qemu appears to run out of RAM when using yarn to add webpack.
15
+#
16
+# License
17
+# =======
18
+#
19
+# Copyright (C) 2018 Bob Mottram <bob@freedombone.net>
20
+#
21
+# This program is free software: you can redistribute it and/or modify
22
+# it under the terms of the GNU Affero General Public License as published by
23
+# the Free Software Foundation, either version 3 of the License, or
24
+# (at your option) any later version.
25
+#
26
+# This program is distributed in the hope that it will be useful,
27
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
28
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
29
+# GNU Affero General Public License for more details.
30
+#
31
+# You should have received a copy of the GNU Affero General Public License
32
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
33
+
34
+function remove_elixir {
35
+    apt-get -yq remove elixir erlang-xmerl erlang-dev erlang-parsetools
36
+    apt-get -yq remove esl-erlang
37
+}
38
+
39
+function install_elixir {
40
+    apt-get -yq install wget build-essential
41
+
42
+    if [ ! -d "$INSTALL_DIR" ]; then
43
+        mkdir -p "$INSTALL_DIR"
44
+    fi
45
+
46
+    cd "$INSTALL_DIR" || exit 768345274
47
+    erlang_package=erlang-solutions_1.0_all.deb
48
+    wget https://packages.erlang-solutions.com/$erlang_package
49
+    if [ ! -f "$INSTALL_DIR/$erlang_package" ]; then
50
+        exit 72853
51
+    fi
52
+    dpkg -i $erlang_package
53
+    apt-get -yq update
54
+    apt-get -yq install esl-erlang
55
+    apt-get -yq install elixir erlang-xmerl erlang-dev erlang-parsetools
56
+
57
+    if [ ! -f /usr/local/bin/mix ]; then
58
+        echo $'/usr/local/bin/mix not found after elixir installation'
59
+        exit 629352
60
+    fi
61
+}
62
+
63
+# NOTE: deliberately no exit 0