Skip to content

Commit

Permalink
fix: include tasks and db files
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdan-shulha committed Sep 7, 2024
1 parent 3d4a664 commit d5d93c4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ jobs:
DB_PORT: ${{ job.services.postgres.ports[5432] }}
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
run: |
scripts/self-hosted/make-installers.sh
php artisan ide-helper:actions
vendor/bin/pint _ide_helper_actions.php
php artisan migrate:fresh
Expand All @@ -135,7 +133,9 @@ jobs:
cat << EOF >> scripts/self-hosted/db.sql
COMMIT;
EOF
scripts/self-hosted/make-installers.sh
# Check if there are any changes to commit
if git diff --exit-code && git diff --staged --exit-code; then
echo "No changes to commit"
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/SelfHostPtah.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function handle()
'name' => 'app',
'launchMode' => LaunchMode::Daemon->value,
'dockerRegistryId' => null,
'dockerImage' => 'ghcr.io/ptah-sh/ptah-server:v0.22.8',
'dockerImage' => 'ghcr.io/ptah-sh/ptah-server:latest',
'releaseCommand' => [
'command' => 'php artisan config:cache && php artisan migrate --no-interaction --verbose --ansi --force',
],
Expand Down
4 changes: 4 additions & 0 deletions scripts/self-hosted/agent.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env bash

set -e

# Header generated with http://www.kammerl.de/ascii/AsciiSignature.php
# Selected font - starwars

Expand Down
2 changes: 2 additions & 0 deletions scripts/self-hosted/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ if [ -z "$SKIP_CORE_INSTALL" ]; then

curl -fsSL https://get.docker.com/ | sh

rm -f /tmp/ptah-agent

curl -L https://github.com/ptah-sh/ptah-agent/releases/latest/download/ptah-agent-linux-x86_64.bin -o /tmp/ptah-agent

chmod +x /tmp/ptah-agent
Expand Down
11 changes: 8 additions & 3 deletions scripts/self-hosted/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ SCRIPT_DIR="$(dirname "$0")"
#include:core.sh
#--- core.sh

echo "$(header "Downloading dependencies: tasks.json, db.sql and install-agent.sh")"
curl -sSL https://raw.githubusercontent.com/ptah-sh/ptah-server/main/scripts/self-hosted/tasks.json > tasks.json
curl -sSL https://raw.githubusercontent.com/ptah-sh/ptah-server/main/scripts/self-hosted/db.sql > db.sql
curl -sSL https://raw.githubusercontent.com/ptah-sh/ptah-server/main/scripts/self-hosted/install-agent.sh > install-agent.sh

# Function to let user choose an IP address with styling
choose_ip_address() {
local ip_list="$1"
Expand Down Expand Up @@ -100,7 +105,7 @@ get_user_credentials() {
echo -e "\n$(green "Credentials saved successfully.")"
}

IP_LIST=$(./ptah-agent list-ips)
IP_LIST=$(/tmp/ptah-agent list-ips)
choose_ip_address "$IP_LIST" "Advertised IP addresses" "ADVERTISE_ADDR" "$ADVERTISED_IP_HELP"
choose_ip_address "$IP_LIST" "Public IP address" "PUBLIC_IP" "$PUBLIC_IP_HELP"

Expand Down Expand Up @@ -149,11 +154,11 @@ export PTAH_BASE_URL="http://$PUBLIC_IP:80"

export SKIP_CORE_INSTALL=1

bash agent.sh
bash install-agent.sh

export PTAH_ROOT_DIR=/home/ptah/ptah-agent

/home/ptah/ptah-agent/current exec-tasks tasks.json
$PTAH_ROOT_DIR/current exec-tasks tasks.json


sql_dump_file="db.sql"
Expand Down

0 comments on commit d5d93c4

Please sign in to comment.