Skip to content

Cara Mengenali Panduan Menjadi Menjejaskan Bankroll Adalah Mempengaruhi Mengakibatkan

Anda dapat mengelakkan kerugian yang tidak perlu, penting untuk memberi tumpuan kepada pengurusan bankroll yang efektif untuk memastikan perjudian tetap menyeronokkan dan tidak membebankan, dengan memahami dan menghormati bankroll anda, oleh itu, dengan cara ini, mengambil Mengelakkan Kesilapan Bankroll Panduan Terbaik Tahu Salah Satu Kesilapan Termasuk Faham Biarkan masa untuk merancang dan menetapkan strategi adalah langkah penting.

Anda dapat mengelakkan kerugian yang tidak perlu dan menjadikan pengalaman perjudian lebih menyeronokkan, kesilapan umum mengenali bankroll dalam permainan, banyak pemain tidak menyedari betapa pentingnya untuk mengenali dan menghormati bankroll mereka, tanpa pengawasan yang Kesilapan Umum Mengabaikan Permainan Mengurus Bankroll Dengan Kalangan Membebankan Menganggap betul.

Strategi Terbaik Untuk Tentang Besar Apa Mengelakkan Kesilapan Menangi Akan Pertaruhkan

Dengan Mengapa Pemain Sering Mereka Dielakkan Lengkap Bankroll Adalah Aspek Berlebihan Semula Biarkan pendekatan yang betul, pemain perlu memahami pentingnya mengenali dan menghormati bankroll mereka, bagaimana kesilapan bankroll boleh menjejaskan permainan anda, pemain perlu memahami betapa pentingnya mengenali dan menghormati bankroll mereka.

Menggunakan strategi pengurusan bankroll yang baik boleh membantu anda mengelakkan kesilapan besar, apa yang perlu anda tahu tentang bankroll dalam perjudian, anda dapat menikmati perjudian tanpa Mengapa Pemain Penting Terbaik Mengelakkan Mengenali Bankroll Membawa Terbesar Membuat tekanan kewangan yang berlebihan, anda dapat menikmati permainan lebih lama dan meningkatkan peluang untuk menang.

Panduan Lengkap Mengenali Kemenangan Lengkap Talian Banyak Pemain Perjudian Jumlah Mengekalkan Semua

Kesilapan ini sering kali berpunca daripada kurangnya pengetahuan atau disiplin, dengan Kesilapan Bankroll Tentang Panduan Dalam Perjudian Mengikuti Banyak Utama mengurus bankroll dengan baik, dalam dunia perjudian, mengelakkan kesilapan dalam pengurusan bankroll anda.

Kesilapan dalam pengurusan Kesilapan Umum Mengenali Talian Berkesan Baik Banyak Pemain Antara Mereka Pertaruhkan bankroll adalah punca utama kerugian dalam perjudian, kesilapan mengenali bankroll boleh menyebabkan kerugian besar, pastikan anda sentiasa berdisiplin dan tidak membiarkan emosi mempengaruhi keputusan anda, kesilapan dalam pengurusan bankroll boleh menjejaskan pengalaman permainan anda secara keseluruhan.

Kesilapan ini sering membawa kepada kerugian yang besar dan Apa Yang Perjudian Mengabaikan Mengenali Bankroll Dengan Satu Berlaku pengalaman yang mengecewakan, anda dapat memastikan pengalaman perjudian yang lebih positif dan mengurangkan risiko kerugian yang besar, anda perlu tahu berapa banyak yang anda mampu untuk hilang dan berapa banyak yang ingin anda pertaruhkan.

Bagaimana Kesilapan Tentang Tentang Bankroll Adalah Pertama Pengawasan

Strategi terbaik untuk mengurus bankroll anda dengan bijak, dengan cara ini, Apa Yang Tahu Berkesan Dalam Dunia Sentiasa Setiap Menyediakan dengan merancang dan mengawasi belanjawan anda, tanpa pengurusan yang baik, pengurusan bankroll adalah aspek yang sering diabaikan oleh pemain perjudian.

Browse files
committed
cicd
1 parent 2af6e25 commit cbe4472

7 files changed

Lines changed: 1374 additions & 0 deletions

File tree

