Skip to content

Commit 4a3ab7a

Browse files
authored
Merge pull request #13 from joglomedia/linux
Refactoring EasyDock Linux v2.x.x
2 parents 7e19ea8 + 67a4446 commit 4a3ab7a

File tree

10 files changed

+97
-88
lines changed

10 files changed

+97
-88
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: [joglomedia, andreapollastri]
2+
custom: ['https://www.paypal.me/masedi']

.github/workflows/main.yml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,44 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: easydock-linux
4-
5-
# Controls when the workflow will run
62
on:
7-
# Triggers the workflow on push or pull request events but only for the master branch
83
push:
94
branches:
105
- linux
116
- master
127
pull_request:
138
branches:
149
- master
15-
16-
# Allows you to run this workflow manually from the Actions tab
1710
workflow_dispatch:
18-
19-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
2011
jobs:
21-
# This workflow contains a single job called "build"
2212
build:
23-
# The type of runner that the job will run on
2413
runs-on: ubuntu-latest
25-
26-
# Steps represent a sequence of tasks that will be executed as part of the job
2714
steps:
28-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2915
- uses: actions/checkout@v2
30-
3116
- uses: php-actions/composer@v5
32-
3317
# Runs composer install Laravel for testing
34-
- name: Run composer install Laravel
18+
- name: Composer install Laravel
3519
run: composer create-project laravel/laravel test-app
36-
3720
# Prepare Laravel sample application
38-
#- name: Prepare Laravel application
21+
#- name: Prepare Laravel Application
3922
# run: |
4023
# cd test-app
4124
# php artisan key:generate
42-
43-
# Install test dependencies
44-
- name: Run install testing dependencies
25+
# Install testing dependencies
26+
- name: Install Testing Dependencies
4527
run: |
4628
sudo apt-get update -qq -y
4729
sudo apt-get install -qq -y bash shellcheck
48-
49-
# Shellcheck
50-
- name: Run shellcheck testing
51-
run: shellcheck -s bash -x ./src/easydock
52-
30+
# Shellcheck Tests
31+
- name: Run Shellcheck Testing
32+
run: shellcheck -s bash -x ./bin/easydock
5333
# Simple unit testing
54-
- name: Run unit testing
34+
- name: Run Unit Testing
5535
run: |
5636
cd test-app
57-
bash ../src/easydock init
37+
bash ../bin/easydock init
5838
if [ -f .env.easydock ]; then
5939
echo "Init EasyDock success"
60-
bash ../src/easydock build
61-
bash ../src/easydock up
40+
bash ../bin/easydock build
41+
bash ../bin/easydock up
6242
else
6343
echo "Init EasyDock fail"
6444
exit 1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.env
2-
composer.lock
2+
Makefile
3+
releases
34
vendor
45
src/docker-compose.yml~
56
src/Dockerfile~

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The MIT License (MIT)
22

33
Copyright (c) 2020 Andrea Pollastri
4-
2021 Edi Septriyanto
4+
Copyright (c) 2021 Edi Septriyanto
55

66
> Permission is hereby granted, free of charge, to any person obtaining a copy
77
> of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,40 @@
66

77
<p align="center">
88
<a href="https://github.com/joglomedia/easydock-linux/releases"><img src="https://img.shields.io/github/v/tag/joglomedia/easydock-linux?label=version" alt="EasyDock Linux version"></a>
9+
<a href="https://github.com/joglomedia/easydock-linux/stargazers"><img src="https://img.shields.io/github/stars/joglomedia/easydock-linux.svg" alt="GitHub stars"></a>
910
<a href="https://github.com/joglomedia/easydock-linux/network"><img src="https://img.shields.io/github/forks/joglomedia/easydock-linux.svg" alt="GitHub forks"></a>
1011
<a href="https://github.com/joglomedia/easydock-linux/issues"><img src="https://img.shields.io/github/issues/joglomedia/easydock-linux.svg" alt="GitHub issues"></a>
11-
<a href="https://github.com/joglomedia/easydock-linux/stargazers"><img src="https://img.shields.io/github/stars/joglomedia/easydock-linux.svg" alt="GitHub stars"></a>
1212
<a href="https://github.com/joglomedia/easydock-linux/actions/workflows/main.yml"><img src="https://github.com/joglomedia/easydock-linux/actions/workflows/main.yml/badge.svg" alt="GitHub CI"></a>
1313
<a href="https://raw.githubusercontent.com/joglomedia/easydock-linux/master/LICENSE.md"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="GitHub license"></a>
1414
</p>
1515

1616
<p align="center">
17-
A fork of EasyDock for Linux. Docker LEMP stack easy integration.
17+
A fork of EasyDock to work in Linux. Docker LEMP stack easy integration.
1818
Dockerize your PHP apps ;)
1919
</p>
2020

