mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 19:36:22 +00:00
feat: usar pnpm si existe
relacionado con sutty/jekyll/sutty-base-jekyll-theme#53
This commit is contained in:
parent
c789813a46
commit
ea0539bb1f
2 changed files with 22 additions and 0 deletions
|
@ -17,6 +17,8 @@ RUN wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pando
|
||||||
|
|
||||||
COPY ./monit.conf /etc/monit.d/sutty.conf
|
COPY ./monit.conf /etc/monit.d/sutty.conf
|
||||||
|
|
||||||
|
RUN apk add npm && npm install -g pnpm && apk del npm
|
||||||
|
|
||||||
VOLUME "/srv"
|
VOLUME "/srv"
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
|
@ -15,6 +15,7 @@ class DeployLocal < Deploy
|
||||||
def deploy(output: false)
|
def deploy(output: false)
|
||||||
return false unless mkdir
|
return false unless mkdir
|
||||||
return false unless yarn(output: output)
|
return false unless yarn(output: output)
|
||||||
|
return false unless pnpm(output: output)
|
||||||
return false unless bundle(output: output)
|
return false unless bundle(output: output)
|
||||||
|
|
||||||
jekyll_build(output: output)
|
jekyll_build(output: output)
|
||||||
|
@ -91,6 +92,10 @@ class DeployLocal < Deploy
|
||||||
Rails.root.join('_yarn_cache').to_s
|
Rails.root.join('_yarn_cache').to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pnpm_cache_dir
|
||||||
|
Rails.root.join('_pnpm_cache').to_s
|
||||||
|
end
|
||||||
|
|
||||||
def yarn_lock
|
def yarn_lock
|
||||||
File.join(site.path, 'yarn.lock')
|
File.join(site.path, 'yarn.lock')
|
||||||
end
|
end
|
||||||
|
@ -103,6 +108,14 @@ class DeployLocal < Deploy
|
||||||
run %(gem install bundler --no-document), output: output
|
run %(gem install bundler --no-document), output: output
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pnpm_lock
|
||||||
|
File.join(site.path, 'pnpm-lock.yaml')
|
||||||
|
end
|
||||||
|
|
||||||
|
def pnpm_lock?
|
||||||
|
File.exist? pnpm_lock
|
||||||
|
end
|
||||||
|
|
||||||
# Corre yarn dentro del repositorio
|
# Corre yarn dentro del repositorio
|
||||||
def yarn(output: false)
|
def yarn(output: false)
|
||||||
return true unless yarn_lock?
|
return true unless yarn_lock?
|
||||||
|
@ -114,6 +127,13 @@ class DeployLocal < Deploy
|
||||||
run %(bundle install --no-cache --path="#{gems_dir}" --clean --without test development), output: output
|
run %(bundle install --no-cache --path="#{gems_dir}" --clean --without test development), output: output
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pnpm
|
||||||
|
return true unless pnpm_lock?
|
||||||
|
|
||||||
|
run %(pnpm config set store-dir "#{pnpm_cache_dir}")
|
||||||
|
run 'pnpm install --production'
|
||||||
|
end
|
||||||
|
|
||||||
def jekyll_build(output: false)
|
def jekyll_build(output: false)
|
||||||
run %(bundle exec jekyll build --trace --profile --destination "#{escaped_destination}"), output: output
|
run %(bundle exec jekyll build --trace --profile --destination "#{escaped_destination}"), output: output
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue