Compare commits
2 Commits
47fe502dc1
...
dev_cluste
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef249b1745 | ||
|
|
6c6de37419 |
@@ -43,7 +43,7 @@ Create the base directory and clone this environment:
|
|||||||
```bash
|
```bash
|
||||||
sudo mkdir -p /srv/env/aether
|
sudo mkdir -p /srv/env/aether
|
||||||
sudo chown -R $USER:$USER /srv/env/aether
|
sudo chown -R $USER:$USER /srv/env/aether
|
||||||
git clone https://bitbucket.org/oneskyit/one-sky-it-container-environment.git /srv/env/aether/container_env
|
git clone git@bitbucket.org:oneskyit/one-sky-it-container-environment.git /srv/env/aether/container_env
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Configure Environment Settings
|
### 3. Configure Environment Settings
|
||||||
|
|||||||
15
deploy.sh
15
deploy.sh
@@ -16,6 +16,18 @@
|
|||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
ensure_bitbucket_ssh_remote() {
|
||||||
|
local repo_path=$1
|
||||||
|
local remote_url
|
||||||
|
local remote_path
|
||||||
|
|
||||||
|
remote_url=$(git -C "$repo_path" remote get-url origin)
|
||||||
|
if [[ "$remote_url" =~ ^https://([^@/]+@)?bitbucket\.org/(.+)$ ]]; then
|
||||||
|
remote_path=${BASH_REMATCH[2]}
|
||||||
|
git -C "$repo_path" remote set-url origin "git@bitbucket.org:${remote_path}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
ENV=${1:-}
|
ENV=${1:-}
|
||||||
if [ -z "$ENV" ]; then
|
if [ -z "$ENV" ]; then
|
||||||
echo "Usage: $0 <prod|test> [app_branch] [api_branch]"
|
echo "Usage: $0 <prod|test> [app_branch] [api_branch]"
|
||||||
@@ -55,14 +67,17 @@ echo ""
|
|||||||
|
|
||||||
# --- Pull repos ---
|
# --- Pull repos ---
|
||||||
echo "[1/4] Pulling container env..."
|
echo "[1/4] Pulling container env..."
|
||||||
|
ensure_bitbucket_ssh_remote "$COMPOSE_DIR"
|
||||||
git -C "$COMPOSE_DIR" pull --ff-only
|
git -C "$COMPOSE_DIR" pull --ff-only
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "[2/4] Pulling app ($APP_BRANCH)..."
|
echo "[2/4] Pulling app ($APP_BRANCH)..."
|
||||||
|
ensure_bitbucket_ssh_remote "$APP_DIR"
|
||||||
git -C "$APP_DIR" pull --ff-only origin "$APP_BRANCH"
|
git -C "$APP_DIR" pull --ff-only origin "$APP_BRANCH"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "[3/4] Pulling API ($API_BRANCH)..."
|
echo "[3/4] Pulling API ($API_BRANCH)..."
|
||||||
|
ensure_bitbucket_ssh_remote "$API_DIR"
|
||||||
git -C "$API_DIR" pull --ff-only origin "$API_BRANCH"
|
git -C "$API_DIR" pull --ff-only origin "$API_BRANCH"
|
||||||
|
|
||||||
# --- Build and deploy ---
|
# --- Build and deploy ---
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
ports:
|
ports:
|
||||||
- "${AE_DOZZLE_PORT:-8881}:8080"
|
- "127.0.0.1:${AE_DOZZLE_PORT:-8881}:8080"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
logging:
|
logging:
|
||||||
driver: "json-file"
|
driver: "json-file"
|
||||||
|
|||||||
Reference in New Issue
Block a user