Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Build image for httpd-datadog GitLab CI.
# Build image for httpd-datadog CI.
#
# It contains:
# - musl toolchain whose binaries also run on glibc (musl-build-env, see
Expand Down
14 changes: 0 additions & 14 deletions .github/chainguard/self.gitlab.github-release.sts.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
needs: format
runs-on: ubuntu-22.04
container:
# Advanced by .gitlab/devcontainer-to-ghcr.yml after main builds.
# Published by .github/workflows/devcontainer.yml.
image: ghcr.io/datadog/httpd-datadog/devcontainer:main
credentials:
username: ${{ github.actor }}
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Devcontainer

on:
push:
branches: [main]
paths:
- .devcontainer/**
- scripts/setup-httpd.py
- .github/workflows/devcontainer.yml
pull_request:
paths:
- .devcontainer/**
- scripts/setup-httpd.py
- .github/workflows/devcontainer.yml
workflow_dispatch:

permissions:
contents: read

concurrency:
group: devcontainer-ghcr-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Stage build context and compute tags
id: image
shell: bash
run: |
make -f .devcontainer/devcontainer.mk .devcontainer-stage-context
image_hash=$(make -f .devcontainer/devcontainer.mk -s .devcontainer-image-hash)
image="ghcr.io/${GITHUB_REPOSITORY,,}/devcontainer"
{
echo 'tags<<EOF'
echo "$image:$image_hash"
if [[ "$GITHUB_REF" == refs/heads/main ]]; then
echo "$image:main"
fi
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Log in to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .devcontainer/.staged
file: .devcontainer/.staged/.devcontainer/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
provenance: false
tags: ${{ steps.image.outputs.tags }}
cache-from: type=gha,scope=devcontainer-amd64
cache-to: type=gha,scope=devcontainer-amd64,mode=max
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-22.04
container:
# Advanced by .gitlab/devcontainer-to-ghcr.yml after main builds.
# Published by .github/workflows/devcontainer.yml.
image: ghcr.io/datadog/httpd-datadog/devcontainer:main
credentials:
username: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
build-artifacts:
runs-on: ubuntu-22.04
container:
# Advanced by .gitlab/devcontainer-to-ghcr.yml after main builds.
# Published by .github/workflows/devcontainer.yml.
image: ghcr.io/datadog/httpd-datadog/devcontainer:main
credentials:
username: ${{ github.actor }}
Expand Down
21 changes: 0 additions & 21 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include:
- local: ".gitlab/ssi-package.yml"
- local: ".gitlab/one-pipeline.locked.yml"
- local: .gitlab/devcontainer.yml
- local: .gitlab/devcontainer-to-ghcr.yml

variables:
# Inputs to .gitlab/devcontainer.yml (the dd-repo-tools shared
Expand Down Expand Up @@ -42,26 +41,6 @@ stages:
- shared-pipeline-publish
- aws

devcontainer-ghcr-policy-check:
stage: .pre
image: registry.ddbuild.io/images/dd-octo-sts-ci-base:2025.07-1
tags: ["arch:amd64"]
needs: []
rules:
- changes:
paths:
- .github/chainguard/self.gitlab.github-release.sts.yaml
- .gitlab/devcontainer-to-ghcr.yml
- .gitlab-ci.yml
compare_to: refs/heads/main
- when: never
script:
- git config --global --add safe.directory "$CI_PROJECT_DIR"
- >
dd-octo-sts check --repo "$CI_PROJECT_DIR"
--scope "$DEVCONTAINER_GHCR_SCOPE" --policy "$DEVCONTAINER_GHCR_POLICY"
--skip-token-check

# Template jobs (hidden, reusable)
.build-template:
stage: build
Expand Down
92 changes: 0 additions & 92 deletions .gitlab/devcontainer-to-ghcr.yml

This file was deleted.

7 changes: 7 additions & 0 deletions doc/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ make dev-shell
GitLab CI status can be checked via `glab ci` on the [automated
mirror](https://gitlab.ddbuild.io/DataDog/httpd-datadog).

The [Devcontainer workflow](../.github/workflows/devcontainer.yml) builds the amd64 image
directly in GitHub Actions and publishes it to `ghcr.io/datadog/httpd-datadog/devcontainer`.
Changes to the build inputs on `main` publish both a content hash tag and `:main`, which the
GitHub build and test workflows use. Pull requests build the image without publishing it.
Run the workflow manually on `main` to bootstrap or refresh the image. Manual runs on other
branches publish only the content hash tag.

### Key Paths Inside the CI Image

- `/httpd` — httpd source
Expand Down
Loading