Skip to content

Commit

Permalink
feat: better environment initialization
Browse files Browse the repository at this point in the history
Migrate env initialization from Dockerfile to standalone script, it
can improve performance and manipuility.
  • Loading branch information
jeffreytse committed Aug 20, 2021
1 parent 25115dd commit 608f667
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
15 changes: 0 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,6 @@ LABEL repository="https://github.com/jeffreytse/jekyll-deploy-action"
LABEL homepage="https://github.com/jeffreytse/jekyll-deploy-action"
LABEL maintainer="Jeffrey Tse <[email protected]>"

# Update packages database
RUN pacman -Syu --noconfirm

# Installing git package
RUN pacman -S --noconfirm git

# Installing ruby libraries
RUN pacman -S --noconfirm ruby2.7 ruby-bundler

# Setting default ruby version
RUN cp /usr/bin/ruby-2.7 /usr/bin/ruby

# debug
RUN ruby -v && bundle version

COPY LICENSE.txt README.md /

COPY script /script
Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ if [[ "${PROVIDER}" == "github" ]]; then
fi
fi

# Initialize environment
echo "Initialize environment"
${SCRIPT_DIR}/script/init_environment.sh

cd ${JEKYLL_SRC}

# Check and execute pre_build_commands commands
Expand Down
16 changes: 16 additions & 0 deletions script/init_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Update packages database
pacman -Syu --noconfirm

# Installing git package
pacman -S --noconfirm git

# Installing ruby libraries
pacman -S --noconfirm ruby2.7 ruby-bundler

# Setting default ruby version
cp /usr/bin/ruby-2.7 /usr/bin/ruby

# debug
ruby -v && bundle version

0 comments on commit 608f667

Please sign in to comment.