Server-Schulung-Teil11-Übung mit git:Openki

From revampedia
Jump to: navigation, search

Preface

This training session took place on 06-22-17. First we received an explanation of what we did do in the assignment, as not everybody knew what was done. Then we started with the installation of Openki to install another example with git.

If there are still questions open after these instructions, please go to "Views" and then "Discussion" to leave your feedback, so I can add more Details to this page. jr


search for Openki in github

First we open github.com in the browser and search for Openki. The first link should get us to this page.
In the tab "<> Code" we can have a look at full code of the program. So the code is for everybody to see and if they have the knowledge modify it for their own need.
The tab "Issues" can be used to report errors or feedback to the developers.

For the installation instructions you need to scroll far down on the page or look at README.md.

Installation on the server

First we make a clone of Openki on our system with git:

user1@vm1:/var/www/git$ sudo git clone https://github.com/Openki/Openki.git

As we had to work with root privileges to create the clone everything belongs to root. But we want to change the owner to wwww-data:

user1@vm1:/var/www/git$ sudo chown -R www-data:www-data Openki/

Now we change into the folder of Openki:

user1@vm1:/var/www/git$ cd Openki

Even if it was listed first in the instructions, we can also do this step now:

user1@vm1:/var/www/git/Openki$ curl https://install.meteor.com | sh

If you receive an error message because the program curl is missing you need to update the list of available packages with "sudo apt update". With "sudo apt upgrade" you can install available updates and with "sudo apt install curl" you can install the missing curl-package.
In case you had to install curl, you need to run the curl-command again to install meteor.

The next command in the instructions is the following:

user1@vm1:/var/www/git/Openki$ sudo meteor npm install

Unfortunately this produces an error (sh: 1: node-gyp: Permission denied) for me that isn't easily fixed. So, we'll have to continue the installation at some other point.


Repetition of some git commands

git status

If you have created serveral branches, you can see with this command in what branch you are currently. To install updates you should be in the "master branch".

user1@vm1:/var/www/git/Openki$ git status
Auf Branch master
Ihr Branch ist auf dem selben Stand wie 'origin/master'.
nichts zu committen, Arbeitsverzeichnis unverändert

git tag

With the help of git tag you can see what versions of the program are available.

user1@vm1:/var/www/git/Openki$ git tag
v0.4.0-alpha
v0.4.1-alpha
v0.4.2-alpha
v0.4.3-alpha
v0.4.4-alpha
v0.5.0-alpha
v0.5.0-beta
v0.5.1-beta
v0.6.0-beta

git checkout

With git checkout you can install the desired version of the program. The xxx a little further down stands for the desired releasse that we were able to get with the git tag earlier.

git checkout xxx

Assignment for next time

The assignment is to upgrade the server and the virtual machine from Debian Jessie to Debian Stretch.

If you wish to find the solution by yourself you can leave the text hidden. Otherwisse click to expand it.

The solution:

cd /etc/apt/ sudo cp sources.list sources.list.jessie
The entries of "jessie" need to be replaced by "stretch". Here I found the sed-command to do this, so you don't have to manually replace all entries.
sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
alternative: sudo nano sources.list and replace the entries manually
sudo apt update
sudo apt dist-upgrade

,