Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Adjust snapshot branch to build distribution Docker image #88

Merged
merged 2 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 0 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ pipeline {
DOCKER_REGISTRY_SECRET = 'secret/observability-team/ci/docker-registry/prod'
PIPELINE_LOG_LEVEL='INFO'
GO_VERSION = '1.13.12'
DOCKER_IMG = "${env.DOCKER_REGISTRY}/package-registry/distribution"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kuisathaverat for now, I just made this up. Not sure if this is going to work.

The goal is that as soon as this PR is merged, it pushes to docker.elastic.co/package-registry/distribution:snapshot.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, the pipeline uses the BRANCH_NAME as tag so it will push to docker.elastic.co/package-registry/distribution:master, we push for every branch or tag.

if we want to change it to docker.elastic.co/package-registry/distribution:snapshot for the master branch it is easy to make, Do we want to publish other branches to that namespace (docker.elastic.co/package-registry)?

I see that there is a branch name snapshot, it push to docker.elastic.co/package-registry/distribution:snapshot but is not the master branch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is against the snapshot branch. Does this mean it is just going to work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch!!, I didn't realize that the PR is against the snapshot branch, yep it makes the thing

DOCKER_IMG_PR = "${env.DOCKER_REGISTRY}/observability-ci/package-registry/distribution"
}
options {
timeout(time: 1, unit: 'HOURS')
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Here the version of the registry is specified this storage branch uses.
# It should always be a specific version to make sure builds are reproducible.
ARG PACKAGE_REGISTRY=57d417a84fa038cfb50a0cd661372c194199b3fd
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsoriano Registry version is fixed. Here it is a commit hash but i expect it will become a released version soon.

FROM docker.elastic.co/package-registry/package-registry:${PACKAGE_REGISTRY}

LABEL package-registry=${PACKAGE_REGISTRY}

# Adds specific config and packages
COPY deployment/package-registry.yml /registry/config.yml
COPY packages /packages

# TODO: Find way to also copy in packages from staging and production

# Sanity check on the packages. If packages are not valid, container does not even build.
RUN ./package-registry -dry-run
6 changes: 6 additions & 0 deletions deployment/package-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package_paths:
- /packages

cache_time.search: 10s
cache_time.categories: 10s
cache_time.catch_all: 10s
5 changes: 2 additions & 3 deletions testing/environments/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ services:
- ./kibana.config.yml:/usr/share/kibana/config/kibana.yml

package-registry:
image: docker.elastic.co/package-registry/package-registry:master
build: ../../
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
retries: 300
interval: 1s
volumes:
- ../../build/public:/registry/public