Skip to content

Commit d29040c

Browse files
authored
Merge pull request #193 from ethosengine/staging
CI/CD consistency updates
2 parents d0741f9 + 727b397 commit d29040c

27 files changed

Lines changed: 172 additions & 271 deletions

Jenkinsfile

Lines changed: 5 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*
77
* What this pipeline builds:
88
* - elohim-app Angular application
9-
* - UI Playground (dev branches only, when elohim-ui-playground/** changes)
109
* - Docker images pushed to Harbor registry
1110
*
1211
* Environment Architecture:
@@ -868,144 +867,8 @@ BRANCH_NAME=${env.BRANCH_NAME}"""
868867
}
869868
}
870869

871-
stage('Install UI Playground Dependencies') {
872-
when {
873-
allOf {
874-
expression { env.PIPELINE_SKIPPED != 'true' }
875-
not { branch 'main' }; not { branch 'staging' }
876-
changeset "elohim-ui-playground/**"
877-
}
878-
}
879-
steps {
880-
container('builder'){
881-
dir('elohim-library') {
882-
script {
883-
echo 'Installing npm dependencies for UI Playground workspace'
884-
sh 'npm ci'
885-
}
886-
}
887-
}
888-
}
889-
}
890-
891-
stage('Build UI Playground') {
892-
when {
893-
allOf {
894-
expression { env.PIPELINE_SKIPPED != 'true' }
895-
not { branch 'main' }; not { branch 'staging' }
896-
changeset "elohim-ui-playground/**"
897-
}
898-
}
899-
steps {
900-
container('builder'){
901-
dir('elohim-library') {
902-
script {
903-
echo 'Building lamad-ui library'
904-
sh 'npm run build lamad-ui'
905-
906-
echo 'Building UI Playground Angular application'
907-
sh 'npm run build elohim-ui-playground -- --base-href=/ui-playground/'
908-
sh 'ls -la dist/'
909-
}
910-
}
911-
}
912-
}
913-
}
914-
915-
stage('Build UI Playground Image') {
916-
when {
917-
allOf {
918-
expression { env.PIPELINE_SKIPPED != 'true' }
919-
not { branch 'main' }; not { branch 'staging' }
920-
changeset "elohim-ui-playground/**"
921-
}
922-
}
923-
steps {
924-
container('builder'){
925-
script {
926-
def props = loadBuildVars()
927-
928-
withBuildVars(props) {
929-
echo 'Building UI Playground container image'
930-
echo "Image tag: ${IMAGE_TAG}"
931-
932-
sh """#!/bin/bash
933-
set -euo pipefail
934-
935-
# Verify BuildKit
936-
buildctl --addr unix:///run/buildkit/buildkitd.sock debug workers > /dev/null
937-
938-
# Create build context
939-
mkdir -p /tmp/build-context-playground
940-
cp -r elohim-library /tmp/build-context-playground/
941-
cp elohim-ui-playground/images/Dockerfile.ui-playground /tmp/build-context-playground/Dockerfile
942-
cp elohim-ui-playground/images/nginx-ui-playground.conf /tmp/build-context-playground/
943-
944-
# Build image
945-
cd /tmp/build-context-playground
946-
BUILDKIT_HOST=unix:///run/buildkit/buildkitd.sock \\
947-
nerdctl -n k8s.io build -t elohim-ui-playground:${IMAGE_TAG} -f Dockerfile .
948-
949-
# Additional tags
950-
nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} elohim-ui-playground:${GIT_COMMIT_HASH}
951-
952-
if [ "${BRANCH_NAME}" = "main" ]; then
953-
nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} elohim-ui-playground:latest
954-
fi
955-
"""
956-
957-
echo 'UI Playground container image built successfully'
958-
}
959-
}
960-
}
961-
}
962-
}
963-
964-
stage('Push UI Playground to Harbor Registry') {
965-
when {
966-
allOf {
967-
expression { env.PIPELINE_SKIPPED != 'true' }
968-
not { branch 'main' }; not { branch 'staging' }
969-
changeset "elohim-ui-playground/**"
970-
}
971-
}
972-
steps {
973-
container('builder'){
974-
script {
975-
def props = loadBuildVars()
976-
977-
withBuildVars(props) {
978-
withCredentials([usernamePassword(credentialsId: 'harbor-robot-registry', passwordVariable: 'HARBOR_PASSWORD', usernameVariable: 'HARBOR_USERNAME')]) {
979-
echo 'Logging into Harbor registry'
980-
sh 'echo $HARBOR_PASSWORD | nerdctl -n k8s.io login harbor.ethosengine.com -u $HARBOR_USERNAME --password-stdin'
981-
982-
echo "Tagging and pushing UI Playground image: ${IMAGE_TAG}"
983-
sh """
984-
nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-ui-playground:${IMAGE_TAG}
985-
nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-ui-playground:${GIT_COMMIT_HASH}
986-
987-
nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-ui-playground:${IMAGE_TAG}
988-
nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-ui-playground:${GIT_COMMIT_HASH}
989-
"""
990-
991-
if (env.BRANCH_NAME == 'main') {
992-
sh """
993-
nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-ui-playground:latest
994-
nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-ui-playground:latest
995-
"""
996-
}
997-
998-
echo 'Successfully pushed UI Playground to Harbor registry'
999-
}
1000-
}
1001-
}
1002-
}
1003-
}
1004-
}
1005-
1006-
// Note: Holochain infrastructure (holochain/**) is built by a separate pipeline
1007-
// (elohim-edge) that triggers independently via webhook when holochain files change.
1008-
// This avoids duplicate builds and allows parallel execution.
870+
// Note: Holochain infrastructure is built by elohim-edge pipeline,
871+
// triggered by the orchestrator when holochain source files change.
1009872

1010873
stage('Deploy to Staging') {
1011874
when {
@@ -1020,7 +883,7 @@ BRANCH_NAME=${env.BRANCH_NAME}"""
1020883
def props = loadBuildVars()
1021884
withBuildVars(props) {
1022885
deployAppToEnvironment('staging', 'elohim-staging', 'elohim-site-staging',
1023-
'elohim-app/manifests/staging-deployment.yaml', IMAGE_TAG)
886+
'orchestrator/manifests/elohim-app/staging.yaml', IMAGE_TAG)
1024887
}
1025888
}
1026889
}
@@ -1050,7 +913,7 @@ BRANCH_NAME=${env.BRANCH_NAME}"""
1050913
"""
1051914

1052915
deployAppToEnvironment('alpha', 'elohim-alpha', 'elohim-site-alpha',
1053-
'elohim-app/manifests/alpha-deployment.yaml', IMAGE_TAG)
916+
'orchestrator/manifests/elohim-app/alpha.yaml', IMAGE_TAG)
1054917

1055918
echo """
1056919
═══════════════════════════════════════════════════════════
@@ -1141,37 +1004,6 @@ BRANCH_NAME=${env.BRANCH_NAME}"""
11411004
}
11421005
}
11431006

1144-
stage('Deploy UI Playground to Alpha') {
1145-
when {
1146-
allOf {
1147-
expression { env.PIPELINE_SKIPPED != 'true' }
1148-
expression { env.BRANCH_NAME == 'dev' || env.BRANCH_NAME ==~ /feat-.+/ || env.BRANCH_NAME ==~ /claude\/.+/ }
1149-
changeset "elohim-ui-playground/**"
1150-
}
1151-
}
1152-
steps {
1153-
container('builder'){
1154-
script {
1155-
def props = loadBuildVars()
1156-
1157-
withBuildVars(props) {
1158-
echo "Deploying UI Playground to Alpha: ${IMAGE_TAG}"
1159-
1160-
// Update deployment manifest
1161-
sh "sed 's/BUILD_NUMBER_PLACEHOLDER/${IMAGE_TAG}/g' elohim-ui-playground/manifests/alpha-deployment-ui-playground.yaml > elohim-ui-playground/manifests/alpha-deployment-ui-playground-${IMAGE_TAG}.yaml"
1162-
1163-
// Deploy
1164-
sh "kubectl apply -f elohim-ui-playground/manifests/alpha-deployment-ui-playground-${IMAGE_TAG}.yaml"
1165-
sh "kubectl rollout restart deployment/elohim-ui-playground-alpha -n elohim-alpha"
1166-
sh 'kubectl rollout status deployment/elohim-ui-playground-alpha -n elohim-alpha --timeout=300s'
1167-
1168-
echo 'UI Playground Alpha deployment completed!'
1169-
}
1170-
}
1171-
}
1172-
}
1173-
}
1174-
11751007
stage('E2E Testing - Alpha Validation') {
11761008
when {
11771009
allOf {
@@ -1254,7 +1086,7 @@ BRANCH_NAME=${env.BRANCH_NAME}"""
12541086
def props = loadBuildVars()
12551087
withBuildVars(props) {
12561088
deployAppToEnvironment('prod', 'elohim-prod', 'elohim-site',
1257-
'elohim-app/manifests/prod-deployment.yaml', IMAGE_TAG)
1089+
'orchestrator/manifests/elohim-app/prod.yaml', IMAGE_TAG)
12581090
}
12591091
}
12601092
}
@@ -1306,17 +1138,11 @@ BRANCH_NAME=${env.BRANCH_NAME}"""
13061138
nerdctl -n k8s.io rmi elohim-app:${GIT_COMMIT_HASH} || true
13071139
nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-site:${IMAGE_TAG} || true
13081140
nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-site:${GIT_COMMIT_HASH} || true
1309-
nerdctl -n k8s.io rmi elohim-ui-playground:${IMAGE_TAG} || true
1310-
nerdctl -n k8s.io rmi elohim-ui-playground:${GIT_COMMIT_HASH} || true
1311-
nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-ui-playground:${IMAGE_TAG} || true
1312-
nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-ui-playground:${GIT_COMMIT_HASH} || true
13131141
"""
13141142
if (env.BRANCH_NAME == 'main') {
13151143
sh """
13161144
nerdctl -n k8s.io rmi elohim-app:latest || true
13171145
nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-site:latest || true
1318-
nerdctl -n k8s.io rmi elohim-ui-playground:latest || true
1319-
nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-ui-playground:latest || true
13201146
"""
13211147
}
13221148
sh "nerdctl -n k8s.io system prune -af --volumes || true"

0 commit comments

Comments
 (0)