Skip to content

Commit

Permalink
workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Code-Egg committed Mar 8, 2021
1 parent e6cfcca commit f0a85ad
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TimeZone=America/New_York
OLS_VERSION=1.6.15
OLS_VERSION=1.6.20
PHP_VERSION=lsphp74
MYSQL_DATABASE=wordpress
MYSQL_ROOT_PASSWORD=password
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: docker-build

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup
run: |
docker-compose -v
docker-compose up -d
docker image ls
sleep 10
- name: Verify
run: bash .travis/verify.sh
- name: Clean up
run: |
docker-compose stop
docker-compose rm -f
File renamed without changes.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 - 2020 Litespeedtech
Copyright (c) 2019 - 2022 Litespeedtech

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OpenLiteSpeed WordPress Docker Container
[![Build Status](https://travis-ci.com/litespeedtech/ols-docker-env.svg?branch=master)](https://hub.docker.com/r/litespeedtech/openlitespeed)
[![Build Status](https://github.com/litespeedtech/ols-docker-env/workflows/docker-build/badge.svg)](https://github.com/litespeedtech/ols-docker-env/actions/)
[![docker pulls](https://img.shields.io/docker/pulls/litespeedtech/openlitespeed?style=flat&color=blue)](https://hub.docker.com/r/litespeedtech/openlitespeed)
[<img src="https://img.shields.io/badge/slack-LiteSpeed-blue.svg?logo=slack">](litespeedtech.com/slack)
[<img src="https://img.shields.io/twitter/follow/litespeedtech.svg?label=Follow&style=social">](https://twitter.com/litespeedtech)
Expand Down Expand Up @@ -33,7 +33,7 @@ The docker image installs the following packages on your system:
| :-------------: | :-------------: |
|Linux|Ubuntu 18.04|
|OpenLiteSpeed|[Latest version](https://openlitespeed.org/downloads/)|
|MariaDB|[Stable version: 10.3](https://hub.docker.com/_/mariadb)|
|MariaDB|[Stable version: 10.5](https://hub.docker.com/_/mariadb)|
|PHP|[Latest version](http://rpms.litespeedtech.com/debian/)|
|LiteSpeed Cache|[Latest from WordPress.org](https://wordpress.org/plugins/litespeed-cache/)|
|ACME|[Latest from ACME official](https://github.com/acmesh-official/get.acme.sh)|
Expand Down
6 changes: 3 additions & 3 deletions bin/database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,23 @@ EOT
}

check_db_access(){
docker-compose exec mysql su -c "mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e 'status'" >/dev/null 2>&1
docker-compose exec -T mysql su -c "mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e 'status'" >/dev/null 2>&1
if [ ${?} != 0 ]; then
echo '[X] DB access failed, please check!'
exit 1
fi
}

check_db_exist(){
docker-compose exec mysql su -c "test -e /var/lib/mysql/${1}"
docker-compose exec -T mysql su -c "test -e /var/lib/mysql/${1}"
if [ ${?} = 0 ]; then
echo "Database ${1} already exist, skip DB creation!"
exit 0
fi
}

db_setup(){
docker-compose exec mysql su -c 'mysql -uroot -p${MYSQL_ROOT_PASSWORD} \
docker-compose exec -T mysql su -c 'mysql -uroot -p${MYSQL_ROOT_PASSWORD} \
-e "CREATE DATABASE '${SQL_DB}';" \
-e "GRANT ALL PRIVILEGES ON '${SQL_DB}'.* TO '${SQL_USER}'@'${ANY}' IDENTIFIED BY '${SQL_PASS}';" \
-e "FLUSH PRIVILEGES;"'
Expand Down
2 changes: 1 addition & 1 deletion bin/demosite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ EOT
}

app_download(){
docker-compose exec ${CONT_NAME} su -c "appinstallctl.sh --app ${1} --domain ${2}"
docker-compose exec -T ${CONT_NAME} su -c "appinstallctl.sh --app ${1} --domain ${2}"
}

lsws_restart(){
Expand Down
2 changes: 1 addition & 1 deletion bin/webadmin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ check_input(){
}

lsws_restart(){
docker-compose exec ${CONT_NAME} su -c '/usr/local/lsws/bin/lswsctrl restart >/dev/null'
docker-compose exec -T ${CONT_NAME} su -c '/usr/local/lsws/bin/lswsctrl restart >/dev/null'
}

apply_serial(){
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
mysql:
image: mariadb:10.3.17
image: mariadb:10.5.9
command: --max_allowed_packet=256M
volumes:
- "./data/db:/var/lib/mysql:delegated"
Expand Down Expand Up @@ -33,7 +33,6 @@ services:
environment:
TZ: ${TimeZone}
phpmyadmin:
#image: bitnami/phpmyadmin:latest
image: bitnami/phpmyadmin:5.0.2-debian-10-r72
ports:
- 8080:80
Expand Down

0 comments on commit f0a85ad

Please sign in to comment.