2121
## Features
2222

2323
EasyDock Linux comes with:
2424

25-
- Nginx
25+
- Nginx (Latest stable)
2626
- PHP (7.4 and 8.0)
2727
- MariaDB (Drop-in replacement for MySQL)
28-
- PostgreSQL
29-
- Redis
28+
- PostgreSQL (Alternative SQL database)
29+
- Redis (In-memory key-value data store)
3030
- ~~phpmyadmin~~ Adminer (Lightweight MySQL admin)
31-
- MailHog
32-
- Node.js, NPM & Yarn
33-
- Git
34-
- Composer
31+
- MailHog (An email testing tool)
32+
- Node.js, NPM & Yarn (Front-end development tool)
33+
- Git (Version control system)
34+
- Composer (PHP application package manager)
3535

3636
## Requirements
3737

38-
Docker and Docker Compose installed on Linux Distro (Debian or Ubuntu).
38+
Docker and Docker Compose installed on Linux Distro (Tested on Debian, Ubuntu, and LinuxMint).
3939

4040
## Installation
4141

42-
- Integrate easydock in your PHP app via Composer.
42+
- Integrate EasyDock Linux in your PHP application via Composer.
4343
- You should add your Composer's vendor bin directory to your environment path.
4444

4545
```bash
@@ -52,13 +52,13 @@ easydock init && easydock import
5252

5353
## Getting Started
5454

55-
After installation completed, if required, you could configure your `.env.easydock` file and then run this build command:
55+
Once you have installed EasyDock Linux successfully, if required, you could configure your `.env.easydock` file and then run this build command:
5656

5757
```bash
5858
easydock build
5959
```
6060

61-
During the build process EasyDock will download required Docker images. Once the build completes, you could _kick-up_ your EasyDock application by executing:
61+
During the build process, EasyDock Linux will download required Docker images. After the build completes, you could _kick-up_ your EasyDock Linux application by executing:
6262

6363
```bash
6464
easydock up
@@ -69,7 +69,7 @@ easydock up
6969
- The default Nginx server configuration `app.conf` will expose your project `/public` directory.
7070
- If your project uses different directory structure, you should adjust the configuration in `app.conf` file accordingly.
7171
- Your application by default accessible through localhost on port 8008 (`http://localhost:8008`)
72-
- Currently EasyDock-Linux only support stable PHP version; 7.4 & 8.0 from `joglomedia/easydock-php` image.
72+
- Currently, EasyDock Linux only supports stable PHP version: 7.4 & 8.0 from `joglomedia/easydock-php` image.
7373

7474
The Nginx public port and PHP version could be configured inside `.env.easydock` file.
7575

@@ -98,7 +98,7 @@ Database: easydockdb
9898
Username: easydock
9999
Password: secret
100100
Root password: rootsecret
101-
Host name: mysql ( or postgres for PostgreSQL )
101+
Host name: mysql ( or pgsql for PostgreSQL )
102102
```
103103

104104
For security reason, you should change the default database username and password configured in `.env.easydock` file.
@@ -120,7 +120,7 @@ DB_ROOT_PASS=rootsecret
120120
MYSQL_PORT=3306
121121

122122
# POSTGRESQL PORT
123-
POSTGRES_PORT=5432
123+
PGSQL_PORT=5432
124124
```
125125

126126
### Configure SMTP connection
@@ -234,4 +234,4 @@ You can support us using any of the methods below:
234234

235235
EasyDock Linux is open-source project licensed under the MIT license.
236236

237-
### Enjoy easydock ;)
237+
## Enjoy EasyDock for Linux ;)

src/easydock renamed to bin/easydock

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
# | Authors : Edi Septriyanto <me@masedi.net> |
88
# | Andrea Pollastri <andrea@pollastri.dev> |
99
# | Min. requirement : GNU/Linux Debian 8, Ubuntu 16.04 or Linux Mint 17 |
10-
# | Version : 1.1.0-beta |
11-
# | Last Update : 25/06/2021 |
10+
# | Version : 2.x.x |
11+
# | Last Update : 15/07/2021 |
1212
# +-------------------------------------------------------------------------+
1313
# | EasyDock-Linux Copyright (c) 2021 MasEDI.Net |
1414
# | EasyDock's Logo & Name Copyright (c) Andrea Pollastri |
@@ -25,13 +25,13 @@
2525
set -e
2626

2727
# EasyDock version.
28-
ED_VERSION="1.1.0-beta"
28+
ED_VERSION="2.1.0"
2929

3030
# EasyDock command (to pretify the instruction message).
3131
ED_CMD="bash easydock"
3232

3333
# Sudo required commands.
34-
SUDO_CMDS="import remove reset"
34+
SUDO_CMDS="build import rebuild remove reset"
3535

