Skip to content

Commit

Permalink
Merge branch 'release/v8.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Apr 25, 2024
2 parents af468d8 + 8eb1991 commit ae944f3
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ runs:
uses: actions/cache@v4
with:
path: ~/.mix
key: ${{ runner.arch }}-alpine-${{ inputs.alpine }}-pakman-8.2.4
key: ${{ runner.arch }}-alpine-${{ inputs.alpine }}-pakman-8.2.5

- name: Install Pakman
if: steps.cache-pakman.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix escript.install hex pakman 8.2.4 --force
mix escript.install hex pakman 8.2.5 --force
shell: alpine.sh {0}
env:
MIX_ENV: prod
9 changes: 9 additions & 0 deletions lib/pakman/bootstrap.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ defmodule Pakman.Bootstrap do
["!check", "!tracedeps"]
end

strip_binary = Map.get(config["build"], "strip_binary", true)

options =
if strip_binary == false do
options ++ ["!strip"]
else
options
end

config =
Map.merge(config, %{
"options" => options,
Expand Down
115 changes: 115 additions & 0 deletions test/fixtures/laravel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
dependencies:
build:
- php82
- npm
- composer
- php82-session
- php82-fileinfo
- php82-tokenizer
- php82-dom
- php82-xml
- php82-xmlwriter
- php82-pcntl
runtime:
- php82
- composer
- php82-session
- php82-fileinfo
- php82-tokenizer
- php82-dom
- php82-xml
- php82-xmlwriter
- php82-pcntl
- bash
- curl
- s6
- jq
- ca-certificates
- php82-pgsql
- php82-pdo_pgsql
- laraone-openrc

stack: alpine/3.19

build:
strip_binary: false
command: |
export APP_ENV=production
export APP_DEBUG=false
composer install --optimize-autoloader --no-dev
php artisan octane:install --server=frankenphp --no-interaction
php artisan config:cache
php artisan event:cache
php artisan route:cache
php artisan view:cache
php artisan optimize
npm install
npm run build
destinations:
- '*'

run:
commands:
- binary: php
call: artisan migrate --force --no-interaction
name: migrate
path: /usr/bin
- binary: php
call: artisan tinker
name: console
path: /usr/bin
- binary: php
call: artisan config:cache
name: configure
path: /usr/bin
- binary: tail
call: -f -n 100 /var/log/laraone/current
name: logs
path: /usr/bin
name: laraone
services:
- binary: php
name: web
path: /usr/bin
start:
call: artisan octane:start --server=frankenphp

hook:
post-deinstall: |
rc-service laraone stop
rc-update del laraone
post-install: |
rc-update add laraone
rc-service laraone configure
rc-service laraone migrate
post-upgrade: |
rc-service laraone configure
rc-service laraone migrate
rc-service laraone start
pre-upgrade: |
rc-service laraone stop
kits:
- description: web service
main: true
name: web
ports:
- main: true
name: web
target: 8000
variables:
- default_value: production
key: APP_ENV
- default_value: frankenphp
key: OCTANE_SERVER
- driver: generic/secret
driver_options:
framework: laravel
length: 32
key: APP_KEY
- driver: database/postgresql
key: DATABASE
- default_value: pgsql
key: DB_CONNECTION
18 changes: 18 additions & 0 deletions test/pakman/bootstrap_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@ defmodule Pakman.BootstrapTest do
assert apkbuild =~ "!tracedeps"
end

test "laravel config" do
System.put_env("HOME", "tmp/laravel")
System.put_env("GITHUB_WORKSPACE", "tmp/laravel")
System.put_env("GITHUB_REPOSITORY", "upmaru/laravel")

Pakman.SystemMock
|> expect(:cmd, 3, fn _binary, _options ->
:ok
end)

assert :ok ==
Pakman.Bootstrap.perform(config: "test/fixtures/laravel.yml")

apkbuild = File.read!("tmp/laravel/.apk/upmaru/laravel/APKBUILD")

assert apkbuild =~ "!strip"
end

test "elixir config" do
System.put_env("HOME", "tmp/elixir")
System.put_env("GITHUB_WORKSPACE", "tmp/elixir")
Expand Down

0 comments on commit ae944f3

Please sign in to comment.