Skip to content

Commit

Permalink
chore: setup karrio-insiders and karrio-platform as submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Nov 23, 2024
1 parent 4b13afb commit d5fc597
Show file tree
Hide file tree
Showing 171 changed files with 2,740 additions and 193 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,32 @@ jobs:
docker push karrio/dashboard:${{ env.tag }}
docker tag karrio/dashboard:${{ env.tag }} karrio/dashboard:latest-rc
docker push karrio/dashboard:latest-rc
insiders-build:
needs: changes
if: ${{ needs.changes.outputs.version == 'true' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- id: get_tag
run: |
cat ./apps/api/karrio/server/VERSION
echo "tag=$(cat ./apps/api/karrio/server/VERSION)" >> "$GITHUB_ENV"
- name: Build insider server image
run: |
echo 'Build and push karrio-insiders server:${{ env.tag }}...'
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u USERNAME --password-stdin
./bin/build-insiders-image ${{ env.tag }} &&
docker push ghcr.io/karrioapi/server:${{ env.tag }} || exit 1
- name: Build insider dashboard image
run: |
echo 'Build and push karrio-insiders dashboard:${{ env.tag }}...'
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u USERNAME --password-stdin
KARRIO_IMAGE=ghcr.io/karrioapi/dashboard ./bin/build-dashboard-image ${{ env.tag }} &&
docker push ghcr.io/karrioapi/dashboard:${{ env.tag }} || exit 1
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,16 @@ apps/api/karrio/server/staticfiles/*
.karrio/
packages/karriojs/api/generated
!docker/.env

# Meta-repo private directories
meta/private/

# Testing
coverage/
.coverage
htmlcov/
.pytest_cache/

# Temporary files
*.tmp
*.backup
9 changes: 4 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[submodule "insiders"]
path = ee/insiders
url = [email protected]:karrioapi/karrio-insiders.git
branch = karrio-2024.12-rc1
path = ee/insiders
url = [email protected]:karrioapi/karrio-insiders.git
[submodule "ee/platform"]
path = ee/platform
url = [email protected]:karrioapi/karrio-platform.git
path = ee/platform
url = [email protected]:karrioapi/karrio-platform.git
20 changes: 0 additions & 20 deletions .vscode/karrio.code-workspace

This file was deleted.

48 changes: 48 additions & 0 deletions .vscode/workspace.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"folders": [
{
"name": "📦 Karrio (Root)",
"path": ".."
},
{
"name": "🔒 Karrio Insiders",
"path": "../ee/insiders"
},
{
"name": "🏢 Karrio Platform",
"path": "../ee/platform"
}
],
"settings": {
"files.exclude": {
"**/node_modules": true,
"**/__pycache__": true,
"**/*.pyc": true
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true
},
"editor.formatOnPaste": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"editor.formatOnSave": true,
"python.defaultInterpreterPath": "../.venv/karrio",
"files.associations": {
"**/*.html": "html",
"**/templates/**/*.html": "django-html",
"**/templates/**/*": "django-txt",
"**/requirements{/**,*}.{txt,in}": "pip-requirements"
},
"python.analysis.autoImportCompletions": true,
},
"extensions": {
"recommendations": [
"ms-python.python",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"eamodio.gitlens",
"github.copilot"
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions apps/platform/package.json → apps/board/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@karrio/platform",
"name": "@karrio/board",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --port 3002",
"dev:platform": "next dev --port 3002",
"dev:board": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 11 additions & 6 deletions bin/_env
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
#!/usr/bin/env bash

# Python virtual environment helpers
ROOT="$( pwd )"
ROOT="$(pwd)"
BASE_DIR="${ROOT##*/}"
ENV_DIR=".venv"
LOG_DIR=".karrio"
DIST="${ROOT:?}/${ENV_DIR}/dist"
INSIDERS_DIR="${ROOT:?}/../karrio-insiders"
INSIDERS_ROOT="${ROOT:?}/ee/insiders"
PLATFORM_ROOT="${ROOT:?}/ee/platform"

if [ -d "$INSIDERS_DIR" ]; then
if [ -d "$INSIDERS_ROOT/modules" ]; then
HAS_INSIDERS="true"
else
HAS_INSIDERS="false"
fi

if [ -d "$PLATFORM_ROOT/modules" ]; then
HAS_PLATFORM="true"
else
HAS_PLATFORM="false"
fi

mkdir -p "${DIST}" "${LOG_DIR}"

## icon vars
cross=$'\u274c'
check=$'\u2714'


clean_build_files() {
find $1 -type d -name dist -prune -exec rm -rf '{}' \; || true
find $1 -type d -name build -prune -exec rm -rf '{}' \; || true
# find $1 -type d -name "*.egg-info" -prune -exec rm -rf '{}' \; || true
}

backup_wheels() {
if [[ "$*" != *--ee* ]];
then
if [[ "$*" != *--ee* ]]; then
find "${1}/dist" -name \*.whl -prune -exec mv '{}' "${DIST}" \;
else
find "${1}/dist" -name \*.whl -prune -exec mv '{}' "${EE_DIST}" \;
Expand Down
15 changes: 9 additions & 6 deletions bin/build-dashboard-image
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env bash

echo building image karrio/dashboard:$1 ...
docker build \
--no-cache \
-t karrio/dashboard:$1 \
--build-arg VERSION=$1 \
-f ./docker/dashboard/Dockerfile .
KARRIO_IMAGE=${KARRIO_IMAGE:-"karrio/dashboard"}

echo building image ${KARRIO_IMAGE}:${TAG} ...

docker build -t ${KARRIO_IMAGE}:${TAG} \
--no-cache \
--build-arg VERSION=$1 \
-f ./docker/dashboard/Dockerfile \
. "${@:2}"
11 changes: 11 additions & 0 deletions bin/build-insiders-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

# Source environment variables
source "bin/_env"

echo 'building insiders server image...'
docker build -t ghcr.io/karrioapi/server:$1 \
-f "${ROOT}/docker/insiders/Dockerfile" \
--no-cache \
"${ROOT}" \
"${@:2}"
7 changes: 7 additions & 0 deletions bin/build-nginx-image
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

echo '> Building custom nginx image...'
docker build -f "docker/nginx/Dockerfile" \
-t ghcr.io/karrioapi/nginx:$1 \
--no-cache \
./docker/nginx "${@:2}"
Loading

0 comments on commit d5fc597

Please sign in to comment.