Skip to content

Commit

Permalink
update dir locations and add goss test
Browse files Browse the repository at this point in the history
  • Loading branch information
skyeturriff committed Oct 29, 2024
1 parent 24c341f commit 9a68a9d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 9 deletions.
15 changes: 7 additions & 8 deletions workbench-session-init/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:noble AS build
FROM ubuntu:22.04 AS build

# Install required tools:
# - ca-certificates installs necessary certificates to use cURL with HTTPS websites
Expand All @@ -13,14 +13,13 @@ ARG RSW_VERSION=2024.09.0+375.pro3
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN mkdir -p /pwb-staging && \
RSW_VERSION_URL=$(echo -n "${RSW_VERSION}" | sed 's/+/-/g') && \
echo "Downloading https://s3.amazonaws.com/rstudio-ide-build/session/multi/x86_64/rsp-session-multi-${RSW_VERSION_URL}-x86_64.tar.gz" && \
curl -fsSL -o /pwb-staging/rsp-session-multi.tar.gz "https://s3.amazonaws.com/rstudio-ide-build/session/multi/x86_64/rsp-session-multi-${RSW_VERSION_URL}-x86_64.tar.gz" && \
mkdir -p /session-components && \
tar -C /session-components -xf /pwb-staging/rsp-session-multi.tar.gz && \
chmod -R 755 /session-components && \
mkdir -p /opt/session-components && \
tar -C /opt/session-components -xf /pwb-staging/rsp-session-multi.tar.gz && \
chmod -R 755 /opt/session-components && \
rm -rf /pwb-staging

#COPY rstudio-server/ /usr/lib/rstudio-server/
COPY --chmod=755 run.sh /usr/local/bin/run.sh

COPY --chmod=755 run.sh /run.sh

ENTRYPOINT ["/run.sh"]
ENTRYPOINT ["/usr/local/bin/run.sh"]
4 changes: 3 additions & 1 deletion workbench-session-init/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
set -e
set -x

S=/opt/session-components

# The target should exist and be an empty directory.
T=/mnt/init

Expand All @@ -12,4 +14,4 @@ if [ ! -d "${T}" ] ; then
fi

echo "Copying files from /session-components to /mnt/init"
time cp -r /session-components/* /mnt/init
time cp -r $S/* $T
13 changes: 13 additions & 0 deletions workbench-session-init/test/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package:
curl:
installed: true

file:
/opt/session-components/:
exists: true
mode: "0755"
filetype: directory
/usr/local/bin/run.sh:
exists: true
filetype: file
mode: "0755"
20 changes: 20 additions & 0 deletions workbench-session-init/test/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# install goss
GOSS_FILE=${GOSS_FILE:-/test/goss.yaml}
GOSS_VERSION=${GOSS_VERSION:-0.4.6}
GOSS_MAX_CONCURRENT=${GOSS_MAX_CONCURRENT:-50}

if [ -f /etc/debian_version ]; then
OS="ubuntu"
else
echo "OS not supported. Exiting"
exit 1
fi

# install goss to tmp location and make executable
curl -fsSL https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64 -o /tmp/goss \
&& chmod +x /tmp/goss \
&& GOSS=/tmp/goss

OS=$OS GOSS_FILE=$GOSS_FILE $GOSS v --format documentation --max-concurrent $GOSS_MAX_CONCURRENT

0 comments on commit 9a68a9d

Please sign in to comment.