summaryrefslogtreecommitdiff
path: root/doc/details/development.md
blob: 78915add916af40d766ed6226b8087aa14fa3501 (plain)
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
@title = 'Development'
@summary = "Getting started with making changes to the LEAP platform"

Installing leap_cli
------------------------------------------------

### From gem, for a single user

Install the latest:

    gem install leap_cli --install-dir ~/leap
    export PATH=$PATH:~/leap/bin

Install a particular version:

    gem install leap_cli --version 1.8 --install-dir ~/leap
    export PATH=$PATH:~/leap/bin

### From gem, system wide

Install the latest:

    sudo gem install leap_cli

Install a particular version:

    sudo gem install leap_cli --version 1.8

### As a gem, built from source

    sudo apt-get install ruby ruby-dev rake
    git clone https://leap.se/git/leap_cli.git
    cd leap_cli
    git checkout develop
    rake build
    sudo rake install

### The "develop" branch from source, for a single user

    sudo apt-get install ruby ruby-dev rake
    git clone https://leap.se/git/leap_cli.git
    cd leap_cli
    git checkout develop

Then do one of the following to be able to run `leap` command:

    cd leap_cli
    export PATH=$PATH:`pwd`/bin
    alias leap="`pwd`/bin/leap"
    ln -s `pwd`/bin/leap ~/bin/leap

In practice, of course, you would put aliases or PATH modifications in a shell startup file.

You can also clone from https://github.com/leap/leap_cli

Running different leap_cli versions
---------------------------------------------

### If installed as a gem

With rubygems, you can always specify the gem version as the first argument to any executable installed by rubygems. For example:

    sudo gem install leap_cli --version 1.7.2
    sudo gem install leap_cli --version 1.8
    leap _1.7.2_ --version
    => leap 1.7.2, ruby 2.1.2
    leap _1.8_ --version
    => leap 1.8, ruby 2.1.2

### If running from source

Alternately, if you are running from source, you can alias different commands:

    git clone https://leap.se/git/leap_cli.git
    cd leap_cli
    git checkout develop
    alias leap_develop="`pwd`/bin/leap`