Skip to content

Commit 7673c9f

Browse files
committed
generate template alias before test run
1 parent 80aed03 commit 7673c9f

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

.github/workflows/build_test_template.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,10 @@ jobs:
5050
id: build-template
5151
working-directory: ./template
5252
run: |
53-
python build_ci.py 2>&1 | tee build_output.log
54-
TEMPLATE_ID=$(grep "Template created with ID:" build_output.log | sed 's/.*Template created with ID: \([^,]*\).*/\1/')
55-
BUILD_ID=$(grep -A 1 "Build ID:" build_output.log | tail -n 1 | xargs)
56-
echo "Captured Template ID: $TEMPLATE_ID"
57-
echo "Captured Build ID: $BUILD_ID"
53+
TEMPLATE_ID=$(uuidgen)
54+
echo "Building template with Template ID: $TEMPLATE_ID"
55+
python build_ci.py
5856
echo "template_id=$TEMPLATE_ID" >> $GITHUB_OUTPUT
59-
echo "build_id=$BUILD_ID" >> $GITHUB_OUTPUT
6057
env:
6158
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
6259
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
63-
64-
- name: Output template and build IDs
65-
run: |
66-
echo "Template ID from step output: ${{ steps.build-template.outputs.template_id }}"
67-
echo "Build ID from step output: ${{ steps.build-template.outputs.build_id }}"

template/build_ci.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import os
12
from e2b import Template, default_build_logger
23
from template import make_template
3-
from uuid import uuid4
44

55
Template.build(
66
make_template(set_user_workdir=True),
7-
alias="code-interpreter-ci-" + str(uuid4()),
7+
alias=os.environ["E2B_TESTS_TEMPLATE"],
88
cpu_count=2,
99
memory_mb=2048,
1010
on_build_logs=default_build_logger(),

0 commit comments

Comments
 (0)