Compare commits

...

10 commits

Author SHA1 Message Date
Simon Vieille d83adf0473
update ci
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/manual/build Pipeline was successful
ci/woodpecker/deployment/deploy Pipeline was successful
2023-11-10 11:30:05 +01:00
Simon Vieille b9f5785fa6
replace stop action in messenger
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/deployment/deploy Pipeline was successful
ci/woodpecker/manual/build Pipeline was successful
2023-10-18 22:48:00 +02:00
Simon Vieille 0d1f1e29b5
replace stop action in messenger
Some checks failed
ci/woodpecker/push/build Pipeline failed
2023-10-18 22:38:22 +02:00
Simon Vieille 28f8e5c583
replace stop action in messenger 2023-10-18 22:33:33 +02:00
Simon Vieille 1f9161feef
update build step
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/deployment/deploy Pipeline failed
2023-10-18 22:17:06 +02:00
Simon Vieille 7800a01499
update build step
Some checks failed
ci/woodpecker/push/build Pipeline failed
2023-10-18 22:16:10 +02:00
Simon Vieille bbb1804f31
update deploy step
Some checks failed
ci/woodpecker/push/build Pipeline failed
2023-10-18 22:07:55 +02:00
Simon Vieille a273a9aac1
update deploy step 2023-10-18 22:07:20 +02:00
Simon Vieille 6e005690da
fix project template
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/deployment/deploy Pipeline failed
2023-10-13 00:05:15 +02:00
Simon Vieille b324bfcd97
fix ci syntax 2023-10-07 16:43:47 +02:00
4 changed files with 41 additions and 71 deletions

View file

@ -1,7 +1,7 @@
variables: variables:
- &volumes - &volumes
- node16_cache:/root/.npm - node16_cache:/root/.npm
- /data/deblan/deblan.io-murph:/data/deblan/deblan.io-murph - /data/${CI_REPO}:/builds
when: when:
event: [push, pull_request, tag, manual] event: [push, pull_request, tag, manual]
@ -67,11 +67,10 @@ steps:
failure: ignore failure: ignore
cache-build: cache-build:
image: deblan/php:8.1 image: deblan/mage
volumes: *volumes volumes: *volumes
commands: commands:
- apt-get update && apt-get -y install rsync - cd /builds
- cd /data/deblan/deblan.io-murph/
- rsync -az "$CI_WORKSPACE/" "$CI_COMMIT_SHA" - rsync -az "$CI_WORKSPACE/" "$CI_COMMIT_SHA"
services: services:

View file

@ -1,25 +1,25 @@
variables: variables:
- &volumes - &volumes
- /data/deblan/deblan.io-murph:/data/deblan/deblan.io-murph - /data/${CI_REPO}:/builds
when: when:
event: [deployment] event: [deployment]
skip_clone: true
steps: steps:
app-deploy: app-deploy:
image: deblan/php:8.1 image: deblan/mage
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory] secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
volumes: *volumes volumes: *volumes
commands: commands:
- apt-get update && apt-get -y install rsync openssh-client - cd "/builds/$CI_COMMIT_SHA"
- cd "/data/deblan/deblan.io-murph/$CI_COMMIT_SHA"
- mkdir "$HOME/.ssh" - mkdir "$HOME/.ssh"
- echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519" - echo "$SSH_PRIV_KEY" > "$HOME/.ssh/id_ed25519"
- chmod 700 "$HOME/.ssh" - chmod 700 "$HOME/.ssh"
- chmod 600 "$HOME/.ssh/id_ed25519" - chmod 600 "$HOME/.ssh/id_ed25519"
- composer global require andres-montanez/magallanes
- cp .mage.yml.dist .mage.yml - cp .mage.yml.dist .mage.yml
- sed -i "s/ssh_user/$SSH_USER/g" .mage.yml - sed -i "s/ssh_user/$SSH_USER/g" .mage.yml
- sed -i "s/ssh_host/$SSH_HOST/g" .mage.yml - sed -i "s/ssh_host/$SSH_HOST/g" .mage.yml
- sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml - sed -i "s#app_directory#$APP_DIRECTORY#g" .mage.yml
- /root/.config/composer/vendor/bin/mage deploy "$CI_BUILD_DEPLOY_TARGET" - mage deploy "$CI_PIPELINE_DEPLOY_TARGET"