3636
# EasyDock CLI source directory.
3737
SOURCE="${BASH_SOURCE[0]}"
@@ -293,11 +293,13 @@ function ed_portscheck() {
293293
function ed_help() {
294294
echo -e "${bgpurple}${white}${bold} easydock Options List ${reset}${br}${br}"
295295
echo "${bgwhite}${black} ${ED_CMD} init ${reset}"
296-
echo -e "Initialize easydock system for the first time.${br}"
296+
echo -e "Initialize easydock system for new project.${br}"
297297
echo "${bgwhite}${black} ${ED_CMD} import ${reset}"
298298
echo -e "Import default easydock config (overwrite existing).${br}"
299299
echo "${bgwhite}${black} ${ED_CMD} build ${reset}"
300-
echo -e "Build app container for easydock system.${br}"
300+
echo -e "Build application image for easydock system.${br}"
301+
echo "${bgwhite}${black} ${ED_CMD} rebuild ${reset}"
302+
echo -e "Rebuild application image for easydock system.${br}"
301303
echo "${bgwhite}${black} ${ED_CMD} up ${reset}"
302304
echo -e "Power up easydock system.${br}"
303305
echo "${bgwhite}${black} ${ED_CMD} down ${reset}"
@@ -331,7 +333,7 @@ function ed_info() {
331333
echo -e "Stack: php:${ed_phpver} + mariadb:latest + nginx:latest ${br}"
332334
echo "${bold}MySQL / PostgreSQL${reset}"
333335
echo "MySQL Host: mysql:${ed_portmysql} (int) / 127.0.0.1:${ed_portmysql} (ext)"
334-
echo "PostgreSQL Host: postgres:${ed_portpgsql} (int) / 127.0.0.1:${ed_portpgsql} (ext)"
336+
echo "PostgreSQL Host: pgsql:${ed_portpgsql} (int) / 127.0.0.1:${ed_portpgsql} (ext)"
335337
echo "DB Name: ${ed_dbname}"
336338
echo "Username: ${ed_dbuser}"
337339
echo -e "Password: ${ed_dbpass} ${br}"
@@ -485,77 +487,83 @@ function ed_cli_menu() {
485487
shift
486488
ed_help
487489
exit
488-
;;
490+
;;
489491
info)
490492
shift
491493
ed_info
492494
exit
493-
;;
495+
;;
494496
import)
495497
shift
496498
ed_import
497499
exit
498-
;;
500+
;;
499501
build|setup)
500502
shift
501503
ed_setup
502504
exit
503-
;;
505+
;;
506+
rebuild)
507+
shift
508+
ed_reset
509+
ed_setup
510+
exit
511+
;;
504512
reset)
505513
shift
506514
ed_reset "${action}"
507515
exit
508-
;;
516+
;;
509517
up)
510518
shift
511519
ed_up
512520
exit
513-
;;
521+
;;
514522
down)
515523
shift
516524
ed_down
517525
exit
518-
;;
526+
;;
519527
remove)
520528
shift
521529
ed_remove
522530
exit
523-
;;
531+
;;
524532
start)
525533
shift
526534
ed_start
527535
exit
528-
;;
536+
;;
529537
stop)
530538
shift
531539
ed_stop
532540
exit
533-
;;
541+
;;
534542
restart)
535543
shift
536544
ed_restart
537545
exit
538-
;;
546+
;;
539547
ps|status)
540548
shift
541549
ed_status
542550
exit
543-
;;
551+
;;
544552
conn|shell)
545553
shift
546554
ed_shell
547555
exit
548-
;;
556+
;;
549557
sql_shell)
550558
shift
551559
ed_sql_shell
552560
exit
553-
;;
561+
;;
554562
*)
555563
shift
556564
ed_notfound "${menu}"
557565
exit 1
558-
;;
566+
;;
559567
esac
560568
shift
561569
done
@@ -594,7 +602,7 @@ function ed_bootstrap() {
594602

595603
ed_portapp=$(grep APP_PORT .env.easydock | cut -d '=' -f2)
596604
ed_portmysql=$(grep MYSQL_PORT .env.easydock | cut -d '=' -f2)
597-
ed_portpgsql=$(grep POSTGRES_PORT .env.easydock | cut -d '=' -f2)
605+
ed_portpgsql=$(grep PGSQL_PORT .env.easydock | cut -d '=' -f2)
598606
ed_portrds=$(grep REDIS_PORT .env.easydock | cut -d '=' -f2)
599607
ed_portpma=$(grep PMA_PORT .env.easydock | cut -d '=' -f2)
600608
ed_portmh=$(grep MH_PORT .env.easydock | cut -d '=' -f2)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
}
1616
],
1717
"bin": [
18-
"src/easydock"
18+
"bin/easydock"
1919
]
2020
}

composer.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)