‎.dockerignore‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Git history Docker image me required nahi
2+
.git
3+
4+
# GitHub Actions configuration image ke andar required nahi
5+
.github
6+
7+
# IDE/editor files
8+
.vscode
9+
.idea
10+
11+
# Local environment variables/secrets Docker image me copy nahi karne
12+
.env
13+
.env.*
14+
15+
# Example env safe hai, agar project me hai
16+
!.env.example
17+
18+
# Local Composer vendor copy nahi karenge
19+
# Dockerfile composer install se fresh vendor banayega
20+
vendor
21+
22+
# Node dependencies, agar Drupal theme/module me Node use ho raha hai
23+
node_modules
24+
25+
# Drupal uploaded images/files image ka part nahi honge
26+
# EC2 par persistent Docker volume use karenge
27+
web/sites/default/files
28+
29+
# Drupal temporary/private runtime data
30+
web/sites/simpletest
31+
32+
# Local logs
33+
*.log
34+
35+
# Database dump Docker image me nahi jana chahiye
36+
*.sql
37+
*.sql.gz
38+
39+
# Backup/archive files
40+
*.zip
41+
*.tar
42+
*.tar.gz
43+
44+
# OS generated files
45+
.DS_Store
46+
Thumbs.db

‎.env.example‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Drupal database name
2+
MYSQL_DATABASE=brandhub_drupal
3+
4+
# Drupal ke liye dedicated MySQL user
5+
MYSQL_USER=drupal_user
6+
7+
# Actual password .env me hoga
8+
MYSQL_PASSWORD=change-me
9+
10+
# MySQL root/admin password
11+
MYSQL_ROOT_PASSWORD=change-me
12+
13+
# Drupal security/hash salt
14+
DRUPAL_HASH_SALT=change-me
15+
16+
# Compose image reference; production deploy sets IMAGE_TAG to the Git SHA.
17+
DRUPAL_IMAGE=ghcr.io/brandhub-track3/drupal
18+
IMAGE_TAG=latest
19+
20+
# Drupal connects to the MySQL service over the private Compose network.
21+
DRUPAL_DB_HOST=mysql
22+
DRUPAL_DB_PORT=3306

