@@ -77,36 +77,32 @@ jobs:
7777 version: 0.2
7878 env:
7979 variables:
80- TEST_ONE: "1"
80+ GH_TOKEN: ${{ github.token }}
8181 phases:
8282 install:
8383 commands:
84- - echo "install ${TEST_ONE}" | tee --append ./codebuild.out
85- - dnf install -y lshw || echo "dnf install failed"
84+ - touch ./codebuild.out
85+ - dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo || echo "dnf config-manager"
86+ - dnf install -y 'dnf-command(config-manager)' gh || echo "dnf install failed"
87+ - curl -LsSf https://astral.sh/uv/install.sh | sh && export PATH=$HOME/.local/bin:$PATH || "echo uv failed"
8688 pre_build:
8789 commands:
88- - echo "pre_build ${TEST_ONE}" | tee --append ./codebuild.out
89- - echo "=== OS ==="
90- - cat /etc/os-release
91- - echo "=== Kernel ==="
92- - uname -a
93- - echo "=== CPU ==="
94- - lscpu
95- - echo "=== Memory ==="
96- - free -h
97- - echo "=== Kisk ==="
98- - df -h
99- - echo "=== Block Devices ==="
100- - lsblk
101- - echo "=== Hardward Summary ==="
102- - lshw -short || echo "lshw failed"
90+ - echo "pre_build"
10391 build:
10492 commands:
105- - echo "build ${TEST_ONE}" | tee --append ./codebuild.out
106- - ls -alR
93+ - DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
94+ - CURRENT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || echo "")
95+ - CURRENT_TAG=$(git describe --tags --exact-match 2>/dev/null || echo "")
96+ - IS_RELEASE=$([[ -n "$CURRENT_TAG" ]] && echo "true" || echo "false")
97+ - IS_PRE_RELEASE=$([[ "$CURRENT_BRANCH" == "$DEFAULT_BRANCH" ]] && echo "true" || echo "false")
98+ - IS_PRE_MERGE=$([[ -z "$CURRENT_TAG" && "$CURRENT_BRANCH" != "$DEFAULT_BRANCH" ]] && echo "true" || echo "false")
99+ - if [[ "$IS_RELEASE" == "true" ]]; then echo "This is a release"; fi;
100+ - if [[ "$IS_PRE_RELEASE" == "true" ]]; then echo "This is a pre-release"; fi;
101+ - if [[ "$IS_PRE_MERGE" == "true" ]]; then echo "This is a pre-merge"; fi;
102+ - aws bedrock-runtime invoke-model --model-id 'global.anthropic.claude-opus-4-6-v1' --content-type 'application/json' --accept 'application/json' --body fileb://<(echo '{"anthropic_version":"bedrock-2023-05-31","max_tokens":1024,"messages":[{"role":"user","content":"Hello"}]}') --region 'us-east-1' output.json;
103+ - cat output.json | jq >> ./codebuild.out
107104 post_build:
108105 commands:
109- - echo "post_build ${TEST_ONE}" | tee --append ./codebuild.out
110106 - echo "Build completed with status $CODEBUILD_BUILD_SUCCEEDING"
111107 - cat ./codebuild.out
112108 artifacts:
0 commit comments