-
Notifications
You must be signed in to change notification settings - Fork 318
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
4 changed files
with
155 additions
and
65 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,53 @@ | ||
# build diy image based on debian bullseye and bookworm | ||
# test install.sh script as-it | ||
name: Test DIY install.sh | ||
|
||
# only trigger when last commit or PR modify install/** | ||
on: | ||
# only trigger CI when pull request on following branches and path | ||
pull_request: | ||
branches: | ||
- 'alpha' | ||
paths: | ||
- install/** | ||
# this is to manually trigger the worklow | ||
workflow_dispatch: | ||
inputs: | ||
logLevel: | ||
description: 'Reason' | ||
default: 'Manual launch' | ||
|
||
env: | ||
GITHUB_REPOSITORY: jeedom/core | ||
|
||
jobs: | ||
InstallationDIY: | ||
# This step build the same image on different runners / platforms | ||
strategy: | ||
# continue all jobs even if some fail | ||
fail-fast: false | ||
matrix: | ||
debian: [bullseye, bookworm ] | ||
targetRunner: [ ubuntu-latest] # [ ubuntu-latest, ARM, ARM64] | ||
database: [ 1] # [1, 0] | ||
|
||
runs-on: ${{ matrix.targetRunner }} | ||
steps: | ||
|
||
- name: Check Out Repo | ||
# Check out the repo, using current branch | ||
# https://github.com/marketplace/actions/checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: install jeedom:${{ matrix.debian }} | ||
# run current installation | ||
run: | | ||
echo "Running DIY install of ${GITHUB_REPOSITORY} / ${GITHUB_REF_NAME}" into ${{ matrix.debian }} >> ${GITHUB_STEP_SUMMARY} | ||
docker build -t jeedom:${{ matrix.debian }} -f tests/Dockerfile \ | ||
--build-arg DEBIAN=${{ matrix.debian }} \ | ||
--build-arg DATABASE=${{ matrix.database }} \ | ||
--build-arg WEBSERVER_HOME=/var/www/html \ | ||
--build-arg MARIADB_NAME=jeedom . \ | ||
docker run -p 80:80 -d --rm --name jeedom_${{ matrix.debian }} jeedom:${{ matrix.debian }} | ||
sleep 10 | ||
docker exec jeedom_${{ matrix.debian }} php sick.php |
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,32 @@ | ||
ARG DEBIAN=bookworm-slim | ||
|
||
FROM debian:${DEBIAN} | ||
|
||
ARG WEBSERVER_HOME=/var/www/html | ||
ENV WEBSERVER_HOME=${WEBSERVER_HOME} | ||
ARG VERSION=alpha | ||
ARG DATABASE=1 | ||
ARG MARIADB_NAME=jeedom | ||
ENV MARIADB_NAME=${MARIADB_NAME} | ||
WORKDIR ${WEBSERVER_HOME} | ||
|
||
COPY --chown=root:root --chmod=550 install/install.sh /install.sh | ||
RUN /install.sh -v ${VERSION} -w ${WEBSERVER_HOME} -d ${DATABASE} | ||
|
||
# créer le script d'init | ||
COPY --chown=root:root --chmod=550 <<EOF /root/init.sh | ||
#!/bin/bash | ||
# démarrer mariadb | ||
service mariadb start | ||
# démarrer atd | ||
service atd start | ||
# démarrer apache2 | ||
service apache2 start | ||
# démarrer cron | ||
service cron start | ||
# attendre à l'infini | ||
while :; do echo "$((COUNT++)) DAYS"; sleep 86400; done | ||
EOF | ||
|
||
# définir le script d'init comme commande par défaut | ||
CMD ["/root/init.sh"] |