Skip to content

Commit

Permalink
Merge branch 'release/v8.1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Nov 10, 2023
2 parents 8d847fd + 3fe6411 commit 23666c6
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 25.3.2.2
erlang 25.3.2.7
elixir 1.14.4-otp-25
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@v3
with:
path: ~/.mix
key: ${{ runner.arch }}-alpine-${{ inputs.alpine }}-pakman-8.1.8
key: ${{ runner.arch }}-alpine-${{ inputs.alpine }}-pakman-8.1.9

- 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.1.8 --force
mix escript.install hex pakman 8.1.9 --force
shell: alpine.sh {0}
env:
MIX_ENV: prod
3 changes: 3 additions & 0 deletions lib/pakman/bootstrap/templates/log.eex
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#!/bin/execlineb -P
# Strip application additional timestamp
# Note: execlineb requires \ to be escaped as \\ and strings to be surrounded by " not '
pipeline { /bin/sed "s/[0-9]\\{4\\}\\/[0-9]\\{2\\}\\/[0-9]\\{2\\} [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\.[0-9]\\{3\\}//" }
s6-log -b n20 s1000000 T /var/log/<%= name %>
4 changes: 2 additions & 2 deletions lib/pakman/push.ex
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ defmodule Pakman.Push do
bucket: storage["bucket"]
}

concurrency =
concurrency =
Keyword.get(options, :concurrency, "2")
|> String.to_integer()

stream =
Task.Supervisor.async_stream(
Pakman.TaskSupervisor,
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Pakman.MixProject do
def project do
[
app: :pakman,
version: "8.1.8",
version: "8.1.9",
elixir: "~> 1.13",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
Expand Down
62 changes: 62 additions & 0 deletions test/fixtures/caddy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
dependencies:
trace: true
build:
- go
- libcap
runtime:
- bash
- curl
- s6
- jq
- ca-certificates
- uplink-caddy-openrc

stack: alpine/3.18

build:
destinations:
- build
command: |
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
mkdir build
~/go/bin/xcaddy build --output ./bin/caddy \
--with github.com/ss098/certmagic-s3 \
--with github.com/caddyserver/cache-handler
run:
name: uplink-caddy
services:
- name: server
binary: caddy
path: /usr/sbin
start:
call: run

package: |
cd "$srcdir"
install -Dm755 bin/caddy "$pkgdir"/usr/sbin/caddy
setcap cap_net_bind_service=+ep "$pkgdir"/usr/sbin/caddy
install -Dm644 "$srcdir"/Caddyfile "$pkgdir"/etc/$pkgname/Caddyfile
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
install -Dm755 "$srcdir"/$pkgname.run "$pkgdir"/var/lib/$pkgname/service/run
install -Dm755 "$srcdir"/$pkgname.log "$pkgdir"/var/lib/$pkgname/service/log/run
install -Dm755 "$srcdir"/$pkgname.environment "$pkgdir"/var/lib/$pkgname/bin/environment
install -Dm755 "$srcdir"/$pkgname.env-exec "$pkgdir"/var/lib/$pkgname/bin/env-exec
hook:
post-install: |
rc-update add uplink-caddy
pre-upgrade: |
rc-service uplink-caddy stop
post-upgrade: |
rc-service uplink-caddy start
post-deinstall: |
rc-service uplink-caddy stop
rc-update del uplink-caddy
20 changes: 18 additions & 2 deletions test/pakman/bootstrap_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,24 @@ defmodule Pakman.BootstrapTest do
end

describe "perform" do
test "caddy config" do
System.put_env("HOME", "tmp/caddy")
System.put_env("GITHUB_WORKSPACE", "tmp/caddy")
System.put_env("GITHUB_REPOSITORY", "upmaru/uplink-caddy")

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

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

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

Pakman.SystemMock
|> expect(:cmd, 2, fn _binary, _options ->
Expand All @@ -25,14 +40,15 @@ defmodule Pakman.BootstrapTest do
assert :ok ==
Pakman.Bootstrap.perform(config: "test/fixtures/rails.yml")

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

assert apkbuild =~ "!tracedeps"
end

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

Pakman.SystemMock
|> expect(:cmd, 2, fn _binary, _options ->
Expand All @@ -42,7 +58,7 @@ defmodule Pakman.BootstrapTest do
assert :ok ==
Pakman.Bootstrap.perform(config: "test/fixtures/elixir.yml")

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

refute apkbuild =~ "!tracedeps"
end
Expand Down

0 comments on commit 23666c6

Please sign in to comment.