View file

@ -22,7 +22,7 @@ help() {
-l debug|info|notice|warning|error -l debug|info|notice|warning|error
Debug level Debug level
-a start|stop|restart -a start|stop|restart|status
EOH EOH
} }
@ -34,52 +34,23 @@ on_interrupt() {
} }
start_messenger() { start_messenger() {
started=0 nohup php8.1 bin/console messenger:consume 2>/dev/null >/dev/null &
pid= log -t -l notice "Started"
if [ -f "$pid_file" ]; then
pid="$(cat "$pid_file")"
fi
if [ -n "$pid" ]; then
if [ -d "/proc/$pid" ]; then
log -t -l warning "Already running"
started=1
fi
fi
if [ "$started" -eq 0 ]; then
nohup php8.1 bin/console messenger:consume 2>/dev/null >/dev/null &
echo -n $! > "$pid_file"
log -t -l notice "Started"
fi
} }
stop_messenger() { stop_messenger() {
pid= php8.1 bin/console messenger:stop-workers 2>/dev/null >/dev/null
log -t -l notice "Stopped"
}
if [ -f "$pid_file" ]; then get_pid() {
pid="$(cat "$pid_file")" pgrep -f messenger:consume
fi
if [ -n "$pid" ]; then
if [ ! -d "/proc/$pid" ]; then
log -t -l warning "Not started"
else
kill -9 "$pid"
log -t -l notice "Stopped"
fi
rm "$pid_file"
else
log -t -l warning "Not started"
fi
} }
main() { main() {
cd "$(dirname "0")" cd "$(dirname "0")"
pid_file=var/messenger.pid ACTION=
while getopts "l:ha:" option; do while getopts "l:ha:" option; do
case "${option}" in case "${option}" in
@ -97,10 +68,12 @@ main() {
elif [ "$ACTION" = "restart" ]; then elif [ "$ACTION" = "restart" ]; then
stop_messenger stop_messenger
start_messenger start_messenger
elif [ "$ACTION" = "status" ]; then
get_pid
else
log -l error "Action is required."
fi fi
# log [-t] [-l debug|info|notice|warning|error] message
exit 0 exit 0
} }

View file

@ -13,29 +13,27 @@
</div> </div>
</div> </div>
<div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5"> <div class="grid grid-flow-row-dens grid-cols-12 md:p-8 gap-5">
{% for project in projects %} {% for project in projects %}
<div class="card shadow-md col-span-12 md:col-span-6 lg:col-span-4 m-3 bg-box"> <div class="card shadow-md col-span-12 md:col-span-6 lg:col-span-4 m-3 bg-box">
<div class="card"> {% if project.image %}
{% if project.image %} <figure>
<figure> <img src="{{ asset(project.image)|imagine_filter('project_preview_filter') }}" alt="{{ project.label }}">
<img src="{{ asset(project.image)|imagine_filter('project_preview_filter') }}" alt="{{ project.label }}"> </figure>
</figure> {% endif %}
{% endif %} <div class="card-body">
<div class="card-body"> <h2 class="card-title">{{ project.label }}</h2>
<h2 class="card-title">{{ project.label }}</h2>
{{- project.description|murph_url|markdown('post') -}} {{- project.description|murph_url|markdown('post') -}}
<div class="card-actions mt-5"> <div class="card-actions mt-5">
{% for link in project.links %} {% for link in project.links %}
<a class="btn btn-xs" href="{{ link.url|murph_url }}" target="_blank"> <a class="btn btn-xs" href="{{ link.url|murph_url }}" target="_blank">
{{- link.label -}} {{- link.label -}}
</a> </a>
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
</div>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>