File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ IMAGE_TAG=$1
5+ GIT_COMMIT_HASH=$2
6+ BRANCH_NAME=$3
7+
8+ # Verify BuildKit
9+ buildctl --addr unix:///run/buildkit/buildkitd.sock debug workers > /dev/null
10+
11+ # Create build context
12+ mkdir -p /tmp/build-context
13+ cp -r elohim-app /tmp/build-context/
14+ cp images/Dockerfile /tmp/build-context/
15+ cp images/nginx.conf /tmp/build-context/
16+
17+ # Build image
18+ cd /tmp/build-context
19+ BUILDKIT_HOST=unix:///run/buildkit/buildkitd.sock \
20+ nerdctl -n k8s.io build -t elohim-app:${IMAGE_TAG} -f Dockerfile .
21+
22+ # Additional tags
23+ nerdctl -n k8s.io tag elohim-app:${IMAGE_TAG} elohim-app:${GIT_COMMIT_HASH}
24+
25+ if [ " ${BRANCH_NAME} " = " main" ]; then
26+ nerdctl -n k8s.io tag elohim-app:${IMAGE_TAG} elohim-app:latest
27+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ IMAGE_TAG=$1
5+ GIT_COMMIT_HASH=$2
6+ BRANCH_NAME=$3
7+
8+ # Verify BuildKit
9+ buildctl --addr unix:///run/buildkit/buildkitd.sock debug workers > /dev/null
10+
11+ # Create build context
12+ mkdir -p /tmp/build-context-playground
13+ cp -r elohim-library /tmp/build-context-playground/
14+ cp images/Dockerfile.ui-playground /tmp/build-context-playground/Dockerfile
15+ cp images/nginx-ui-playground.conf /tmp/build-context-playground/
16+
17+ # Build image
18+ cd /tmp/build-context-playground
19+ BUILDKIT_HOST=unix:///run/buildkit/buildkitd.sock \
20+ nerdctl -n k8s.io build -t elohim-ui-playground:${IMAGE_TAG} -f Dockerfile .
21+
22+ # Additional tags
23+ nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} elohim-ui-playground:${GIT_COMMIT_HASH}
24+
25+ if [ " ${BRANCH_NAME} " = " main" ]; then
26+ nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} elohim-ui-playground:latest
27+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ IMAGE_TAG=$1
5+ GIT_COMMIT_HASH=$2
6+ BRANCH_NAME=$3
7+
8+ echo ' Cleaning up Docker images...'
9+ nerdctl -n k8s.io rmi elohim-app:${IMAGE_TAG} || true
10+ nerdctl -n k8s.io rmi elohim-app:${GIT_COMMIT_HASH} || true
11+ nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-site:${IMAGE_TAG} || true
12+ nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-site:${GIT_COMMIT_HASH} || true
13+ nerdctl -n k8s.io rmi elohim-ui-playground:${IMAGE_TAG} || true
14+ nerdctl -n k8s.io rmi elohim-ui-playground:${GIT_COMMIT_HASH} || true
15+ nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-ui-playground:${IMAGE_TAG} || true
16+ nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-ui-playground:${GIT_COMMIT_HASH} || true
17+
18+ if [ " ${BRANCH_NAME} " = " main" ]; then
19+ nerdctl -n k8s.io rmi elohim-app:latest || true
20+ nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-site:latest || true
21+ nerdctl -n k8s.io rmi elohim-ui-playground:latest || true
22+ nerdctl -n k8s.io rmi harbor.ethosengine.com/ethosengine/elohim-ui-playground:latest || true
23+ fi
24+
25+ nerdctl -n k8s.io system prune -af --volumes || true
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ IMAGE_TAG=$1
5+
6+ AUTH_HEADER=" Authorization: Basic $( echo -n " $HARBOR_USERNAME :$HARBOR_PASSWORD " | base64) "
7+
8+ # Trigger scan
9+ wget --post-data=" " \
10+ --header=" accept: application/json" \
11+ --header=" Content-Type: application/json" \
12+ --header=" $AUTH_HEADER " \
13+ -S -O- \
14+ " https://harbor.ethosengine.com/api/v2.0/projects/ethosengine/repositories/elohim-site/artifacts/${IMAGE_TAG} /scan" || \
15+ echo " Scan request failed"
16+
17+ # Poll for completion
18+ MAX_ATTEMPTS=24
19+ ATTEMPT=1
20+
21+ while [ $ATTEMPT -le $MAX_ATTEMPTS ]; do
22+ VULN_DATA=$( wget -q -O- \
23+ --header=" accept: application/json" \
24+ --header=" $AUTH_HEADER " \
25+ " https://harbor.ethosengine.com/api/v2.0/projects/ethosengine/repositories/elohim-site/artifacts/${IMAGE_TAG} /additions/vulnerabilities" 2> /dev/null || echo " " )
26+
27+ if [ ! -z " $VULN_DATA " ] && echo " $VULN_DATA " | grep -q ' "scanner"' ; then
28+ echo " ✅ Scan completed"
29+ break
30+ fi
31+
32+ [ $(( ATTEMPT % 5 )) -eq 0 ] && echo " Waiting for scan (attempt $ATTEMPT /$MAX_ATTEMPTS )..."
33+ sleep 10
34+ ATTEMPT=$(( ATTEMPT + 1 ))
35+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ IMAGE_TAG=$1
5+ GIT_COMMIT_HASH=$2
6+ BRANCH_NAME=$3
7+
8+ nerdctl -n k8s.io tag elohim-app:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-site:${IMAGE_TAG}
9+ nerdctl -n k8s.io tag elohim-app:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-site:${GIT_COMMIT_HASH}
10+
11+ nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-site:${IMAGE_TAG}
12+ nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-site:${GIT_COMMIT_HASH}
13+
14+ if [ " ${BRANCH_NAME} " = " main" ]; then
15+ nerdctl -n k8s.io tag elohim-app:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-site:latest
16+ nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-site:latest
17+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ IMAGE_TAG=$1
5+ GIT_COMMIT_HASH=$2
6+ BRANCH_NAME=$3
7+
8+ nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-ui-playground:${IMAGE_TAG}
9+ nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-ui-playground:${GIT_COMMIT_HASH}
10+
11+ nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-ui-playground:${IMAGE_TAG}
12+ nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-ui-playground:${GIT_COMMIT_HASH}
13+
14+ if [ " ${BRANCH_NAME} " = " main" ]; then
15+ nerdctl -n k8s.io tag elohim-ui-playground:${IMAGE_TAG} harbor.ethosengine.com/ethosengine/elohim-ui-playground:latest
16+ nerdctl -n k8s.io push harbor.ethosengine.com/ethosengine/elohim-ui-playground:latest
17+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -euo pipefail
3+
4+ BASE_URL=$1
5+ ENV=$2
6+ GIT_COMMIT_HASH=$3
7+
8+ export CYPRESS_baseUrl=$BASE_URL
9+ export CYPRESS_ENV=$ENV
10+ export CYPRESS_EXPECTED_GIT_HASH=$GIT_COMMIT_HASH
11+ export NO_COLOR=1
12+ export DISPLAY=:99
13+
14+ # Start Xvfb
15+ Xvfb :99 -screen 0 1024x768x24 -ac > /dev/null 2>&1 &
16+ XVFB_PID=$!
17+ sleep 2
18+
19+ # Verify Cypress
20+ npx cypress verify > /dev/null
21+ mkdir -p cypress/reports
22+
23+ # Run tests
24+ npx cypress run \
25+ --headless \
26+ --browser chromium \
27+ --spec " cypress/e2e/staging-validation.feature"
28+
29+ # Cleanup
30+ kill $XVFB_PID 2> /dev/null || true
You can’t perform that action at this time.
0 commit comments