This repository has been archived by the owner on Apr 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Showing
64 changed files
with
2,113 additions
and
1,569 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi/plugins/jamf && vendor/bin/phpunit -c tests/phpunit.xml --testsuite \"PHP Unit Tests\" --do-not-cache --verbose" |
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,31 @@ | ||
#!/bin/bash | ||
set -e -u -x -o pipefail | ||
|
||
docker-compose pull --quiet | ||
docker-compose up --no-start | ||
docker-compose start | ||
|
||
# Check services health (because the DB container is not ready by the time we try to install GLPI) | ||
for CONTAINER_ID in `docker-compose ps -a -q`; do | ||
CONTAINER_NAME=`/usr/bin/docker inspect --format='{{print .Name}}{{if .Config.Image}} ({{print .Config.Image}}){{end}}' $CONTAINER_ID` | ||
HEALTHY=false | ||
TOTAL_COUNT=0 | ||
until [ $HEALTHY = true ]; do | ||
if [ "`/usr/bin/docker inspect --format='{{if .Config.Healthcheck}}{{print .State.Health.Status}}{{else}}{{print \"healthy\"}}{{end}}' $CONTAINER_ID`" == "healthy" ] | ||
then | ||
HEALTHY=true | ||
echo "$CONTAINER_NAME is healthy" | ||
else | ||
if [ $TOTAL_COUNT -eq 15 ] | ||
then | ||
echo "$CONTAINER_NAME fails to start" | ||
exit 1 | ||
fi | ||
echo "Waiting for $CONTAINER_NAME to be ready..." | ||
sleep 2 | ||
TOTAL_COUNT=$[$TOTAL_COUNT +1] | ||
fi | ||
done | ||
done | ||
|
||
sleep 5 |
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 @@ | ||
#!/bin/sh | ||
|
||
# install glpi database | ||
docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && php bin/console db:install -H db -u glpi -p glpi -d glpi -n -r" | ||
|
||
# install our plugin | ||
docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && php bin/console plugin:install -u glpi jamf" | ||
docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi && php bin/console plugin:activate jamf" |
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,2 @@ | ||
#!/bin/sh | ||
docker exec --user www-data glpi /bin/bash -c "cd /var/www/glpi/plugins/jamf && vendor/bin/phpstan analyze -c phpstan.neon --memory-limit 256M" |
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker-compose down --volumes |
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,27 @@ | ||
name: Jamf Plugin CI | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
workflow_dispatch: | ||
jobs: | ||
ci: | ||
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- { glpi-version: "10.0.x", php-version: "7.4", db-image: "mariadb:10.5" } | ||
- { glpi-version: "10.0.x", php-version: "8.1", db-image: "mariadb:10.5" } | ||
- { glpi-version: "10.0.x", php-version: "8.2", db-image: "mariadb:11.0" } | ||
uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1" | ||
with: | ||
plugin-key: "jamf" | ||
glpi-version: "${{ matrix.glpi-version }}" | ||
php-version: "${{ matrix.php-version }}" | ||
db-image: "${{ matrix.db-image }}" |
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,2 +1,3 @@ | ||
vendor | ||
composer.lock | ||
composer.lock | ||
.phpunit.result.cache |
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,18 +1,24 @@ | ||
{ | ||
"require": { | ||
"php": "^7.4" | ||
}, | ||
"require-dev": { | ||
"glpi-project/tools": "^0.7.2" | ||
}, | ||
"config": { | ||
"optimize-autoloader": true, | ||
"platform": { | ||
"php": "7.4.0" | ||
"require": { | ||
"php": "~7.4.0|~8.0.0|~8.1.0|~8.2.0" | ||
}, | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": false | ||
"require-dev": { | ||
"glpi-project/tools": "^0.7.2", | ||
"phpstan/phpstan": "^1.10", | ||
"phpunit/phpunit": "~9.6" | ||
}, | ||
"config": { | ||
"optimize-autoloader": true, | ||
"platform": { | ||
"php": "7.4" | ||
}, | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": false | ||
} | ||
}, | ||
"scripts": { | ||
"test": "phpunit -c phpunit.xml", | ||
"phpstan": "phpstan analyse -c phpstan.neon" | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.