Skip to content

Commit 62fd2bd

Browse files
committed
use build_tools ci image directly
1 parent 301205d commit 62fd2bd

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,23 @@ build_tools:
3030
- build-tools/**/*
3131
tags: ["arch:amd64"]
3232
script:
33-
- cd build-tools && docker buildx build --tag ${TARGET} --push .
33+
- cd build-tools && docker buildx build --tag ${TARGET}:testing-new-ci-image --push .
3434

3535
build_and_deploy_layer:
3636
stage: build_layer
3737
rules:
3838
- if: $CI_PIPELINE_SOURCE == "web"
3939
variables:
40-
CI_ENABLE_CONTAINER_IMAGE_BUILDS: "true"
4140
ROLE_TO_ASSUME: arn:aws:iam::425362996713:role/sandbox-layer-deployer
42-
TARGET: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-lambda-extension
41+
TARGET: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-lambda-extension:testing-new-ci-image
4342
tags: ["arch:amd64"]
43+
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-lambda-extension:testing-new-ci-image
4444
artifacts:
4545
paths:
4646
- tmp/serverless/datadog_extension_signed.zip
4747
script:
4848
- mkdir tmp
4949
- git clone --branch ${AGENT_BRANCH} --depth=1 https://github.com/DataDog/datadog-agent.git
50-
- dockerId=$(docker create --platform linux/amd64 ${TARGET})
51-
- docker cp $dockerId:/build_tools .
5250
- EXTERNAL_ID=$(aws ssm get-parameter
5351
--region us-east-1
5452
--name ci.datadog-lambda-extension.externalid
@@ -57,7 +55,7 @@ build_and_deploy_layer:
5755
--out text)
5856

5957
# build
60-
- ./build_tools
58+
- build_tools
6159
build
6260
--version 1
6361
--agent-version 1
@@ -68,7 +66,7 @@ build_and_deploy_layer:
6866
--artifact-name "datadog_extension.zip"
6967

7068
# sign
71-
- ./build_tools
69+
- build_tools
7270
sign
7371
--layer-path tmp/serverless/datadog_extension.zip
7472
--destination-path tmp/serverless/datadog_extension_signed.zip
@@ -80,7 +78,7 @@ build_and_deploy_layer:
8078

8179
# deploy to single region if needed
8280
- if [ "${REGION_TO_DEPLOY}" = "all" ]; then exit 0; fi
83-
- ./build_tools
81+
- build_tools
8482
deploy
8583
--layer-path tmp/serverless/datadog_extension_signed.zip
8684
--architecture amd64

build-tools/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ COPY Cargo.lock .
55
COPY src ./src
66
RUN cargo build --release
77

8-
FROM scratch
9-
COPY --from=builder /usr/src/app/target/release/build_tools /build_tools
10-
ENTRYPOINT ["/build_tools"]
8+
FROM 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:20.10-py3
9+
COPY --from=builder /usr/src/app/target/release/build_tools /usr/local/bin/

build-tools/src/commands/build_command.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ fn build_extension(cmd_path: &str, args: &BuildOptions) -> Result<()> {
4242
let destination_path = &args.destination_path;
4343
let dockerfile_path = &args.docker_path;
4444
let image_name = build_image(args, cmd_path, dockerfile_path.as_str())?;
45-
let docker_container_id = create_container(image_name.as_str())?;
46-
std::fs::create_dir(destination_path)?;
47-
copy_zip_file(args, docker_container_id.as_str(), destination_path)?;
48-
remove_container(&docker_container_id)?;
45+
// let docker_container_id = create_container(image_name.as_str())?;
46+
// std::fs::create_dir(destination_path)?;
47+
// copy_zip_file(args, docker_container_id.as_str(), destination_path)?;
48+
// remove_container(&docker_container_id)?;
4949
Ok(())
5050
}
5151

0 commit comments

Comments
 (0)