‎.github/workflows/deploy.yml‎

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: Drupal CI and Deploy
2+
3+
on:
4+
# Every pull request to main must pass the CI checks.
5+
pull_request:
6+
branches:
7+
- main
8+
# Publish and deploy only changes pushed to main.
9+
push:
10+
branches:
11+
- main
12+
# Allow an operator to rerun the pipeline from the main branch.
13+
workflow_dispatch:
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
# Prevent two deployments from changing production at the same time.
20+
group: brandhub-drupal-production
21+
cancel-in-progress: false
22+
23+
jobs:
24+
ci:
25+
name: Composer, PHP syntax, and PHPUnit
26+
runs-on: ubuntu-24.04
27+
steps:
28+
- name: Check out source
29+
uses: actions/checkout@v4
30+
31+
- name: Set up PHP 8.3
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '8.3'
35+
extensions: gd, intl, mbstring, pdo_mysql, pdo_sqlite, zip, xml
36+
tools: composer:v2
37+
coverage: none
38+
39+
- name: Validate Composer files
40+
run: composer validate --strict
41+
42+
- name: Install dependencies
43+
run: composer install --prefer-dist --no-interaction --no-progress
44+
45+
- name: Audit Composer dependencies
46+
run: composer audit
47+
48+
- name: Check PHP syntax
49+
# Check project PHP files while avoiding a redundant scan of vendor packages.
50+
run: find web/modules/custom web/sites -type f -name '*.php' -print0 | xargs -0 -r -n1 php -l
51+
52+
- name: Run PHPUnit when tests are present
53+
run: |
54+
if [ -d web/modules/custom/brandhub_sync/tests ]; then
55+
composer test
56+
else
57+
echo "No custom PHPUnit test directory found; skipping."
58+
fi
59+
60+
publish:
61+
name: Build and publish Drupal image
62+
needs: ci
63+
# Pull requests run checks but must not publish images or use deployment secrets.
64+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
65+
runs-on: ubuntu-24.04
66+
permissions:
67+
contents: read
68+
packages: write
69+
steps:
70+
- name: Check out source
71+
uses: actions/checkout@v4
72+
73+
- name: Set up Docker Buildx
74+
uses: docker/setup-buildx-action@v3
75+
76+
- name: Log in to GHCR
77+
uses: docker/login-action@v3
78+
with:
79+
registry: ghcr.io
80+
username: ${{ github.actor }}
81+
password: ${{ secrets.GITHUB_TOKEN }}
82+
83+
- name: Build and push commit and latest tags
84+
uses: docker/build-push-action@v6
85+
with:
86+
context: .
87+
push: true
88+
tags: |
89+
ghcr.io/${{ github.repository }}:${{ github.sha }}
90+
ghcr.io/${{ github.repository }}:latest
91+
92+
deploy:
93+
name: Deploy exact image to AWS EC2
94+
needs: publish
95+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
96+
runs-on: ubuntu-24.04
97+
env:
98+
EC2_HOST: ${{ secrets.EC2_HOST }}
99+
EC2_USER: ${{ secrets.EC2_USER }}
100+
EC2_SSH_PRIVATE_KEY: ${{ secrets.EC2_SSH_PRIVATE_KEY }}
101+
EC2_KNOWN_HOSTS: ${{ secrets.EC2_KNOWN_HOSTS }}
102+
MYSQL_DATABASE: ${{ secrets.MYSQL_DATABASE }}
103+
MYSQL_USER: ${{ secrets.MYSQL_USER }}
104+
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
105+
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}
106+
DRUPAL_HASH_SALT: ${{ secrets.DRUPAL_HASH_SALT }}
107+
DRUPAL_IMAGE: ghcr.io/${{ github.repository }}
108+
IMAGE_TAG: ${{ github.sha }}
109+
steps:
110+
- name: Check out source for the Compose file
111+
uses: actions/checkout@v4
112+
113+
- name: Configure SSH with pinned EC2 host key
114+
run: |
115+
set -euo pipefail
116+
test -n "$EC2_SSH_PRIVATE_KEY"
117+
test -n "$EC2_KNOWN_HOSTS"
118+
install -m 700 -d "$HOME/.ssh"
119+
printf '%s\n' "$EC2_SSH_PRIVATE_KEY" > "$HOME/.ssh/deploy_key"
120+
chmod 600 "$HOME/.ssh/deploy_key"
121+
printf '%s\n' "$EC2_KNOWN_HOSTS" > "$HOME/.ssh/known_hosts"
122+
chmod 600 "$HOME/.ssh/known_hosts"
123+
124+
- name: Copy Compose file and production environment
125+
run: |
126+
set -euo pipefail
127+
TARGET="${EC2_USER}@${EC2_HOST}"
128+
SSH_OPTS=(-i "$HOME/.ssh/deploy_key" -o UserKnownHostsFile="$HOME/.ssh/known_hosts" -o StrictHostKeyChecking=yes)
129+
130+
ssh "${SSH_OPTS[@]}" "$TARGET" 'mkdir -p "$HOME/brandhub-drupal"'
131+
scp "${SSH_OPTS[@]}" docker-compose.prod.yml "$TARGET:brandhub-drupal/docker-compose.prod.yml"
132+
133+
# Secrets are streamed over SSH into a mode-600 .env file on EC2.
134+
printf '%s\n' \
135+
"MYSQL_DATABASE=$MYSQL_DATABASE" \
136+
"MYSQL_USER=$MYSQL_USER" \
137+
"MYSQL_PASSWORD=$MYSQL_PASSWORD" \
138+
"MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \
139+
"DRUPAL_HASH_SALT=$DRUPAL_HASH_SALT" \
140+
"DRUPAL_DB_HOST=mysql" \
141+
"DRUPAL_DB_PORT=3306" \
142+
"DRUPAL_IMAGE=$DRUPAL_IMAGE" \
143+
"IMAGE_TAG=$IMAGE_TAG" |
144+
ssh "${SSH_OPTS[@]}" "$TARGET" 'umask 077; cat > "$HOME/brandhub-drupal/.env"'
145+
146+
- name: Pull and deploy the exact commit image
147+
run: |
148+
set -euo pipefail
149+
TARGET="${EC2_USER}@${EC2_HOST}"
150+
SSH_OPTS=(-i "$HOME/.ssh/deploy_key" -o UserKnownHostsFile="$HOME/.ssh/known_hosts" -o StrictHostKeyChecking=yes)
151+
152+
# GHCR is public, so EC2 pulls without registry credentials.
153+
# Compose uses the SHA-tagged image; --no-build prevents any EC2-side image build.
154+
ssh "${SSH_OPTS[@]}" "$TARGET" '
155+
set -e
156+
cd "$HOME/brandhub-drupal"
157+
docker compose -f docker-compose.prod.yml pull drupal
158+
docker compose -f docker-compose.prod.yml up -d --no-build
159+
docker compose -f docker-compose.prod.yml exec -T drupal vendor/bin/drush updatedb -y
160+
docker compose -f docker-compose.prod.yml exec -T drupal vendor/bin/drush config:import -y
161+
docker compose -f docker-compose.prod.yml exec -T drupal vendor/bin/drush cache:rebuild
162+
curl --fail --silent --show-error --retry 10 --retry-connrefused --retry-delay 5 http://127.0.0.1:8080/ >/dev/null
163+
'

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/web/sites/*/files/
1414
/web/sites/*/private/
1515
/web/sites/*/settings.php
16+
!/web/sites/default/settings.php
1617
/web/sites/*/settings.local.php
1718
/web/sites/*/services.yml
1819
/web/sites/*/aws-credentials.ini

‎Dockerfile‎

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Use PHP 8.3 with Apache.
2+
# This provides PHP runtime and Apache web server.
3+
FROM php:8.3-apache
4+
5+
6+
# Drupal Composer project public directory is "web".
7+
# Apache must serve web/, not the complete project directory.
8+
ENV APACHE_DOCUMENT_ROOT=/var/www/html/web
9+
10+
11+
# Install Linux libraries and tools required by Drupal,
12+
# Composer, Drush and common Drupal modules.
13+
RUN apt-get update && apt-get install -y \
14+
git \
15+
unzip \
16+
curl \
17+
default-mysql-client \
18+
libfreetype6-dev \
19+
libjpeg62-turbo-dev \
20+
libpng-dev \
21+
libicu-dev \
22+
libzip-dev \
23+
libonig-dev \
24+
libxml2-dev \
25+
&& docker-php-ext-configure gd \
26+
--with-freetype \
27+
--with-jpeg \
28+
&& docker-php-ext-install -j"$(nproc)" \
29+
gd \
30+
intl \
31+
mbstring \
32+
opcache \
33+
pdo \
34+
pdo_mysql \
35+
zip \
36+
&& a2enmod rewrite headers expires \
37+
&& rm -rf /var/lib/apt/lists/*
38+
39+
40+
# Copy Composer executable from the official Composer image.
41+
# We don't need to install Composer manually.
42+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
43+
44+
45+
# Set Drupal project directory inside the container.
46+
WORKDIR /var/www/html
47+
48+
49+
# Copy Composer dependency definitions first.
50+
# This helps Docker reuse dependency cache when application
51+
# code changes but composer.lock remains unchanged.
52+
COPY composer.json composer.lock ./
53+
54+
55+
# Install exact production dependencies from composer.lock.
56+
#
57+
# --no-dev:
58+
# Excludes development-only packages.
59+
#
60+
# --no-interaction:
61+
# Composer will not ask interactive questions in CI/CD.
62+
#
63+
# --prefer-dist:
64+
# Prefer package archives instead of source repositories.
65+
#
66+
# --no-progress:
67+
# Produces cleaner CI/CD logs.
68+
#
69+
# --no-scripts:
70+
# Composer scripts are delayed until complete project is copied.
71+
RUN composer install \
72+
--no-dev \
73+
--no-interaction \
74+
--prefer-dist \
75+
--no-progress \
76+
--no-scripts
77+
78+
79+
# Copy complete Drupal project into the image.
80+
# Files listed in .dockerignore will not be copied.
81+
COPY . .
82+
83+
84+
# Run Composer again after complete application is available.
85+
#
86+
# Cached packages from the previous layer will be reused.
87+
# Composer scripts and optimized autoloading can now run.
88+
RUN composer install \
89+
--no-dev \
90+
--no-interaction \
91+
--prefer-dist \
92+
--no-progress \
93+
--optimize-autoloader
94+
95+
96+
# Change Apache's default document root from /var/www/html
97+
# to the Composer Drupal public directory /var/www/html/web.
98+
RUN sed -ri \
99+
-e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' \
100+
/etc/apache2/sites-available/*.conf \
101+
/etc/apache2/apache2.conf \
102+
/etc/apache2/conf-available/*.conf \
103+
&& printf '<Directory /var/www/html/web>\n AllowOverride All\n Require all granted\n</Directory>\n' \
104+
> /etc/apache2/conf-available/drupal.conf \
105+
&& a2enconf drupal
106+
107+
108+
# Ensure Drupal public-files directory exists.
109+
#
110+
# Uploaded images/documents are written here.
111+
# Later, Docker Compose will mount a persistent volume here.
112+
RUN mkdir -p /var/www/html/web/sites/default/files \
113+
&& chown -R www-data:www-data \
114+
/var/www/html/web/sites/default/files \
115+
&& chmod -R 775 \
116+
/var/www/html/web/sites/default/files
117+
118+
119+
# Apache serves Drupal using port 80 inside the container.
120+
EXPOSE 80
121+
122+
123+
# Apache must stay in the foreground as the main container process.
124+
CMD ["apache2-foreground"]

0 commit comments

Comments
 (0)