Skip to content

Commit

Permalink
Upgrade dependencies (#21)
Browse files Browse the repository at this point in the history
* chore: upgrade dependencies

Signed-off-by: Oleksii Orel <[email protected]>
  • Loading branch information
olexii4 authored Apr 30, 2024
1 parent f974f42 commit 1cd2733
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 8 deletions.
26 changes: 25 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,31 @@
# Contributors:
# Red Hat, Inc. - initial API and implementation

FROM quay.io/devfile/universal-developer-image:ubi8-latest
FROM quay.io/ubi8/openjdk-21:latest

RUN microdnf install -y git rsync

ARG MAVEN_VERSION=3.9.6
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
# https://github.com/eclipse/dash-licenses/commits Apr 23, 2024
ARG DASH_LICENSE_REV=0001fc18bde5b736ca659b37b429ee55b8610efb

RUN mkdir -p /usr/local/apache-maven /usr/local/apache-maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/local/apache-maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/local/apache-maven/bin/mvn /usr/bin/mvn

ENV NODE_VERSION=v20.12.0
ENV NODE_DISTRO=linux-x64
ENV NODE_BASE_URL=https://nodejs.org/dist/${NODE_VERSION}

RUN curl -fsSL ${NODE_BASE_URL}/node-${NODE_VERSION}-${NODE_DISTRO}.tar.gz -o node-${NODE_VERSION}-${NODE_DISTRO}.tar.gz \
&& mkdir -p /usr/local/lib/nodejs \
&& tar -xzf node-${NODE_VERSION}-${NODE_DISTRO}.tar.gz -C /usr/local/lib/nodejs \
&& rm node-${NODE_VERSION}-${NODE_DISTRO}.tar.gz

ENV PATH=/usr/local/lib/nodejs/node-${NODE_VERSION}-${NODE_DISTRO}/bin/:$PATH

RUN npm install yarn synp -g

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It supports the following package managers:
## Build

```sh
./build.sh
scripts/build.sh
```

## Usage
Expand Down
6 changes: 0 additions & 6 deletions build.sh

This file was deleted.

6 changes: 6 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
# Simple script that helps to build local version to test easily
set -e
set -u

${PWD}/scripts/container_tool.sh build -f Dockerfile -t quay.io/che-incubator/dash-licenses:local .
51 changes: 51 additions & 0 deletions scripts/container_tool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

# Function to check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}

# Check for Podman
if command_exists "podman"; then
# Check if Podman machine is running
if podman info &>/dev/null; then
container_engine="podman"
fi
fi

# Check for Docker
if command_exists "docker"; then
# Check if Docker daemon is running
if docker info &>/dev/null; then
container_engine="docker"
fi
fi

# If neither Podman nor Docker is found or running
if [ -z "$container_engine" ]; then
echo "Neither Podman nor Docker is installed or running."
exit 1
fi

# Run command using Docker or Podman whichever is available
container_tool() {
local command=$1
shift

echo "Container engine: $container_engine"
"$container_engine" "$command" "$@"
}

# Main script
case "$1" in
build | run | push)
set -e
container_tool "$@"
;;
*)
echo "Unknown command. Use: build, run, or push."
exit 1
;;
esac

exit 0

0 comments on commit 1cd2733

Please sign in to comment.