mirror of
https://github.com/Icinga/icinga-php-library.git
synced 2025-07-27 23:54:08 +02:00
Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ac844e6464 | ||
|
2afd0f67eb | ||
|
84c91fbac0 | ||
|
3e895ee7e6 | ||
|
7b1ea02863 | ||
|
ce45fede7e | ||
|
ca92d8e26e | ||
|
611ca4161b | ||
|
42dff4b0f6 | ||
|
b89aa9dfab | ||
|
65a24000de | ||
|
71c4555ff2 | ||
|
666262b018 | ||
|
7330e414a6 | ||
|
435e443a41 | ||
|
51a905fcfe | ||
|
2f5fc7ea9d | ||
|
7610682215 | ||
|
77c423f41c | ||
|
1aa0681e0f | ||
|
e5ef360ca4 | ||
|
28bc9342a5 | ||
|
e13e8de224 | ||
|
5b2f19db5e | ||
|
5e038a1d56 | ||
|
ec69390abd | ||
|
43db4ed1b9 | ||
|
ee11cd45f0 | ||
|
58eee4d45e | ||
|
e41703b420 | ||
|
5f5afe1540 | ||
|
a07e5f922a | ||
|
a83c093a88 | ||
|
cf2c560e2b | ||
|
c6a388c837 | ||
|
fba20337d7 | ||
|
0510cdda40 | ||
|
e3512954e3 | ||
|
72d4035a65 | ||
|
21348cd120 | ||
|
33b77b09b4 | ||
|
f4d823f1a1 | ||
|
0f43b60372 | ||
|
f0f46d2af3 | ||
|
d5c574afa3 | ||
|
f11035ba51 | ||
|
92f1fa39d6 | ||
|
0e067cf767 | ||
|
a1da3ab03f | ||
|
a61d30446b | ||
|
41fdbfbf6d | ||
|
15d91ced83 | ||
|
b95ef86df4 | ||
|
80c551fed6 | ||
|
7ccdde5601 | ||
|
56aaf91bd4 | ||
|
bdd1c5c9c2 | ||
|
e3a1a01f9e | ||
|
e58478287c |
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
.git* export-ignore
|
||||
bin/ export-ignore
|
||||
RELEASE.md export-ignore
|
39
.github/workflows/create-snapshot.yml
vendored
Normal file
39
.github/workflows/create-snapshot.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Create Snapshot
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Every day at 6pm
|
||||
- cron: "0 18 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
make-snapshot:
|
||||
name: Make a nightly snapshot
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'Icinga/icinga-php-library'
|
||||
|
||||
steps:
|
||||
- name: Checkout code base
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Prepare Git environment
|
||||
run: |
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
echo '{"github-oauth": {"github.com": "${{ secrets.ICINGABOT_TOKEN }}"}}' > auth.json
|
||||
echo 'auth.json' >> .gitignore
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.2'
|
||||
|
||||
- name: Create snapshot/nightly
|
||||
if: success()
|
||||
run: bin/make-snapshot.sh snapshot/nightly
|
||||
|
||||
- name: Push snapshot/nightly
|
||||
if: success()
|
||||
run: git push -f origin snapshot/nightly
|
13
.gitignore
vendored
13
.gitignore
vendored
@ -1,4 +1,9 @@
|
||||
/asset/
|
||||
/vendor/
|
||||
/.idea/
|
||||
.*.sw[op]
|
||||
# Exclude all hidden files
|
||||
.*
|
||||
# Except those related to Git
|
||||
!.git*
|
||||
|
||||
# Exclude assets and dependencies installed by composer
|
||||
composer.lock
|
||||
asset/
|
||||
vendor/
|
||||
|
13
README.md
13
README.md
@ -5,13 +5,14 @@ This project bundles all Icinga PHP libraries into one piece and can be integrat
|
||||
## Requirements
|
||||
|
||||
* [Icinga Web 2](https://github.com/Icinga/icingaweb2) (>= 2.9)
|
||||
* PHP (>= 5.6, 7+ recommended)
|
||||
* PHP (>= 8.2)
|
||||
|
||||
## Bundled Parts
|
||||
|
||||
* [ipl-html](https://github.com/Icinga/ipl-html)
|
||||
* [ipl-i18n](https://github.com/Icinga/ipl-i18n)
|
||||
* [ipl-orm](https://github.com/Icinga/ipl-orm)
|
||||
* [ipl-scheduler](https://github.com/Icinga/ipl-scheduler)
|
||||
* [ipl-sql](https://github.com/Icinga/ipl-sql)
|
||||
* [ipl-stdlib](https://github.com/Icinga/ipl-stdlib)
|
||||
* [ipl-validator](https://github.com/Icinga/ipl-validator)
|
||||
@ -24,8 +25,8 @@ path for Icinga Web 2 installations is: `/usr/share/icinga-php`
|
||||
|
||||
Download or clone this repository there (e.g. `/usr/share/icinga-php/ipl`) and you're done.
|
||||
|
||||
> **Note**: Do NOT install the GIT master, it will not work! Checking out a
|
||||
> branch like `stable/1.0.0` or a tag like `v1.0.0` is fine.
|
||||
> **Note**: Do NOT use the default branch, it will not work! Checking out a
|
||||
> branch like `stable/0.16.0` or a tag like `v0.16.0` is fine.
|
||||
|
||||
### Examples
|
||||
|
||||
@ -33,8 +34,8 @@ Download or clone this repository there (e.g. `/usr/share/icinga-php/ipl`) and y
|
||||
|
||||
```sh
|
||||
INSTALL_PATH="/usr/share/icinga-php/ipl"
|
||||
INSTALL_VERSION="v1.0.0"
|
||||
mkdir "$INSTALL_PATH"
|
||||
INSTALL_VERSION="v0.16.0"
|
||||
mkdir "$INSTALL_PATH" \
|
||||
&& wget -q "https://github.com/Icinga/icinga-php-library/archive/$INSTALL_VERSION.tar.gz" -O - \
|
||||
| tar xfz - -C "$INSTALL_PATH" --strip-components 1
|
||||
```
|
||||
@ -43,6 +44,6 @@ mkdir "$INSTALL_PATH"
|
||||
|
||||
```
|
||||
INSTALL_PATH="/usr/share/icinga-php/ipl"
|
||||
INSTALL_VERSION="stable/1.0.0"
|
||||
INSTALL_VERSION="stable/0.16.0"
|
||||
git clone https://github.com/Icinga/icinga-php-library.git "$INSTALL_PATH" --branch "$INSTALL_VERSION"
|
||||
```
|
||||
|
@ -8,4 +8,4 @@ e.g.
|
||||
|
||||
## Docker Example
|
||||
|
||||
docker run -it -v $(pwd):/tmp/pwd -w /tmp/pwd -v $(realpath ~/.gitconfig):/tmp/user/.gitconfig -e "HOME=/tmp/user" -u $(id -u):$(id -g) dev-docker_web56 bin/make-release.sh 1.0.0 --no-tag
|
||||
docker run -it -v $(pwd):/tmp/pwd -w /tmp/pwd -v $(realpath ~/.gitconfig):/tmp/user/.gitconfig -e "HOME=/tmp/user" -u $(id -u):$(id -g) dev-docker_web82 bin/make-release.sh 1.0.0 --no-tag
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION="$1"
|
||||
NO_TAG="$2"
|
||||
NO_OPT="$2"
|
||||
|
||||
if [[ -z $VERSION ]]; then
|
||||
echo "USAGE: $0 <version>"
|
||||
echo "USAGE: $0 <version> [--no-tag|--no-checkout]"
|
||||
echo " e.g.: $0 0.1.0"
|
||||
exit 1
|
||||
fi
|
||||
@ -23,22 +23,27 @@ if [[ "$TAG" -ne "0" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BRANCH="stable/$VERSION"
|
||||
git checkout -b "$BRANCH" || fail "Version branch $BRANCH already exists"
|
||||
git rm -rf vendor
|
||||
rm -rf vendor
|
||||
if [ "$NO_OPT" != "--no-checkout" ]; then
|
||||
BRANCH="stable/$VERSION"
|
||||
git checkout -b "$BRANCH" || fail "Version branch $BRANCH already exists"
|
||||
else
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
fi
|
||||
|
||||
git rm -rf --ignore-unmatch asset vendor
|
||||
rm -rf asset vendor
|
||||
rm -f composer.lock
|
||||
composer install --no-scripts || fail "composer install failed"
|
||||
composer run-script post-update-cmd -- copy-assets
|
||||
find vendor/ -type f -name "*.php" \
|
||||
| grep -v '/examples/' \
|
||||
| grep -v '/example/' \
|
||||
| grep -v '/tests/' \
|
||||
| grep -v '/test/' \
|
||||
| xargs -L1 git add -f
|
||||
find vendor/ -type f -name LICENSE | xargs -L1 git add -f
|
||||
find vendor/ -type f -name '*.json' | xargs -L1 git add -f
|
||||
find asset/ -type f | xargs -L1 git add -f
|
||||
find vendor/ -type f -name "*.php" -print0 \
|
||||
| grep -z -v '/examples/' \
|
||||
| grep -z -v '/example/' \
|
||||
| grep -z -v '/tests/' \
|
||||
| grep -z -v '/test/' \
|
||||
| xargs -0 -L1 git add -f
|
||||
find vendor/ -type f -name LICENSE -print0 | xargs -0 -L1 git add -f
|
||||
find vendor/ -type f -name '*.json' -print0 | xargs -0 -L1 git add -f
|
||||
find asset/ -type f -print0 | xargs -0 -L1 git add -f
|
||||
echo "v$VERSION" > VERSION
|
||||
git add VERSION
|
||||
git add composer.lock -f
|
||||
@ -48,7 +53,7 @@ rm -rf vendor
|
||||
git checkout vendor
|
||||
composer validate --no-check-all --strict || fail "Composer validate failed"
|
||||
|
||||
if [ "$NO_TAG" != "--no-tag" ]; then
|
||||
if [ -z "$NO_OPT" ]; then
|
||||
git tag -a v$VERSION -m "Version v$VERSION"
|
||||
echo "Finished, tagged v$VERSION"
|
||||
echo "Now please run:"
|
||||
|
39
bin/make-snapshot.sh
Executable file
39
bin/make-snapshot.sh
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -xe
|
||||
|
||||
BRANCH="$1"
|
||||
|
||||
if [ -z $BRANCH ]; then
|
||||
echo "USAGE: $0 <branch>"
|
||||
echo " e.g.: $0 snapshot/nightly"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LATEST_TAG=$(git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)' --count=1 | awk -F/ '{print $3}')
|
||||
NEXT_VERSION=$(echo "${LATEST_TAG:1}" | awk -F. -v OFS=. '{$3=0}; {++$2}; {print}')
|
||||
PHP_VERSION=$(echo "<?= join('.', [PHP_MAJOR_VERSION, PHP_MINOR_VERSION]); ?>" | php 2>/dev/null)
|
||||
|
||||
if [[ -n $(git branch | grep $BRANCH) ]]; then
|
||||
git branch -D $BRANCH
|
||||
fi
|
||||
|
||||
git checkout -b $BRANCH
|
||||
git merge --no-ff -m "Merge latest tag, to make it reachable for git-describe" $LATEST_TAG
|
||||
|
||||
composer config minimum-stability dev
|
||||
composer config prefer-stable true
|
||||
|
||||
composer require --no-update \
|
||||
php:">=$PHP_VERSION" \
|
||||
ipl/html:"dev-main as 99.x-dev" \
|
||||
ipl/i18n:"dev-main as 99.x-dev" \
|
||||
ipl/orm:"dev-main as 99.x-dev" \
|
||||
ipl/scheduler:"dev-main as 99.x-dev" \
|
||||
ipl/sql:"dev-main as 99.x-dev" \
|
||||
ipl/stdlib:"dev-main as 99.x-dev" \
|
||||
ipl/validator:"dev-main as 99.x-dev" \
|
||||
ipl/web:"dev-main as 99.x-dev"
|
||||
|
||||
git commit -a -m "Require dev-main everywhere"
|
||||
bin/make-release.sh "$NEXT_VERSION-dev" --no-checkout
|
@ -7,18 +7,19 @@
|
||||
"config": {
|
||||
"sort-packages": true,
|
||||
"platform": {
|
||||
"php": "5.6.3"
|
||||
"php": "8.2"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6.0",
|
||||
"ipl/html": "^0.4.0",
|
||||
"ipl/i18n": "^0.1.0",
|
||||
"ipl/orm": "^0.2.0",
|
||||
"ipl/sql": "^0.3.1",
|
||||
"ipl/stdlib": "^0.9.0",
|
||||
"ipl/validator": "^0.2.0",
|
||||
"ipl/web": "^0.2.0"
|
||||
"php": ">=8.2",
|
||||
"ipl/html": "^0.8.0",
|
||||
"ipl/i18n": "^0.2.0",
|
||||
"ipl/orm": "^0.7.0",
|
||||
"ipl/scheduler": "^0.1.0",
|
||||
"ipl/sql": "^0.7.0",
|
||||
"ipl/stdlib": "^0.14.0",
|
||||
"ipl/validator": "^0.5.0",
|
||||
"ipl/web": "^0.11.0"
|
||||
},
|
||||
"require-dev": {
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user