Skip to content

Commit

Permalink
fix: run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olimpiurob committed Jan 26, 2024
1 parent 2b06942 commit 1f35e9a
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ pipeline {
script {
try {
checkout scm
sh '''sed -i "s|eeacms/marine-backend|${IMAGE_NAME}|g" devel/Dockerfile'''
sh '''docker build -t ${IMAGE_NAME} .'''
// sh '''docker run -i --name=${IMAGE_NAME} -e EXCLUDE="${EXCLUDE}" -e GIT_BRANCH="${CHANGE_TARGET:-$GIT_BRANCH}" ${IMAGE_NAME}-devel /debug.sh tests'''
sh '''docker build -t ${IMAGE_NAME}-devel devel'''
sh '''docker run -i --name=${IMAGE_NAME} -e EXCLUDE="${EXCLUDE}" -e GIT_BRANCH="${CHANGE_TARGET:-$GIT_BRANCH}" ${IMAGE_NAME}-devel gosu plone /debug.sh tests'''
} finally {
sh script: "docker rm -v ${IMAGE_NAME}", returnStatus: true
sh script: "docker rmi ${IMAGE_NAME}", returnStatus: true
sh script: "docker rmi ${IMAGE_NAME}-devel", returnStatus: true
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions devel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM eeacms/marine-backend

COPY devel.cfg /plone/instance/
COPY docker-setup.sh /

RUN /docker-setup.sh
12 changes: 12 additions & 0 deletions devel/devel.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[configuration]
eggs +=
collective.MockMailHost
wise.theme
wise.msfd

[buildout]
extends = develop.cfg

[sources]
wise.theme = git https://github.com/eea/wise.theme.git branch=plone5-py3
wise.msfd = git https://github.com/eea/wise.msfd.git branch=plone5
39 changes: 39 additions & 0 deletions devel/docker-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

#make sure all the commands are run succesfully
set -e

runDeps="
build-essential
silversearcher-ag
tmux
mc
procps
"

echo "========================================================================="
echo "Installing $runDeps"
echo "========================================================================="

apt-get update
apt-get install -y --no-install-recommends $runDeps

echo "========================================================================="
echo "Running buildout -c devel.cfg"
echo "========================================================================="

gosu plone buildout -c devel.cfg

echo "========================================================================="
echo "Cleaning up cache..."
echo "========================================================================="

rm -vrf /var/lib/apt/lists/*
rm -vrf /plone/buildout-cache/downloads/*

echo "========================================================================="
echo "Fixing permissions..."
echo "========================================================================="

find /data -not -user plone -exec chown plone:plone {} \+
find /plone -not -user plone -exec chown plone:plone {} \+
2 changes: 1 addition & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/opt/homebrew/bin/bash
set -e

dir="$(dirname "$(readlink -f "$BASH_SOURCE")")"
Expand Down

0 comments on commit 1f35e9a

Please sign in to comment.