prepare deploy
This commit is contained in:
parent
ec46bf2884
commit
c252b8420b
5 changed files with 48 additions and 17 deletions
20
.forgejo/workflows/release.yml
Normal file
20
.forgejo/workflows/release.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
on:
|
||||
release
|
||||
jobs:
|
||||
ls:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: git.php.fail/lubiana/container/php:ci
|
||||
steps:
|
||||
- name: Manually checkout
|
||||
env:
|
||||
REPO: '${{ github.repository }}'
|
||||
TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||
BRANCH: '${{ env.GITHUB_REF_NAME }}'
|
||||
GIT_SERVER: 'hannover.ccc.de/gitlab'
|
||||
run: |
|
||||
git clone --branch $GITHUB_REF_NAME https://${TOKEN}@${GIT_SERVER}/${REPO}.git .
|
||||
git fetch
|
||||
git checkout ${{ github.head_ref }}
|
||||
- name: list
|
||||
run: ls
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -20,4 +20,5 @@
|
|||
###< phpunit/phpunit ###
|
||||
|
||||
.idea/
|
||||
/deploy/temp-deploy/
|
||||
/deploy/futtern-app/
|
||||
/deploy/var/
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
:8087 {
|
||||
log
|
||||
root * /var/www/html/public
|
||||
php_fastcgi unix//var/run/php-fpm.sock
|
||||
php_fastcgi localhost:9001
|
||||
file_server
|
||||
encode zstd gzip
|
||||
}
|
27
deploy/install.sh
Normal file → Executable file
27
deploy/install.sh
Normal file → Executable file
|
@ -1,5 +1,11 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
if [ ! -d "var" ]; then
|
||||
mkdir var
|
||||
fi
|
||||
podman pod stop futtern
|
||||
podman pod rm futtern
|
||||
|
||||
podman pod create \
|
||||
--label "io.containers.autoupdate=registry" \
|
||||
--name futtern \
|
||||
|
@ -7,20 +13,19 @@ podman pod create \
|
|||
|
||||
podman run -d \
|
||||
--pod futtern \
|
||||
--name php \
|
||||
--name futtern-php \
|
||||
--volume $(pwd)/etc/php83/php-fpm.d/www.conf:/etc/php83/php-fpm.d/www.conf \
|
||||
--volume $(pwd)/futtern-app:/var/www/html \
|
||||
--volume $(pwd)/var:/var/www/html/var \
|
||||
--env 'APP_ENV=prod' \
|
||||
git.php.fail/lubiana/container/php:8.3-fpm
|
||||
|
||||
podman run -d \
|
||||
--pod futtern \
|
||||
--name caddy \
|
||||
--volume
|
||||
--name futtern-caddy \
|
||||
--volume $(pwd)/etc/caddy/Caddyfile:/etc/caddy/Caddyfile \
|
||||
--volume $(pwd)/futtern-app:/var/www/html \
|
||||
--volume caddy_data:/data \
|
||||
docker.io/caddy/caddy:alpine
|
||||
|
||||
podman genereate systemd \
|
||||
--files \
|
||||
--name futtern \
|
||||
--restart-policy=always \
|
||||
-t 10
|
||||
|
||||
mkdir -p ${HOME}/.config/systemd/user
|
||||
|
||||
echo 'yes' | podman exec -it futtern-php /var/www/html/bin/console doctrine:migrations:migrate
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
if [ -d "futter-app" ]; then
|
||||
rm -rf futtern-app
|
||||
TARGETDIR='futtern-app'
|
||||
|
||||
if [ -d $TARGETDIR ]; then
|
||||
rm -rf $TARGETDIR
|
||||
fi
|
||||
mkdir futtern-app
|
||||
cd futtern-app || return
|
||||
mkdir $TARGETDIR
|
||||
cd $TARGETDIR || return
|
||||
|
||||
pathsToCopy="public bin config migrations src templates composer.json composer.lock symfony.lock .env etc"
|
||||
|
||||
|
@ -24,3 +26,5 @@ chmod 600 ~/.ssh/id_rsa
|
|||
ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
|
||||
# SCP files to the remote host
|
||||
rsync -avz --delete public/ ${USERNAME}@${HOST}:${TARGETDIR}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue