Update: Create build script

This commit is contained in:
Luca 2022-12-15 23:15:56 +01:00
parent 982be676d5
commit 16576bf561
4 changed files with 23 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.env
inc/public
inc/resources
inc/.hugo_build.lock

14
build.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
source .env
[ -z $PUBLIC_URL ] && PUBLIC_URL="https://example.com"
echo "Bulding public site: "$PUBLIC_URL
cd inc
git submodule update --init
cd ..
docker-compose build
docker-compose run hugo build -b $PUBLIC_URL

View File

@ -4,10 +4,10 @@ services:
build:
context: .
args:
- HUGO_HOST=docker
- HUGO_PORT=1313
- HUGO_HOST=${HUGO_HOST}
- HUGO_PORT=${HUGO_PORT}
ports:
- 1313:1313
user: 1000:1000
- ${HUGO_PORT}:1313
user: ${USER_GROUP}
volumes:
- ./inc:/app

4
env.sample Normal file
View File

@ -0,0 +1,4 @@
PUBLIC_URL=http://example.com
HUGO_HOST=docker
HUGO_PORT=1313
USER_GROUP=1000:1000