Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 319e77355f | |||
| 49a93eded8 | |||
| 27138013ba | |||
| 7c6145f62b | |||
| eaf14281a2 | |||
| 405e083e0d | |||
| 2d21fa1100 | |||
| 077d842a3c | |||
| 0ee019c890 | |||
| 8ebd780258 | |||
| 6fd3e65cc1 | |||
| ba36d4d72b | |||
| ed4b625c48 | |||
| a2f156db69 | |||
| fecf5e589f | |||
| 510a52d492 | |||
| 468669f0de | |||
| 7f2d3855e0 |
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "flows"]
|
||||
path = flows
|
||||
url = git@gitea-ssh.thoughtpatterns.ai:cellular/flows.git
|
||||
37
flow
Executable file
37
flow
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Flows
|
||||
source ./flows/base
|
||||
source ./flows/git
|
||||
source ./flows/packaging
|
||||
|
||||
# Vars
|
||||
BUILD_DIRECTORY="web"
|
||||
GITEA_ORGANIZATION="agreego"
|
||||
GITEA_REPOSITORY="site"
|
||||
|
||||
build() {
|
||||
# Create build directory if it doesn't exist
|
||||
mkdir -p "$PACKAGE_DIRECTORY"
|
||||
# Get version
|
||||
local version
|
||||
version=$(get-version) || return $?
|
||||
info "Building site version v$version..."
|
||||
# Create the tarball
|
||||
COPYFILE_DISABLE=1 tar -czf "$PACKAGE_DIRECTORY/$GITEA_REPOSITORY.tar.gz" -C "$BUILD_DIRECTORY" . || return 2
|
||||
success "Build complete"
|
||||
}
|
||||
|
||||
site-usage() {
|
||||
printf "build\tBuild the site.\n"
|
||||
}
|
||||
|
||||
site-flow() {
|
||||
case "$1" in
|
||||
build) build; return $?;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
register-flow "site-usage" "site-flow"
|
||||
dispatch "$@"
|
||||
1
flows
Submodule
1
flows
Submodule
Submodule flows added at e154758056
65
site
65
site
@ -1,65 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Colors for that visual bass drop 🎵
|
||||
RED='\033[31m'
|
||||
GREEN='\033[32m'
|
||||
YELLOW='\033[33m'
|
||||
BLUE='\033[34m'
|
||||
MAGENTA='\033[35m'
|
||||
CYAN='\033[36m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# Configuration
|
||||
BUILD_DIRECTORY="build"
|
||||
|
||||
# Source the release script
|
||||
GITEA_ORGANIZATION="agreego"
|
||||
GITEA_REPOSITORY="site"
|
||||
RELEASE_SCRIPT="../../thoughtpatterns/workspace/release.sh"
|
||||
if [ ! -f "$RELEASE_SCRIPT" ]; then
|
||||
echo -e "❌ ${RED}Release script not found at $RELEASE_SCRIPT${RESET}" >&2
|
||||
exit 1
|
||||
fi
|
||||
source "$RELEASE_SCRIPT"
|
||||
|
||||
env() {
|
||||
# Check if GITEA_TOKEN is set
|
||||
if [ -z "$GITEA_TOKEN" ]; then
|
||||
# If not set, try to get it from kubectl
|
||||
GITEA_TOKEN=$(kubectl get secret -n cellular gitea-git -o jsonpath='{.data.token}' | base64 --decode)
|
||||
if [ -z "$GITEA_TOKEN" ]; then
|
||||
echo -e "❌ ${RED}GITEA_TOKEN is not set and couldn't be retrieved from kubectl${RESET}" >&2
|
||||
exit 1
|
||||
fi
|
||||
export GITEA_TOKEN
|
||||
fi
|
||||
|
||||
echo -e "💰 ${GREEN}Environment variables set${RESET}"
|
||||
}
|
||||
|
||||
|
||||
|
||||
build() {
|
||||
# Create build directory if it doesn't exist
|
||||
mkdir -p "$PACKAGE_DIRECTORY"
|
||||
# Get version
|
||||
local version=$(get-version)
|
||||
|
||||
echo -e "📦 ${CYAN}Building site version ${GREEN}v$version${RESET}..."
|
||||
|
||||
# Create the tarball
|
||||
tar -czf "$PACKAGE_DIRECTORY/$GITEA_REPOSITORY.tar.gz" -C "$BUILD_DIRECTORY" .
|
||||
|
||||
echo -e "✨ ${GREEN}Build complete${RESET}"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
env) env;;
|
||||
build) env; build;;
|
||||
tag) env; tag;;
|
||||
package) env; package;;
|
||||
release) env; release;;
|
||||
*)
|
||||
echo "Usage: $0 {env|build|tag|package|release}"
|
||||
exit 1;;
|
||||
esac
|
||||
Reference in New Issue
Block a user