tool/jarvis

Just A Rather Very Intelligent System

1.0.25 2022-06-04 13:49 UTC

README

sudo apt update

Next, install a few prerequisite packages which let apt use packages over HTTPS:

sudo apt install apt-transport-https ca-certificates curl software-properties-common

Then add the GPG key for the official Docker repository to your system:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Next, update the package database with the Docker packages from the newly added repo:

sudo apt update

Finally, install Docker:

sudo apt install docker-ce

Executing the Docker Command Without Sudo (Optional)

If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group:

sudo usermod -aG docker ${USER}

To apply the new group membership, log out of the server and back in, or type the following:

su - ${USER}

Confirm that your user is now added to the docker group by typing:

id -nG
Output:
user sudo docker

Installing Docker Compose

We’ll check the current release and if necessary, update it in the command below:

sudo curl -L https://github.com/docker/compose/releases/download/v2.4.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

Next we’ll set the permissions:

sudo chmod +x /usr/local/bin/docker-compose

Then we’ll verify that the installation was successful by checking the version:

docker-compose --version
Output:
Docker Compose version v2.4.0

Git configuration

In project dir (~/devel/jarvis/) create file ./docker/git/gitconfig and put the info below (indicate your email and name in latin letters):

[user]
	email = stefan@mail.md
	name = Stefan cel Mare

Run docker composer

docker-compose up -d

Run project update

in docker composer:

composer install

outside docker composer:

docker-compose exec app composer install

You can add aliases for current user (Optional)

In ~/.bash_aliases add line:

alias jarvis-docker-up="cd ~/devel/jarvis/ && bin/dcm-up"
alias jarvis-docker-ssh="cd ~/devel/jarvis/ && bin/app-ssh"

Deploy new phar version

  • Add the necessary changes to the project
  • Git commit and push new changes
  • See current tag version:

    git describe --abbrev=0
    
  • Create new git tag (increase prevision version with 1):

    git tag -a 1.0.2 -m 'version 1.0.2'
    
  • Push new git tag to origin:

    git push origin --tags
    
  • Deploy phar to server:

    bin/project-deploy