mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 14:21:41 +00:00
feat: usar pnpm si existe
relacionado con sutty/jekyll/sutty-base-jekyll-theme#53
This commit is contained in:
parent
ebf1390bdf
commit
928bc45920
2 changed files with 22 additions and 0 deletions
|
@ -15,6 +15,8 @@ RUN apk add --no-cache libxslt libxml2 postgresql-libs libssh2 \
|
|||
RUN gem install --no-document --no-user-install foreman
|
||||
RUN wget https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-linux-amd64.tar.gz -O - | tar --strip-components 1 -xvzf - pandoc-${PANDOC_VERSION}/bin/pandoc && mv /bin/pandoc /usr/bin/pandoc
|
||||
|
||||
RUN apk add npm && npm install -g pnpm && apk del npm
|
||||
|
||||
VOLUME "/srv"
|
||||
|
||||
EXPOSE 3000
|
||||
|
|
|
@ -15,6 +15,7 @@ class DeployLocal < Deploy
|
|||
def deploy
|
||||
return false unless mkdir
|
||||
return false unless yarn
|
||||
return false unless pnpm
|
||||
return false unless bundle
|
||||
|
||||
jekyll_build
|
||||
|
@ -74,6 +75,10 @@ class DeployLocal < Deploy
|
|||
Rails.root.join('_yarn_cache').to_s
|
||||
end
|
||||
|
||||
def pnpm_cache_dir
|
||||
Rails.root.join('_pnpm_cache').to_s
|
||||
end
|
||||
|
||||
def yarn_lock
|
||||
File.join(site.path, 'yarn.lock')
|
||||
end
|
||||
|
@ -82,6 +87,14 @@ class DeployLocal < Deploy
|
|||
File.exist? yarn_lock
|
||||
end
|
||||
|
||||
def pnpm_lock
|
||||
File.join(site.path, 'pnpm-lock.yaml')
|
||||
end
|
||||
|
||||
def pnpm_lock?
|
||||
File.exist? pnpm_lock
|
||||
end
|
||||
|
||||
def gem
|
||||
run %(gem install bundler --no-document)
|
||||
end
|
||||
|
@ -93,6 +106,13 @@ class DeployLocal < Deploy
|
|||
run 'yarn install --production'
|
||||
end
|
||||
|
||||
def pnpm
|
||||
return true unless pnpm_lock?
|
||||
|
||||
run %(pnpm config set store-dir "#{pnpm_cache_dir}")
|
||||
run 'pnpm install --production'
|
||||
end
|
||||
|
||||
def bundle
|
||||
if Rails.env.production?
|
||||
run %(bundle install --no-cache --path="#{gems_dir}")
|
||||
|
|
Loading…
Reference in a new issue