-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0d072b
commit 8acf9fe
Showing
10 changed files
with
221 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,13 +109,13 @@ jobs: | |
needs: build-deb | ||
strategy: | ||
matrix: | ||
distro: | ||
- debian10 | ||
- debian11 | ||
- debian12 | ||
- ubuntu2004 | ||
- ubuntu2204 | ||
- ubuntu2404 | ||
image: | ||
- geerlingguy/docker-debian10-ansible:latest | ||
- geerlingguy/docker-debian11-ansible:latest | ||
- geerlingguy/docker-debian12-ansible:latest | ||
- geerlingguy/docker-ubuntu2004-ansible:latest | ||
- geerlingguy/docker-ubuntu2204-ansible:latest | ||
- geerlingguy/docker-ubuntu2404-ansible:latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
|
@@ -129,7 +129,21 @@ jobs: | |
with: | ||
molecule_working_dir: './deployment/ansible/gnomeshade' | ||
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} | ||
MOLECULE_IMAGE: ${{ matrix.image }} | ||
|
||
test-deb: | ||
name: Test debian package | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 10 | ||
needs: build-deb | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
id: download | ||
with: | ||
name: Gnomeshade.WebApi_linux-x64.deb | ||
|
||
- run: ./deployment/test-deb.sh ${{ steps.download.outputs.download-path }}/gnomeshade.deb ${{ secrets.DEMO_ADMIN_PASSWORD }} | ||
|
||
docker: | ||
name: Test docker container | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#!/bin/bash | ||
|
||
### BEGIN INIT INFO | ||
# Provides: gnomeshade | ||
# Required-Start: $local_fs $network | ||
# Required-Stop: $local_fs $network | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: Gnomeshade server | ||
### END INIT INFO | ||
|
||
# Source LSB helpers | ||
. /lib/lsb/init-functions | ||
|
||
# Process name (for display only) | ||
NAME=gnomeshade | ||
|
||
# Where is the actual executable for the daemon | ||
DAEMON=/opt/gnomeshade/Gnomeshade.WebApi | ||
WORKING_DIRECTORY=/etc/opt/gnomeshade | ||
ASPNETCORE_WEBROOT=/opt/gnomeshade/wwwroot | ||
ENVIRONMENT=Production | ||
DOTNET_gcServer=0 | ||
Database__Provider="Sqlite" | ||
ConnectionStrings__Gnomeshade="Data Source=gnomeshade.db" | ||
|
||
# The user:group under which the daemon must run | ||
RUN_AS_USER=gnomeshade | ||
|
||
# pid file for the daemon | ||
PIDFILE=/var/run/gnomeshade.pid | ||
|
||
# If the daemon is not there, then exit. | ||
if ! [ -x ${DAEMON} ] | ||
then | ||
log_failure_msg "Cannot find an executable at ${DAEMON}" | ||
exit 1 | ||
fi | ||
|
||
case $1 in | ||
start) | ||
# Check if pidfile exists | ||
if [ -e ${PIDFILE} ] | ||
then | ||
# Check the actual status of process | ||
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && status="0" || status="$?" | ||
# If the status is successfully, no need to start again. | ||
[ "${status}" = "0" ] && exit 0 | ||
fi | ||
# Start the daemon. | ||
log_daemon_msg "Starting ${NAME}" | ||
# Start the daemon with the help of start-stop-daemon | ||
if start-stop-daemon --start --quiet --oknodo --pidfile ${PIDFILE} --make-pidfile --background \ | ||
--chuid ${RUN_AS_USER} --chdir ${WORKING_DIRECTORY} --no-close --startas ${DAEMON} >> /var/log/gnomeshade | ||
then | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
;; | ||
stop) | ||
if [ -e ${PIDFILE} ] | ||
then | ||
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && status="0" || status="$?" | ||
if [ "$status" = "0" ]; then | ||
log_daemon_msg "Stopping ${NAME}" | ||
if start-stop-daemon -K --signal TERM --quiet --oknodo --pidfile ${PIDFILE} | ||
then | ||
log_end_msg 0 | ||
rm -rf ${PIDFILE} | ||
else | ||
log_end_msg 1 | ||
fi | ||
fi | ||
else | ||
log_daemon_msg "${NAME} is not running" | ||
log_end_msg 0 | ||
fi | ||
;; | ||
restart) | ||
$0 stop && sleep 3 && $0 start | ||
;; | ||
status) | ||
# Check the status of the process. | ||
if [ -e ${PIDFILE} ] | ||
then | ||
status_of_proc -p ${PIDFILE} ${DAEMON} ${NAME} && exit 0 || exit $? | ||
else | ||
log_daemon_msg "${NAME} is not running (no pidfile)" | ||
log_end_msg 0 | ||
fi | ||
;; | ||
reload) | ||
if [ -e ${PIDFILE} ]; then | ||
log_daemon_msg "Reloading ${NAME}" | ||
if start-stop-daemon -K --quiet --signal HUP --pidfile ${PIDFILE} | ||
then | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
else | ||
log_failure_msg "Cannot find pidfile at ${PIDFILE}" | ||
fi | ||
;; | ||
force-reload) | ||
if [ -e ${PIDFILE} ]; then | ||
log_daemon_msg "Reloading ${NAME}" | ||
if start-stop-daemon -K --quiet --signal HUP --pidfile ${PIDFILE} | ||
then | ||
log_end_msg 0 | ||
else | ||
log_end_msg 1 | ||
fi | ||
else | ||
log_failure_msg "Cannot find pidfile at ${PIDFILE}" | ||
fi | ||
;; | ||
*) | ||
# Invalid argument, print the usage message. | ||
echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" | ||
exit 2 | ||
;; | ||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [[ $(systemctl) =~ -\.mount ]] | ||
then | ||
exit | ||
else | ||
update-rc.d gnomeshade remove | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
deb-systemd-invoke stop gnomeshade.service | ||
if [[ $(systemctl) =~ -\.mount ]] | ||
then | ||
deb-systemd-invoke stop gnomeshade.service | ||
else | ||
exit | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM devuan/devuan:daedalus | ||
|
||
COPY gnomeshade.deb /gnomeshade.deb | ||
|
||
RUN apt-get update && apt-get install -y libicu72 libssl3 libgssapi-krb5-2 | ||
RUN dpkg -i /gnomeshade.deb | ||
|
||
EXPOSE 5000 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
name="test" | ||
|
||
function printLogs() { | ||
docker logs $name | ||
docker exec $name service --status-all | ||
docker exec $name ls -lah /opt/gnomeshade | ||
docker exec $name ls -lah /etc/opt/gnomeshade | ||
docker exec $name ls -lah /var/log | ||
docker exec $name cat /var/log/gnomeshade | ||
} | ||
|
||
trap printLogs EXIT | ||
|
||
cd ./deployment/docker/devuan/daedalus | ||
cp "$1" ./gnomeshade.deb | ||
|
||
docker build --tag devuan:test ./ | ||
docker pull devuan/devuan:daedalus | ||
docker run --detach --name $name --publish 5000:5000 \ | ||
--env "Admin__Password=$2" \ | ||
devuan:test /bin/bash -c \ | ||
"service gnomeshade start && { while true; do sleep 2; done }" | ||
|
||
wget --tries=10 --retry-connrefused --waitretry=10 --timeout=15 "http://localhost:5000/api/v1.0/health" | ||
|
||
if [[ $(cat health) != "Healthy" ]]; then | ||
exit 1 | ||
fi | ||
|
||
curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"username":"john.doe", "password": "Password123!", "email": "[email protected]", "fullName": "John Doe" }' \ | ||
http://localhost:8000/Authorization/Register |