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

Release 7.3.1 version of che-plugin-registry #275

Merged
merged 21 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5742015
Adding openshift template for backwards compatibility required for th…
ibuziuk Oct 21, 2019
11710f3
allow check_plugins_viewer_mandatory_fields.sh to be run locally (#258)
nickboldt Oct 17, 2019
b1a4323
che #14896 Bumping version to '7.4.0-SNAPSHOT'. Adding '7.3.0' versio…
ibuziuk Oct 17, 2019
ae505e2
Use string value at `env.value` instead of boolean or integer.
monaka Oct 5, 2019
7bbf761
Add language supports for Xtext/Xtend.
monaka Oct 5, 2019
49d7d96
Add Kubernetes Che Plugin based on the VS Code Kubernetes extension 1…
azatsarynnyy Oct 21, 2019
71e059e
Add LS for Move by Libra
monaka Oct 5, 2019
55037f5
Add list of external images to server when offline registry is built …
amisevsk Oct 23, 2019
65b279f
Add redirect for resources to match one for plugins
amisevsk Oct 22, 2019
5ca46d4
Update how latest versions of plugins are handled (#260)
amisevsk Oct 24, 2019
329deb7
update from registry.access.redhat.com/rhscl/httpd-24-rhel7:2.4-104 t…
nickboldt Oct 24, 2019
f92d8dc
move up to v3/plugins/ms-kubernetes-tools/vscode-kubernetes-tools lat…
nickboldt Oct 24, 2019
5f12c12
Add init container to inject remote binary. (#233)
AndrienkoAleksandr Oct 25, 2019
247baf9
Fix regex used for processing image references (#272)
amisevsk Oct 25, 2019
b97a0e6
move ./list_referenced_images.sh to run in builder step (doesn't need…
nickboldt Oct 25, 2019
0bf7f15
che #14947 Bumping version to 7.3.1
ibuziuk Oct 28, 2019
dda0aec
che #14947 Adding 7.3.1 versions of 'che-theia' and 'che-machine-exec…
ibuziuk Oct 28, 2019
b74bffc
che #14947 Setting '7.3.1' version for container runtime images of th…
ibuziuk Oct 28, 2019
45bb005
Updating title & description of the '7.3.1' version of che-theia
ibuziuk Oct 28, 2019
869da1b
Setting '7.3.1' version of the container runtime image for vscode-kub…
ibuziuk Oct 28, 2019
03a07d0
Excluding 'pizzafactory' plugins from the '7.3.1' release
ibuziuk Oct 28, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ test-output/
.DAV

che-dto.ts
v3/**/latest/
1 change: 1 addition & 0 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "Authorization"
DirectoryIndex README.md
Redirect temp /plugins /v3/plugins
Redirect temp /resources /v3/resources
<FilesMatch "\.(json|yaml)$">
<IfModule mod_expires.c>
ExpiresActive Off
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ spec:
- name: HOSTED_PLUGIN_HOSTNAME
value: 0.0.0.0
- name: HOSTED_PLUGIN_PORT
value: 3130
value: "3130"
volumes:
- mountPath: /plugins
name: plugins
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.0
7.3.1
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ORGANIZATION="eclipse"
TAG="nightly"
LATEST_ONLY=false
OFFLINE=false
DOCKERFILE="./build/dockerfiles/Dockerfile"

USAGE="
Usage: ./build.sh [OPTIONS]
Expand All @@ -32,6 +33,8 @@ Options:
--offline
Build offline version of registry, with all extension artifacts
cached in the registry; disabled by default.
--rhel
Build using the rhel.Dockerfile instead of the default
"

function print_usage() {
Expand Down Expand Up @@ -62,6 +65,10 @@ function parse_arguments() {
OFFLINE=true
shift
;;
--rhel)
DOCKERFILE=./build/dockerfiles/rhel.Dockerfile
shift
;;
*)
print_usage
exit 0
Expand All @@ -77,14 +84,14 @@ if [ "$OFFLINE" = true ]; then
echo "in offline mode"
docker build \
-t "$IMAGE" \
-f ./build/dockerfiles/Dockerfile \
-f "$DOCKERFILE" \
--build-arg LATEST_ONLY="${LATEST_ONLY}" \
--target offline-registry .
else
echo ""
docker build \
-t "$IMAGE" \
-f ./build/dockerfiles/Dockerfile \
-f "$DOCKERFILE" \
--build-arg LATEST_ONLY="${LATEST_ONLY}" \
--target registry .
fi
7 changes: 4 additions & 3 deletions build/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ COPY /v3 /build/v3
WORKDIR /build/

RUN if [[ ${LATEST_ONLY} == "true" ]]; then \
rm -fr $(find /build/v3 -name 'meta.yaml' | grep -v "/latest/" | grep -o ".*/"); \
./keep_only_latest.sh; \
fi

RUN ./check_plugins_location.sh v3 && \
RUN ./generate_latest_metas.sh v3 && \
./check_plugins_location.sh v3 && \
./set_plugin_dates.sh v3 && \
./check_plugins_viewer_mandatory_fields.sh v3 && \
./ensure_latest_exists.sh && \
./index.sh v3 > /build/v3/plugins/index.json && \
./list_referenced_images.sh v3 > /build/v3/external_images.txt && \
chmod -R g+rwX /build

# Build registry, copying meta.yamls and index.json from builder
Expand Down
2 changes: 1 addition & 1 deletion build/dockerfiles/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ METAS_DIR="${METAS_DIR:-${DEFAULT_METAS_DIR}}"
# \4 - Image name portion of image, e.g. quay.io/eclipse/(che-theia):tag
# \5 - Tag of image, e.g. quay.io/eclipse/che-theia:(tag)
# \6 - Optional quotation following image reference
IMAGE_REGEX='([[:space:]]*"?)([._a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*):([._a-zA-Z0-9-]*)("?)'
IMAGE_REGEX='([[:space:]]*"?)([._:a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*):([._a-zA-Z0-9-]*)("?)'

# We can't use the `-d` option for readarray because
# registry.centos.org/centos/httpd-24-centos7 ships with Bash 4.2
Expand Down
13 changes: 7 additions & 6 deletions build/dockerfiles/rhel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ WORKDIR /build/

# if only including the /latest/ plugins, apply this line to remove them from builder
RUN if [[ ${LATEST_ONLY} == "true" ]]; then \
rm -fr $(find /build/v3 -name 'meta.yaml' | grep -v "/latest/" | grep -o ".*/"); \
./keep_only_latest.sh; \
fi

RUN ./check_plugins_location.sh v3 && \
RUN ./generate_latest_metas.sh v3 && \
./check_plugins_location.sh v3 && \
./set_plugin_dates.sh v3 && \
./check_plugins_viewer_mandatory_fields.sh v3 && \
./ensure_latest_exists.sh && \
./index.sh v3 > /build/v3/plugins/index.json && \
chmod -c -R g+rwX /build
./list_referenced_images.sh v3 > /build/v3/external_images.txt && \
chmod -R g+rwX /build

#################
# PHASE THREE: create ubi8-minimal image with httpd
Expand All @@ -69,7 +70,7 @@ RUN ./check_plugins_location.sh v3 && \
# Build registry, copying meta.yamls and index.json from builder
# UPSTREAM: use RHEL7/RHSCL/httpd image so we're not required to authenticate with registry.redhat.io
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/rhscl/httpd-24-rhel7
FROM registry.access.redhat.com/rhscl/httpd-24-rhel7:2.4-104 AS registry
FROM registry.access.redhat.com/rhscl/httpd-24-rhel7:2.4-105 AS registry

# DOWNSTREAM: use RHEL8/httpd
# https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/rhel8/httpd-24
Expand Down Expand Up @@ -110,7 +111,7 @@ FROM builder AS offline-builder
# 2. then add it to dist-git so it's part of this repo
# rhpkg new-sources root-local.tgz v3.tgz
RUN if [ ! -f /tmp/v3.tgz ] || [ ${BOOTSTRAP} == "true" ]; then \
./cache_artifacts.sh v3 && chmod -c -R g+rwX /build; \
./cache_artifacts.sh v3 && chmod -R g+rwX /build; \
else \
# in Brew use /var/www/html/; in upstream/ offline-builder use /build/
mkdir -p /build/v3/; tar xf /tmp/v3.tgz -C /build/v3/; rm -fr /tmp/v3.tgz; \
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/check_plugins_viewer_mandatory_fields.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for meta in "${metas[@]}"; do
plugin_id=$(evaluate_plugin_id "$meta")
echo "Checking plugin '${plugin_id}'"

if ! jsonschema ./meta.yaml.schema -F $'\t{error.message}\n' -i <(yq . "${meta}"); then
if ! jsonschema "$(dirname "$0")/meta.yaml.schema" -F $'\t{error.message}\n' -i <(yq . "${meta}"); then
INVALID_JSON=true
fi
done
Expand Down
24 changes: 0 additions & 24 deletions build/scripts/ensure_latest_exists.sh

This file was deleted.

32 changes: 32 additions & 0 deletions build/scripts/generate_latest_metas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
#
# Copyright (c) 2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Utility for automatically generating latest meta.yamls for plugins.
#

set -e

for plugin_dir in v3/plugins/*/*; do
echo "Updating plugin ${plugin_dir}"
# Make sure every plugin has a 'latest.version' file
if [ ! -f "${plugin_dir}"/latest.txt ]; then
echo " Missing latest.txt: ${plugin_dir}/latest.txt"
exit 1
fi
# Generate meta.yaml for latest version
version=$(cat "${plugin_dir}/latest.txt")
latest_meta="${plugin_dir}/${version}/meta.yaml"
if [ ! -f "${latest_meta}" ]; then
echo " [ERROR]: version.latest specifies '$version' but no such meta.yaml is found"
echo " expecting: '${plugin_dir}/${version}/meta.yaml'"
fi
echo " Found latest meta ${plugin_dir}/${version}/meta.yaml"
mkdir -p "${plugin_dir}/latest"
yq -y '. + {version: "latest"}' "$latest_meta" > "${plugin_dir}/latest/meta.yaml"
done
28 changes: 28 additions & 0 deletions build/scripts/keep_only_latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
#
# Copyright (c) 2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# Utility for automatically generating latest meta.yamls for plugins.
#

set -e

for plugin_dir in v3/plugins/*/*; do
# Make sure every plugin has a 'latest.version' file
if [ ! -f "${plugin_dir}"/latest.txt ]; then
echo " Missing latest.txt: ${plugin_dir}/latest.txt"
exit 1
fi
version=$(cat "${plugin_dir}/latest.txt")
readarray -d '' to_remove < <(find "${plugin_dir}" -mindepth 1 -type d -not -name "$version" -print0)
if [ ${#to_remove[@]} != 0 ]; then
echo "Plugin ${plugin_dir}: found latest ${version} - removing non-latest versions:"
printf ' %s\n' "${to_remove[@]}"
rm -rf "${to_remove[@]}"
fi
done
16 changes: 16 additions & 0 deletions build/scripts/list_referenced_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#
# Copyright (c) 2019 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
# List all images referenced in meta.yaml files
#

set -e

readarray -d '' metas < <(find "$1" -name 'meta.yaml' -print0)
yq -r '.spec.containers[]?.image' "${metas[@]}" | sort | uniq
52 changes: 0 additions & 52 deletions build/scripts/setup_latest_dirs.sh

This file was deleted.

Loading