Merge ccc7dcbafd into dd0be24762
commit
3d1dd673f7
@ -0,0 +1,23 @@
|
|||||||
|
name: Docker GLPI Build
|
||||||
|
|
||||||
|
#on: [push]
|
||||||
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: docker login
|
||||||
|
env:
|
||||||
|
DOCKER_USER: ${{ secrets.DOCKER_USER }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
|
||||||
|
- name: docker build glpi
|
||||||
|
run: |
|
||||||
|
docker build . -t aguyonnet/glpi:$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4) -t aguyonnet/glpi:latest
|
||||||
|
- name: docker push
|
||||||
|
run: |
|
||||||
|
docker push aguyonnet/glpi:$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4)
|
||||||
|
docker push aguyonnet/glpi:latest
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
#Prise de la latest
|
||||||
|
VERSION_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/latest | grep tag_name | cut -d '"' -f 4)
|
||||||
|
#Pour utiliser une version specifique:
|
||||||
|
#VERSION_GLPI=9.5.4
|
||||||
|
|
||||||
|
if [[ -z "${TIMEZONE}" ]]; then echo "TIMEZONE is unset";
|
||||||
|
else echo "date.timezone = \"$TIMEZONE\"" > /etc/php/7.3/apache2/conf.d/timezone.ini;
|
||||||
|
fi
|
||||||
|
|
||||||
|
SRC_GLPI=$(curl -s https://api.github.com/repos/glpi-project/glpi/releases/tags/${VERSION_GLPI} | jq .assets[0].browser_download_url | tr -d \")
|
||||||
|
TAR_GLPI=$(basename ${SRC_GLPI})
|
||||||
|
FOLDER_GLPI=glpi/
|
||||||
|
FOLDER_WEB=/var/www/html/
|
||||||
|
|
||||||
|
#check if TLS_REQCERT is present
|
||||||
|
if !(grep -q "TLS_REQCERT" /etc/ldap/ldap.conf)
|
||||||
|
then
|
||||||
|
echo "TLS_REQCERT isn't present"
|
||||||
|
echo -e "TLS_REQCERT\tnever" >> /etc/ldap/ldap.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Téléchargement et extraction des sources de GLPI
|
||||||
|
wget -P ${FOLDER_WEB} ${SRC_GLPI}
|
||||||
|
tar -xzf ${FOLDER_WEB}${TAR_GLPI} -C ${FOLDER_WEB}
|
||||||
|
rm -Rf ${FOLDER_WEB}${TAR_GLPI}
|
||||||
|
chown -R www-data:www-data ${FOLDER_WEB}${FOLDER_GLPI}
|
||||||
|
|
||||||
|
#Modification du vhost par défaut
|
||||||
|
echo -e "<VirtualHost *:80>\n\tDocumentRoot /var/www/html/glpi\n\n\t<Directory /var/www/html/glpi>\n\t\tAllowOverride All\n\t\tOrder Allow,Deny\n\t\tAllow from all\n\t</Directory>\n\n\tErrorLog /var/log/apache2/error-glpi.log\n\tLogLevel warn\n\tCustomLog /var/log/apache2/access-glpi.log combined\n</VirtualHost>" > /etc/apache2/sites-available/000-default.conf
|
||||||
|
|
||||||
|
#Add scheduled task by cron and enable
|
||||||
|
echo "*/2 * * * * www-data /usr/bin/php /var/www/html/glpi/front/cron.php &>/dev/null" >> /etc/cron.d/glpi
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
MYSQL_ROOT_PASSWORD=CHANGEME
|
||||||
|
MYSQL_DATABASE=glpidb
|
||||||
|
MYSQL_USER=glpi_user
|
||||||
|
MYSQL_PASSWORD=CHANGEME
|
||||||
Loading…
Reference in new issue