This commit is contained in:
@@ -6,10 +6,12 @@ ARG TARGETARCH
|
||||
|
||||
# Copy binary from builder
|
||||
|
||||
RUN apk add --no-cache wget curl bash jq
|
||||
|
||||
RUN mkdir -p /sos && mkdir -p /data/storage
|
||||
|
||||
COPY --chmod=0755 output/simple_object_storage.${TARGETARCH} /sos/sos
|
||||
COPY --chmod=0644 testing/sos_config.json /testing/sos_config.json
|
||||
COPY testing/ /testing/
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
|
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
sos:
|
||||
image: gitea.jde.nz/public/simple-object-storage:test
|
||||
image: simple-object-storage-test
|
||||
container_name: sos-test
|
||||
network_mode: "host"
|
||||
ports:
|
||||
|
@@ -8,5 +8,6 @@
|
||||
"auth_rate_limit": 5,
|
||||
"auth_window_seconds": 2
|
||||
},
|
||||
"port": 7703
|
||||
"port": 7703,
|
||||
"host": "127.0.0.1"
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ title "Building amd64 executable"
|
||||
#------------------------------------------------------------------------------------------------
|
||||
# build the docker image
|
||||
title "Building docker image"
|
||||
docker buildx build --no-cache --load -t gitea.jde.nz/public/simple-object-storage:test --platform linux/amd64 "${MAIN_DIR}"
|
||||
docker buildx build --no-cache --load -t simple-object-storage-test --platform linux/amd64 "${MAIN_DIR}"
|
||||
|
||||
#------------------------------------------------------------------------------------------------
|
||||
# run the docker container
|
||||
@@ -84,7 +84,8 @@ if ! wait_for_container "sos-test"; then
|
||||
fi
|
||||
|
||||
# run the tests. Docker inside docker support!
|
||||
"${SCRIPT_DIR}/test.sh" "http://127.0.0.1:7703"
|
||||
docker exec -it sos-test ls /testing || true
|
||||
docker exec -it sos-test /bin/bash -c "cd /testing && ./test.sh http://127.0.0.1:7703"
|
||||
RESULT=$?
|
||||
|
||||
# clean up.
|
||||
|
@@ -1,6 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# read ~/.config/simple_object_storage/sos_config.json
|
||||
CONFIG_PATH="./sos_config.json"
|
||||
if [ ! -f "${CONFIG_PATH}" ]; then
|
||||
@@ -19,8 +18,6 @@ echo "Calculating original file hash..."
|
||||
ORIGINAL_HASH=$(sha256sum test_file.bin | cut -d' ' -f1)
|
||||
echo "Original hash: $ORIGINAL_HASH"
|
||||
|
||||
|
||||
|
||||
# get the host and port from the config
|
||||
HOST=$(echo "$CONFIG" | jq -r '.host')
|
||||
PORT=$(echo "$CONFIG" | jq -r '.port')
|
||||
|
Reference in New Issue
Block a user