Skip to content

Commit

Permalink
#19 check presence
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Aug 30, 2024
1 parent ac7f15d commit a414875
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/main/resources/org/eolang/hone/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ COPY install-ghc.sh .
RUN chmod a+x install-ghc.sh \
&& ./install-ghc.sh
ENV PATH /root/.cabal/bin:/root/.local/bin:/opt/ghc/${GHC}/bin:$PATH
RUN ghc --version

ENV STACK 2.15.7
ENV STACK_RELEASE_KEY C5705533DA4F78D8664B5DC0575159689BEFB442
COPY install-stack.sh .
RUN chmod a+x install-stack.sh \
&& ./install-stack.sh \
&& stack --version \
&& stack config set system-ghc --global true

ENV NORMALIZER 1.0.0
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/org/eolang/hone/docker/install-ghc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

set -ex

if ghc --version; then
echo "GHC already installed"
exit
fi

cd /tmp
ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"
GHC_URL="https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-$ARCH-deb11-linux.tar.xz"
Expand All @@ -50,3 +55,5 @@ tar xf ghc.tar.xz
cd "ghc-$GHC-$ARCH-unknown-linux"
./configure --prefix "/opt/ghc/$GHC"
make install

ghc --version
6 changes: 6 additions & 0 deletions src/main/resources/org/eolang/hone/docker/install-maven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

set -ex

if mvn --version; then
echo "Maven already installed"
exit
fi

MAVEN_VERSION=3.9.6
M2_HOME="/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}"

Expand All @@ -33,5 +38,6 @@ mv "apache-maven-${MAVEN_VERSION}-bin.tar.gz" /usr/local/apache-maven
tar xzvf "/usr/local/apache-maven/apache-maven-${MAVEN_VERSION}-bin.tar.gz" -C /usr/local/apache-maven/
update-alternatives --install /usr/bin/mvn mvn "${M2_HOME}/bin/mvn" 1
update-alternatives --config mvn

mvn -version
bash -c '[[ "$(mvn --version)" =~ "${MAVEN_VERSION}" ]]'
7 changes: 7 additions & 0 deletions src/main/resources/org/eolang/hone/docker/install-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

set -ex

if stack --version; then
echo "Stack already installed"
exit
fi

cd /tmp
ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"
STACK_URL="https://github.com/commercialhaskell/stack/releases/download/v${STACK}/stack-${STACK}-linux-$ARCH.tar.gz"
Expand All @@ -47,3 +52,5 @@ gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$STACK_RELEASE_KEY"
gpg --batch --verify stack.tar.gz.asc stack.tar.gz
gpgconf --kill all
tar -xf stack.tar.gz -C /usr/local/bin --strip-components=1 "stack-$STACK-linux-$ARCH/stack"

stack --version

0 comments on commit a414875

Please sign in to comment.