Skip to content

Commit 4042ffe

Browse files
authored
Hello Linting (#31)
* build: add super linter * docs: add badge to readme for linter * fix: bash linting fixes * build: add linter configuration flags * fix: markdown linting fixes * fix: dockerfile linting fixes * fix: lint docker-compose files * fix: move linter configs to proper location * fix: correct linting warning * fix: adapt linters * style: correct linting errors in Dockerfile * style: correct linting errors in markdown files * fix: ignore 4006 rule (docker-compose lint) * style: continued markdown fixes * style: continued markdown fixes
1 parent a1c3020 commit 4042ffe

File tree

15 files changed

+204
-163
lines changed

15 files changed

+204
-163
lines changed

.github/linters/.hadolint.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ignored:
2+
- DL3022
3+
- DL3008
4+
- DL3059
5+
- DL4006

.github/linters/.markdown-lint.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Hard wrap to 120, not 80
2+
MD013:
3+
line_length: 120
4+
5+
# Allow no new lines between h1 tags (Changelog)
6+
MD022: false
7+
8+
# Allow multiple h1 tags (Changelog)
9+
MD025: false
10+
11+
# Allow no new lines between lists (Changelog)
12+
MD032: false

.github/workflows/linter.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Lint Code Base
3+
on: push
4+
5+
jobs:
6+
build:
7+
name: Lint Code Base
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Code
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Lint Code Base
16+
uses: github/super-linter/slim@v4
17+
env:
18+
VALIDATE_ALL_CODEBASE: true
19+
DEFAULT_BRANCH: master
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# v1.3.0 (November 9, 2020)
2-
* Retire non `st-internal` network names (not yet removed).
3-
* Remove outdated python and upsource documentation.
4-
* Move yii2-shell docs into /docs
5-
* Add `./scripts/db_migrate` for moving databases between versions of database.
6-
* Update docker templates for latest php74 packages/versions.
2+
* Retire non `st-internal` network names (not yet removed).
3+
* Remove outdated python and upsource documentation.
4+
* Move yii2-shell docs into /docs
5+
* Add `./scripts/db_migrate` for moving databases between versions of database.
6+
* Update docker templates for latest php74 packages/versions.
77

88
# v1.2.1 (June 9, 2020)
9-
* Added PostgreSQL v9.4
9+
* Added PostgreSQL v9.4
1010

1111
# v1.2.0 (March 6, 2020)
12-
* Removed mysql56
13-
* Deprecated networks that aren't "st-internal"
14-
* Added MariaDB10.3
15-
* Added MariaDB10.4
16-
* Added optional phpMyAdmin
12+
* Removed mysql56
13+
* Deprecated networks that aren't "st-internal"
14+
* Added MariaDB10.3
15+
* Added MariaDB10.4
16+
* Added optional phpMyAdmin
1717

1818
# v1.1.1 (August 16, 2019)
19-
* Removed d4m guide.
20-
* Updated Laravel docker container to Node10 (previously Node8)
21-
* Updated Yii2/Laravel scripts to leverage "st-internal" network
22-
* Removed all unchanged php.ini files for both Yii2/Laravel
19+
* Removed d4m guide.
20+
* Updated Laravel docker container to Node10 (previously Node8)
21+
* Updated Yii2/Laravel scripts to leverage "st-internal" network
22+
* Removed all unchanged php.ini files for both Yii2/Laravel
2323

2424
# v1.1.0 (Oct 1, 2018)
25-
* [Breaking] Removed MariaDB10.1
26-
* Added MariaDB10.2
25+
* [Breaking] Removed MariaDB10.1
26+
* Added MariaDB10.2
2727

2828
# v1.0.0 (July 5, 2018)
29-
* Initial release
29+
* Initial release

DOCKER_TIPS.md

+26-22
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
1+
# Docker Tips
2+
13
## Typical Docker Commands
2-
### Start all environments services
3-
> docker-compose up --build
44

5-
### Restart a specific container
6-
> docker restart [service name]
5+
```bash
6+
# Start all environments services
7+
docker-compose up --build
78

8-
### List all containers
9-
> docker ps -a
9+
# Restart a specific container
10+
docker restart [service name]
1011

11-
### List running containers
12-
> docker ps
12+
# List all containers
13+
docker ps -a
1314

14-
### See used space
15-
> docker system df
15+
# List running containers
16+
docker ps
1617

17-
### Remove un-used data
18-
> docker system prune
18+
# See used space
19+
docker system df
1920

20-
## Passwords
21-
### PostgreSQL
22-
> username: postgres_user
23-
> password: postgres_pass
21+
# Remove un-used data
22+
docker system prune
23+
```
2424

25-
### MariaDB
26-
> username: mariadb_user
27-
> password: mariadb_pass
25+
## Passwords
2826

27+
* PostgreSQL
28+
* `username: postgres_user`
29+
* `password: postgres_pass`
30+
* MariaDB
31+
* `username: mariadb_user`
32+
* `password: mariadb_pass`
2933

30-
## Running Xdebug with PHPStorm alongside Docker.
34+
## Running Xdebug with PHPStorm alongside Docker
3135
From Docker versions 18.03 and above, Docker creates a special DNS name that resolves
3236
to the internal IP address used by the host.
3337

34-
Old logic (that has not updated to special DNS name) will need to point to the IP of `10.254.254.254`.
38+
* Old logic (that has not updated to special DNS name) will need to point to the IP of `10.254.254.254`.
3539

36-
```
40+
```bash
3741
sudo ifconfig lo0 alias 10.254.254.254
3842
```

README.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Sourcetoad Internal Development Tools (SIDT)
22

3+
[![GitHub Super-Linter](https://github.com/sourcetoad/DevopsToolKit/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
4+
35
Sourcetoad Internal Development Tools includes a growing collection of tutorials
46
for managing IDEs, hooking up tools with Docker and any combination of those
57
things.
@@ -25,9 +27,9 @@ cd ./devop-tools/docker/data-source-services && docker-compose up --build -d
2527
```
2628

2729
#### Specific Setup - Windows
28-
* Kill, and optionally disable, the `World Wide Web Publishing Service`
29-
* Run `set COMPOSE_CONVERT_WINDOWS_PATHS=1` in your CMD or PowerShell terminal
30-
* Optionally, [read](https://github.com/docker/compose/issues/4303#issuecomment-379563170) this bug report.
30+
* Kill, and optionally disable, the `World Wide Web Publishing Service`
31+
* Run `set COMPOSE_CONVERT_WINDOWS_PATHS=1` in your CMD or PowerShell terminal
32+
* Optionally, [read](https://github.com/docker/compose/issues/4303#issuecomment-379563170) this bug report.
3133

3234
### Optional: Data Source Tools
3335
* Optionally included is the following tools:
@@ -36,11 +38,11 @@ cd ./devop-tools/docker/data-source-services && docker-compose up --build -d
3638

3739
## phpMyAdmin
3840
If the optional tools are launched, you can find phpMyAdmin at: localhost:8080
39-
* It supports the following databases...
40-
* mariadb102 (deprecated)
41-
* mariadb103
42-
* mariadb104
43-
* mariadb105
41+
* It supports the following databases...
42+
* mariadb102 (deprecated)
43+
* mariadb103
44+
* mariadb104
45+
* mariadb105
4446

4547
## Examples
4648
Inside the `examples` folder you will find example Docker configurations for
@@ -52,9 +54,9 @@ already added to the `/etc/hosts` file. You can edit to add `127.0.0.1 domain.do
5254
## Scripts
5355
Inside the `scripts` folder you will find one-off scripts to help with tasks.
5456

55-
* `db_migrate.sh` - Helps migrate databases between versions of mysql.
57+
* `db_migrate.sh` - Helps migrate databases between versions of mysql.
5658

5759
## Docs
58-
* [Setting up Nginx-Proxy](docs/nginx-proxy/README.md)
59-
* [Setting up PHP Testing in PHPStorm](docs/phpstorm-docker/README.md)
60-
* [Leveraging Yii2 Shell](docs/yii2/yii-shell.md)
60+
* [Setting up Nginx-Proxy](docs/nginx-proxy/README.md)
61+
* [Setting up PHP Testing in PHPStorm](docs/phpstorm-docker/README.md)
62+
* [Leveraging Yii2 Shell](docs/yii2/yii-shell.md)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
echo "Creating container networks:\n"
1+
#!/usr/bin/env bash
2+
echo "Creating container networks:"
23
docker network create st-internal

docs/nginx-proxy/README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
11
# nginx-proxy
22

3-
The data source services includes an application called nginx-proxy. This allows you to run multiple projects at the same time on different virtual hosts without port conflicts. You do not need to expose the webserver to the host machine through a port map.
3+
The data source services includes an application called nginx-proxy. This allows you to run multiple projects at the
4+
same time on different virtual hosts without port conflicts. You do not need to expose the webserver to the host machine
5+
through a port map.
46

57
In order for nginx-proxy to operate, you must follow the following steps.
68

79
## Setup hosts file
8-
1. Choose a virtual host for your project. RFC-6761 recommends against using a .dev TLD, and instead using a .localhost TLD. Therefore, your domain might be mysite.localhost
9-
2. Edit your hosts file and add this domain to your loopback address (127.0.0.1) using your preferred text editor. *make sure to use sudo*
10-
```
10+
1. Choose a virtual host for your project. RFC-6761 recommends against using a .dev TLD, and instead using a .localhost
11+
TLD. Therefore, your domain might be mysite.localhost
12+
2. Edit your hosts file and add this domain to your loopback address (127.0.0.1) using your preferred text editor.
13+
14+
```bash
1115
sudo nano /etc/hosts
1216

13-
add:
1417
127.0.0.1 mysite.localhost
1518
```
1619

1720
## Setup docker-compose for project
18-
1. In order for nginx-proxy to detect and proxy to the correct virtual host, you must first identify the container that is running the "web server." In a php project, this would be the nginx container, for example.
19-
2. You will then add an environment variable of `VIRTUAL_HOST=mysite.localhost` to this service, place that service on the nginx-proxy network, and import that nginx-proxy network to the project. See the below snippet:
21+
1. In order for nginx-proxy to detect and proxy to the correct virtual host, you must first identify the container that
22+
is running the "web server." In a php project, this would be the nginx container, for example.
23+
2. You will then add an environment variable of `VIRTUAL_HOST=mysite.localhost` to this service, place that service on
24+
the nginx-proxy network, and import that nginx-proxy network to the project. See the below snippet:
2025

21-
```
26+
```bash
2227
version: '2'
2328
services:
2429
[APP_NAME]_nginx:
2530
image: nginx:latest
2631
environment:
2732
- VIRTUAL_HOST=mysite.localhost
28-
```
33+
```

0 commit comments

Comments
 (0)