feat: add a script to build docker dev (#5531)
This commit is contained in:
@@ -54,9 +54,6 @@ jobs:
|
||||
${{ runner.os }}-composer-${{ env.php-version }}
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Install composer dependencies
|
||||
run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
|
||||
|
||||
# Yarn
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
@@ -74,17 +71,9 @@ jobs:
|
||||
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install yarn dependencies
|
||||
run: yarn inst
|
||||
- name: Build assets
|
||||
run: yarn run production
|
||||
|
||||
# Complete setup
|
||||
- name: Version files
|
||||
run: |
|
||||
git describe --abbrev=0 --tags | sed 's/^v//' > config/.version
|
||||
git describe --abbrev=0 --tags --exact-match $GITHUB_SHA 2>/dev/null || git log --pretty="%h" -n1 $GITHUB_SHA > config/.release
|
||||
echo $GITHUB_SHA > config/.commit
|
||||
# Install
|
||||
- name: Install
|
||||
run: scripts/docker/build.sh --skip-build $GITHUB_SHA
|
||||
|
||||
# Build docker
|
||||
- name: Docker build
|
||||
|
||||
@@ -14,7 +14,6 @@ use Psr\Http\Message\ResponseInterface;
|
||||
use GuzzleHttp\Promise\PromiseInterface;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use Sabre\CardDAV\Plugin as CardDAVPlugin;
|
||||
use App\Services\DavClient\Utils\Traits\ServiceUrlQuery;
|
||||
|
||||
class DavClient
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\DavClient\Utils\Traits;
|
||||
namespace App\Services\DavClient\Utils\Dav;
|
||||
|
||||
use GuzzleHttp\Psr7\Uri;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
@@ -24,15 +24,22 @@ your Monica container.
|
||||
If you aren't using docker-compose, edit `.env` again to set the `DB_*` variables to match your database. Then run:
|
||||
|
||||
```sh
|
||||
# assets are copied from the host machine, make sure they are built
|
||||
yarn install && yarn run production
|
||||
scripts/docker/build.sh
|
||||
```
|
||||
|
||||
docker build -t monicahq/monicahq -f scripts/docker/Dockerfile .
|
||||
You can add the tag name as a parameter:
|
||||
```sh
|
||||
scripts/docker/build.sh monica-dev
|
||||
```
|
||||
|
||||
docker run --env-file .env -p 80:80 monicahq/monicahq # to run MonicaHQ
|
||||
Run monica with:
|
||||
```sh
|
||||
docker run --env-file .env -p 80:80 monica-dev
|
||||
```
|
||||
|
||||
# ...or...
|
||||
docker run --env-file .env -it monicahq/monicahq sh # to get a prompt
|
||||
Or run a command in the container:
|
||||
```sh
|
||||
docker run --env-file .env -it monica-dev bash
|
||||
```
|
||||
|
||||
There's a bunch of [docker-compose examples here.](https://github.com/monicahq/docker/tree/master/.examples)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set -eo pipefail
|
||||
|
||||
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P)
|
||||
source $SELF_PATH/realpath.sh
|
||||
source $SELF_PATH/../realpath.sh
|
||||
ROOT=$(realpath $SELF_PATH/../..)
|
||||
|
||||
version=$1
|
||||
|
||||
Executable
+50
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P)
|
||||
source $SELF_PATH/../realpath.sh
|
||||
ROOT=$(realpath $SELF_PATH/../..)
|
||||
|
||||
version=$(git --git-dir $ROOT/.git describe --abbrev=0 --tags | sed 's/^v//')
|
||||
|
||||
commit=$1
|
||||
if [ "$commit" == "--skip-build" ]; then
|
||||
shift
|
||||
tag=$commit
|
||||
commit=$1
|
||||
fi
|
||||
|
||||
if [ -z "$commit" ]; then
|
||||
commit=$(git --git-dir $ROOT/.git log --pretty="%H" -n1 HEAD)
|
||||
release=$(git --git-dir $ROOT/.git log --pretty="%h" -n1 HEAD)
|
||||
else
|
||||
shift
|
||||
release=$(git --git-dir $ROOT/.git describe --abbrev=0 --tags --exact-match $commit 2>/dev/null || git --git-dir $ROOT/.git log --pretty="%h" -n1 $commit)
|
||||
fi
|
||||
|
||||
if [ -z "$tag" ]; then
|
||||
tag=${1:-monica-dev}
|
||||
fi
|
||||
|
||||
echo Version
|
||||
echo -n "$version" | tee config/.version
|
||||
|
||||
echo -e "\nCommit"
|
||||
echo -n "$commit" | tee config/.commit
|
||||
|
||||
echo -e "\nRelease"
|
||||
echo -n "$release" | tee config/.release
|
||||
|
||||
echo -e "\n"
|
||||
|
||||
# BUILD
|
||||
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader --no-dev --working-dir=$ROOT
|
||||
yarn --cwd $ROOT run inst
|
||||
yarn --cwd $ROOT run production
|
||||
|
||||
# DOCKER BUILD
|
||||
if [ "$tag" != "--skip-build" ]; then
|
||||
docker build -t $tag -f $SELF_PATH/Dockerfile $ROOT
|
||||
rm -f config/.{version,commit,release}
|
||||
fi
|
||||
@@ -3,7 +3,7 @@
|
||||
set -evuo pipefail
|
||||
|
||||
SELF_PATH=$(cd -P -- "$(dirname -- "$0")" && /bin/pwd -P)
|
||||
source $SELF_PATH/../ci/realpath.sh
|
||||
source $SELF_PATH/../realpath.sh
|
||||
ROOT=$(realpath $SELF_PATH/../..)
|
||||
|
||||
if [ -z "${DISPLAY:-}" ]; then
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Services\DavClient\Utils;
|
||||
namespace Tests\Unit\Services\DavClient\Utils\Dav;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Tests\Helpers\DavTester;
|
||||
|
||||
Reference in New Issue
Block a user