Compare commits
2 Commits
79dcd973c7
...
master
Author | SHA1 | Date | |
---|---|---|---|
59de1d3b6a
|
|||
56ffe2c3d1
|
49
.build/ci-helper
Executable file
49
.build/ci-helper
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
if [ "$CI" = "true" ]; then
|
||||
echo "Running in CI environment, skipping variable fetching..."
|
||||
else
|
||||
# Remove 'git@gitlab.com:' and '.git' and Extract namespace and project name
|
||||
GIT_REMOTE_URL=$(git config --get remote.origin.url)
|
||||
GITLAB_PATH=$(echo "$GIT_REMOTE_URL" | sed -e 's/^git@git.shihaam.dev://' -e 's/\.git$//')
|
||||
CI_PROJECT_NAMESPACE=$(echo "$GITLAB_PATH" | awk -F/ '{OFS="/"; $NF=""; print $0}' | sed 's:/$::')
|
||||
CI_PROJECT_NAME=$(basename "$GITLAB_PATH")
|
||||
# Set the registry image path
|
||||
|
||||
CI_REGISTRY_IMAGE="git.shihaam.dev/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME"
|
||||
|
||||
# Other variables
|
||||
CI_COMMIT_SHORT_SHA=$(git rev-parse HEAD | cut -c1-8)
|
||||
CI_COMMIT_SHA=$(git rev-parse HEAD)
|
||||
CI_COMMIT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
fi
|
||||
|
||||
CI_COMMIT_BRANCH=$(echo $CI_COMMIT_BRANCH | sed 's/\//-/g') # sanitize branch name
|
||||
|
||||
export CI_COMMIT_SHORT_SHA
|
||||
export CI_COMMIT_SHA
|
||||
export CI_COMMIT_BRANCH
|
||||
export CI_REGISTRY_IMAGE
|
||||
|
||||
|
||||
echo "Commit hash: $CI_COMMIT_SHA"
|
||||
echo "Branch: $CI_COMMIT_BRANCH"
|
||||
echo "Registry image: $CI_REGISTRY_IMAGE"
|
||||
|
||||
if [ "$1" = "push" ]; then
|
||||
docker compose push
|
||||
if [[ "$CI_COMMIT_BRANCH" == "master" || "$CI_COMMIT_BRANCH" == "main" ]]; then
|
||||
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE/fpm:latest
|
||||
docker tag $CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE/nginx:latest
|
||||
docker push $CI_REGISTRY_IMAGE/fpm:latest
|
||||
docker push $CI_REGISTRY_IMAGE/nginx:latest
|
||||
elif [[ "$CI_COMMIT_BRANCH" == "staging" ]]; then
|
||||
docker tag $CI_REGISTRY_IMAGE/fpm:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE/fpm:staging
|
||||
docker tag $CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA $CI_REGISTRY_IMAGE/nginx:staging
|
||||
docker push $CI_REGISTRY_IMAGE/fpm:staging
|
||||
docker push $CI_REGISTRY_IMAGE/nginx:staging
|
||||
fi
|
||||
else
|
||||
docker compose $@
|
||||
fi
|
21
.build/compose.yml
Normal file
21
.build/compose.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
services:
|
||||
fpm:
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: .build/fpm.Dockerfile
|
||||
args:
|
||||
CI_COMMIT_SHORT_SHA: ${CI_COMMIT_SHORT_SHA}
|
||||
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||
hostname: fpm
|
||||
image: $CI_REGISTRY_IMAGE/fpm:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: nginx.Dockerfile
|
||||
args:
|
||||
CI_COMMIT_SHORT_SHA: ${CI_COMMIT_SHORT_SHA}
|
||||
CI_COMMIT_SHA: ${CI_COMMIT_SHA}
|
||||
CI_COMMIT_BRANCH: ${CI_COMMIT_BRANCH}
|
||||
hostname: nginx
|
||||
image: $CI_REGISTRY_IMAGE/nginx:$CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA
|
36
.build/fpm.Dockerfile
Normal file
36
.build/fpm.Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
FROM composer:2.7.9 AS composer
|
||||
|
||||
FROM git.shihaam.dev/dockerfiles/php-fpm:8.2 AS composerinstall
|
||||
|
||||
WORKDIR /var/www/html
|
||||
COPY .. /var/www/html
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
|
||||
RUN --mount=type=cache,target=/root/.composer/cache \
|
||||
composer install --no-interaction --no-dev --optimize-autoloader
|
||||
|
||||
FROM git.shihaam.dev/dockerfiles/php-fpm:8.2
|
||||
|
||||
# Use bash as the default shell
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
WORKDIR /var/www/html
|
||||
COPY --from=composerinstall /var/www/html /var/www/html/
|
||||
|
||||
# Set the git envs
|
||||
ARG CI_COMMIT_SHORT_SHA
|
||||
ARG CI_COMMIT_SHA
|
||||
ARG CI_COMMIT_BRANCH
|
||||
ENV CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA
|
||||
ENV CI_COMMIT_SHA=$CI_COMMIT_SHA
|
||||
ENV CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH
|
||||
|
||||
RUN chown -R www-data:www-data storage/ \
|
||||
&& chmod -R ug+rw storage \
|
||||
&& chmod -R ug+x storage/framework storage/logs \
|
||||
&& chmod -R ug+rw bootstrap/cache \
|
||||
&& chmod -R ug+x bootstrap/cache
|
||||
RUN php artisan storage:link
|
||||
|
||||
# expose public dir for nginx to serve static files
|
||||
VOLUME /var/www/html/public
|
10
.build/nginx.Dockerfile
Normal file
10
.build/nginx.Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM git.shihaam.dev/dockerfiles/nginx-fpm:latest
|
||||
|
||||
|
||||
# Set the git envs
|
||||
ARG CI_COMMIT_SHORT_SHA
|
||||
ARG CI_COMMIT_SHA
|
||||
ARG CI_COMMIT_BRANCH
|
||||
ENV CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA
|
||||
ENV CI_COMMIT_SHA=$CI_COMMIT_SHA
|
||||
ENV CI_COMMIT_BRANCH=$CI_COMMIT_BRANCH
|
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@@ -1 +0,0 @@
|
||||
patreon: akaunting
|
21
.github/ISSUE_TEMPLATE.md
vendored
21
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,21 +0,0 @@
|
||||
Please, submit only real issues. Use the forum for support, feature requests, proposals, new versions, help etc. https://akaunting.com/forum
|
||||
|
||||
### Steps to reproduce the issue
|
||||
|
||||
|
||||
|
||||
### Expected result
|
||||
|
||||
|
||||
|
||||
### Actual result
|
||||
|
||||
|
||||
|
||||
### System information (Akaunting, PHP versions)
|
||||
|
||||
|
||||
|
||||
### Additional comments
|
||||
|
||||
|
63
.github/ISSUE_TEMPLATE/bug.yml
vendored
63
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -1,63 +0,0 @@
|
||||
name: Bug report
|
||||
description: File a bug report related to Akaunting
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to fill out this bug report!
|
||||
- type: input
|
||||
id: akaunting
|
||||
attributes:
|
||||
label: Akaunting version
|
||||
description: "Please provide the full Akaunting version of your installation."
|
||||
placeholder: "2.1.20"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: php
|
||||
attributes:
|
||||
label: PHP version
|
||||
description: "Please provide the full PHP version that is powering Akaunting."
|
||||
placeholder: "7.4.10"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: os
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: "Which operating system do you use? Please provide the version as well."
|
||||
placeholder: "Ubuntu 20.04"
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: steps
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: Which steps do we need to take to reproduce this error?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: expected
|
||||
attributes:
|
||||
label: Expected result
|
||||
description: What is the expected result?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: actual
|
||||
attributes:
|
||||
label: Actual result
|
||||
description: What is the actual result?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: comments
|
||||
attributes:
|
||||
label: Additional comments
|
||||
description: Anything else we should know about?
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Relevant log output
|
||||
description: Copy and paste any relevant log output. No need for backticks.
|
||||
render: shell
|
11
.github/ISSUE_TEMPLATE/config.yml
vendored
11
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,11 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Feature request
|
||||
url: https://akaunting.com/forum
|
||||
about: 'For ideas or feature requests, start a new discussion'
|
||||
- name: Support, help, and other
|
||||
url: https://akaunting.com/support
|
||||
about: 'This repository is only for reporting bugs'
|
||||
- name: Documentation
|
||||
url: https://github.com/akaunting/docs
|
||||
about: For documentation improvements, open a pull request at the akaunting/docs repository
|
51
.github/workflows/tests.yml
vendored
51
.github/workflows/tests.yml
vendored
@@ -1,51 +0,0 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
|
||||
name: PHP ${{ matrix.php }}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['8.1', '8.2']
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Cache Composer
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
extensions: bcmath, ctype, dom, fileinfo, intl, gd, json, mbstring, pdo, pdo_sqlite, openssl, sqlite, xml, zip
|
||||
coverage: none
|
||||
|
||||
- name: Copy .env
|
||||
run: cp .env.testing .env
|
||||
|
||||
- name: Install NPM
|
||||
run: npm install
|
||||
|
||||
- name: Compile assets
|
||||
run: npm run production
|
||||
|
||||
- name: Install Composer
|
||||
run: composer test
|
||||
|
||||
- name: Execute tests
|
||||
run: php artisan test --parallel
|
39
.github/workflows/translations.yml
vendored
39
.github/workflows/translations.yml
vendored
@@ -1,39 +0,0 @@
|
||||
name: Translations
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
name: Sync
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Sync with Crowdin
|
||||
uses: crowdin/github-action@master
|
||||
with:
|
||||
upload_sources: true
|
||||
upload_translations: true
|
||||
download_translations: true
|
||||
skip_untranslated_files: true
|
||||
|
||||
source: 'resources/lang/en-GB/*.php'
|
||||
translation: 'resources/lang/%locale%/%original_file_name%'
|
||||
|
||||
localization_branch_name: 'translations'
|
||||
commit_message: 'new crowdin translations'
|
||||
pull_request_title: 'New Crowdin translations'
|
||||
pull_request_body: 'https://crowdin.com/project/akaunting'
|
||||
pull_request_labels: 'Translation'
|
||||
|
||||
project_id: ${{ secrets.CROWDIN_CORE_ID }}
|
||||
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
32
compose.yml
Normal file
32
compose.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
services:
|
||||
fpm:
|
||||
hostname: fpm
|
||||
image: git.shihaam.dev/shihaam/akaunting/fpm
|
||||
volumes:
|
||||
- ./:/var/www/html/
|
||||
nginx:
|
||||
hostname: nginx
|
||||
image: git.shihaam.dev/shihaam/akaunting/nginx
|
||||
volumes_from:
|
||||
- fpm
|
||||
ports:
|
||||
- 9000:80
|
||||
# composer:
|
||||
# hostname: composer
|
||||
# image: composer:2.7.9
|
||||
# volumes:
|
||||
# - ./:/var/www/html/
|
||||
# working_dir: /var/www/html
|
||||
mariadb:
|
||||
image: mariadb:11.5.2
|
||||
hostname: mariadb
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||
- MYSQL_USER=user
|
||||
- MYSQL_PASSWORD=password
|
||||
- MYSQL_DATABASE=database
|
||||
volumes:
|
||||
- db:/var/lib/mysql
|
||||
volumes:
|
||||
db:
|
Reference in New Issue
Block a user