Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.2] Add`:latest` tag option to build jobs (#214) #217

Merged
merged 1 commit into from
Feb 21, 2025
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
23 changes: 20 additions & 3 deletions .buildkite/publish/build-and-push-multiarch-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ source "$CURDIR/publish-common.sh"

# Set our tag name as well as the tag names of the individual platform images
TAG_NAME="${BASE_TAG_NAME}:${VERSION}"
LATEST_TAG_NAME="${BASE_TAG_NAME}:latest"
AMD64_TAG="${BASE_TAG_NAME}:${VERSION}-amd64"
ARM64_TAG="${BASE_TAG_NAME}:${VERSION}-arm64"

Expand All @@ -33,15 +34,31 @@ vault read -address "${VAULT_ADDR}" -field "${DOCKER_PASS_KEY}" "${VAULT_PATH}"
buildah login --username="${DOCKER_USER}" --password-stdin docker.elastic.co

# Create the manifest for the multiarch image
echo "Creating manifest..."
echo "Creating ${VERSION} manifest..."
buildah manifest create "$TAG_NAME" \
"$AMD64_TAG" \
"$ARM64_TAG"

# ... and push it
echo "Pushing manifest..."
echo "Pushing ${VERSION} manifest..."
buildah manifest push "$TAG_NAME" "docker://$TAG_NAME"

# Write out the final manifest for debugging purposes
echo "Built and pushed multiarch image... dumping final manifest..."
echo "Built and pushed ${VERSION} multiarch image... dumping final manifest..."
buildah manifest inspect "$TAG_NAME"

# Repeat for latest tag if applicable
if [[ "${APPLY_LATEST_TAG:-}" == "true" ]]; then
echo "Creating :latest manifest..."
buildah manifest create "$LATEST_TAG_NAME" \
"$AMD64_TAG" \
"$ARM64_TAG"

echo "Pushing :latest manifest..."
buildah manifest push "$LATEST_TAG_NAME" "docker://$LATEST_TAG_NAME"

echo "Built and pushed :latest multiarch image... dumping final manifest..."
buildah manifest inspect "$LATEST_TAG_NAME"
else
echo "No :latest manifest required."
fi
8 changes: 8 additions & 0 deletions .buildkite/publish/publish-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ PROJECT_ROOT=$(realpath "$(dirname "$BUILDKITE_DIR")")
VERSION_PATH="$PROJECT_ROOT/product_version"
VERSION=$(cat "$VERSION_PATH")
IS_SNAPSHOT=$(buildkite-agent meta-data get is_snapshot)
IS_LATEST=$(buildkite-agent meta-data get is_latest)

if [[ "${IS_SNAPSHOT:-}" == "false" && "${IS_LATEST:-}" == "true" ]]; then
# don't apply LATEST tag to SNAPSHOT builds
export APPLY_LATEST_TAG="true"
else
export APPLY_LATEST_TAG="false"
fi

export BUILDKITE_DIR
export PROJECT_ROOT
Expand Down
13 changes: 10 additions & 3 deletions .buildkite/release-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
steps:
- input: "Build information"
fields:
- select: "Build as SNAPSHOT"
- select: "Build as a SNAPSHOT?"
key: "is_snapshot"
options:
- label: "True"
- label: "Yes"
value: "true"
- label: "False"
- label: "No"
value: "false"
- select: "Apply :latest tag?"
key: "is_latest"
options:
- label: "Yes"
value: "true"
- label: "No"
value: "false"
- wait: ~
# ----
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ Open Crawler enables users to easily ingest web content into Elasticsearch.
Beta features are subject to change and are not covered by the support SLA of generally available (GA) features.
Elastic plans to promote this feature to GA in a future release.

_Open Crawler `v0.2` is confirmed to be compatible with Elasticsearch `v8.13.0` and above._
### ES Version Compatibility

| Elasticsearch | Open Crawler |
|---------------|--------------------|
| `8.x` | `v0.2.x` |
| `9.x` | `v0.2.1` and above |

### User workflow

Expand Down