Taming Evergreen

Slides available at:
slides.mobiusconsortium.org/blake/evergreen_hack_class

Created by Blake Graham-Henderson / [email protected]

Press ESC to browse slides

Overview

  • Install Evergreen server on your computer
  • Make changes to Evergreen
  • See the changes live
  • Easy!

Installing All Tools on Windows

Slides continue downward

Install Docker Desktop

Download link

After reboot

Give more memory


                                wsl
                                free -h
                                exit
                                notepad $home\.wslconfig
                                [WSL2]
                                memory=24GB
                                # save and exit
                                wsl --shutdown
                          

Install Git bash

Download link

Checkout as-is, Commit as-is

Install Node

Download link

Clone Evergreen repo

From git bash window


                                cd ~
                                git clone git://git.evergreen-ils.org/Evergreen.git
                                cd Evergreen
                                git remote add -f working git://git.evergreen-ils.org/working/Evergreen.git
                                git remote set-url --push working [email protected]:working/Evergreen.git
                          

Allow scripts


                        # From Admin powershell
                        Set-ExecutionPolicy Unrestricted
                        # From standard powershell
                        cd ~/Evergreen/Open-ILS/src/eg2
                        npm ci
                          

Make Angular work


                                # From standard powershell
                                cd $home\Evergreen\Open-ILS\src\eg2
                                npm install -g @angular/cli
                                # test and make sure you can execute ng
                                npx ng build --configuration=production
                          

Pull docker image

From powershell window


                                docker pull mobiusoffice/evergreen-ils:dev
                          

Github Desktop

Optional

Download link

Installing All Tools on Linux

Slides continue downward

Install Docker

Instructions link

                                sudo apt update
                                sudo apt install ca-certificates curl gnupg
                                sudo install -m 0755 -d /etc/apt/keyrings
                                curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
                                sudo chmod a+r /etc/apt/keyrings/docker.gpg
                                echo \
                                  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
                                  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
                                  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
                                  sudo apt update
                                apt-cache policy docker-ce
                                sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
                          

Install Docker Animation

Instructions link

Install git


                                sudo apt install git
                          

Install nodejs


                                sudo apt install nodejs npm
                          

Clone Evergreen repo

From git bash window


                                cd ~
                                git clone git://git.evergreen-ils.org/Evergreen.git
                                cd Evergreen
                                git remote add -f working git://git.evergreen-ils.org/working/Evergreen.git
                                git remote set-url --push working [email protected]:working/Evergreen.git
                          

Make Angular work


                                cd $HOME/Evergreen/Open-ILS/src/eg2
                                npm ci
                                # test and make sure you can execute ng
                                npx ng build --configuration=production
                          

Pull docker image

As root
(because we need to ultimately access port 80, 443)


                                sudo su -
                                docker pull mobiusoffice/evergreen-ils:dev
                          

Installing All Tools on Mac

Slides continue downward

Install Homebrew

Instructions link

                        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
                          

Install Docker

Instructions link
  • Download and install Docker img package
  • Open shell and pull the arm-64 image

                               docker pull mobiusoffice/evergreen-ils:dev-arm64
                          

Install git and clone Evergreen


                                brew install git
                                cd ~
                                git clone git://git.evergreen-ils.org/Evergreen.git
                                cd Evergreen
                                git remote add -f working git://git.evergreen-ils.org/working/Evergreen.git
                                git remote set-url --push working [email protected]:working/Evergreen.git
                          

Make Angular work


                                brew install nodejs npm
                                cd ~/Evergreen/Open-ILS/src/eg2
                                npm ci
                                # test and make sure you can execute ng
                                npx ng build --configuration=production
                          

Now we begin

Start the container

Windows

                        # standard powershell prompt
                        # * Fix "user" to match your username
                        docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 `
                        -p 5433:5432 `
                        -v //c/users/user/Evergreen:/home/opensrf/repos/Evergreen `
                        -h test.evergreen.com mobiusoffice/evergreen-ils:dev
                      
Linux

                            sudo su -
                            docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 \
                            -p 5433:5432 \
                            -v ~/Evergreen:/home/opensrf/repos/Evergreen \
                            -h test.evergreen.com mobiusoffice/evergreen-ils:dev
                      
Mac

                            docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 \
                            -p 5433:5432 \
                            -v ~/Evergreen:/home/opensrf/repos/Evergreen \
                            -h test.evergreen.com mobiusoffice/evergreen-ils:dev-arm64
                      

See that it finishes

Check localhost

http://localhost

Try staff client

http://localhost/eg/staff

Accept the fake certificate

Don't worry if you
receive "File not found"

The Angular components are still building

The container forego's that process to get the container online quicker

Open your code editor

  • db_control.txt
  • eg_rebuild_angular_screenoutput
  • eg_restart_go_screenoutput

(slides continue downwards)

db_control.txt

Three columns, space delimited


                                evergreen standard *
                                evergreen_enhanced enhanced
                          
  1. database name
  2. concerto type (standard/enhanced)
  3. chosen indicator
  • Switch databases: move the asteriks
  • Create new databases by adding a new line

eg_rebuild_angular_screenoutput

Angular build output

  • Rename to "eg_rebuild_angular" if you want to initiate an Angular build
  • The file will turn back into eg_rebuild_angular_screenoutput

THE END

Blake Graham-Henderson

MOBIUS

[email protected]

Slides available at:
slides.mobiusconsortium.org/blake/evergreen_hack_class