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

Merge meta.yaml and plugin yaml in v3 #135

Merged
merged 4 commits into from
May 2, 2019
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
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,24 @@ RUN apk add --no-cache bash
COPY .htaccess README.md *.sh /build/
COPY /plugins /build/plugins
COPY /v2 /build/v2
COPY /v3 /build/v3
WORKDIR /build/
RUN ./check_plugins_location_v1.sh
RUN ./check_plugins_location_v2.sh
RUN ./check_plugins_location_v2.sh v2
RUN ./check_plugins_location_v2.sh v3
RUN ./check_plugins_images.sh
RUN ./set_plugin_dates.sh
RUN ./check_plugins_viewer_mandatory_fields_v1.sh
RUN ./check_plugins_viewer_mandatory_fields_v2.sh
RUN ./check_plugins_viewer_mandatory_fields_v3.sh
RUN ./index.sh > /build/plugins/index.json
RUN ./index_v2.sh > /build/v2/plugins/index.json
RUN ./index_v2.sh v2 > /build/v2/plugins/index.json
RUN ./index_v2.sh v3 > /build/v3/plugins/index.json

FROM registry.centos.org/centos/httpd-24-centos7
RUN mkdir /var/www/html/plugins
COPY --from=builder /build/ /var/www/html/
USER 0
RUN chmod -R g+rwX /var/www/html/plugins && \
chmod -R g+rwX /var/www/html/v2/plugins
chmod -R g+rwX /var/www/html/v2/plugins && \
chmod -R g+rwX /var/www/html/v3/plugins
10 changes: 8 additions & 2 deletions Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ RUN apk add --no-cache bash
COPY .htaccess README.md *.sh /build/
COPY /plugins /build/plugins
COPY /v2 /build/v2
COPY /v3 /build/v3
WORKDIR /build/
RUN ./check_plugins_location_v1.sh
RUN ./check_plugins_location_v2.sh
RUN ./check_plugins_location_v2.sh v2
RUN ./check_plugins_location_v2.sh v3
RUN ./check_plugins_images.sh
RUN ./set_plugin_dates.sh
RUN ./check_plugins_viewer_mandatory_fields_v1.sh
RUN ./check_plugins_viewer_mandatory_fields_v2.sh
RUN ./check_plugins_viewer_mandatory_fields_v3.sh
RUN ./index.sh > /build/plugins/index.json
RUN ./index_v2.sh > /build/v2/plugins/index.json
RUN ./index_v2.sh v2 > /build/v2/plugins/index.json
RUN ./index_v2.sh v3 > /build/v3/plugins/index.json

FROM quay.io/openshiftio/rhel-base-httpd:latest

Expand All @@ -35,6 +39,8 @@ RUN chmod a+rwX /etc/httpd/conf
RUN chmod a+rwX /run/httpd

RUN mkdir /var/www/html/plugins
RUN mkdir /var/www/html/v2
RUN mkdir /var/www/html/v3
COPY --from=builder /build/ /var/www/html/

STOPSIGNAL SIGWINCH
Expand Down
8 changes: 6 additions & 2 deletions check_plugins_location_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
# SPDX-License-Identifier: EPL-2.0
#

# Checks that plugin files are located at the expected path.
# Arguments:
# 1 - plugin root folder, e.g. 'v3'

set -e

source ./util.sh

declare -a arr=(`find v2 -name "meta.yaml"`)
declare -a arr=(`find "$1" -name "meta.yaml"`)
for i in "${arr[@]}"
do
plugin_id=$(evaluate_plugin_id $i)

expected_path="v2/plugins/${plugin_id}/meta.yaml"
expected_path="$1/plugins/${plugin_id}/meta.yaml"
if [[ "${expected_path}" != "$i" ]]; then
echo "!!! Location mismatch in plugin '${plugin_id}':"
echo "!!! Expected location: '${expected_path}'"
Expand Down
81 changes: 81 additions & 0 deletions check_plugins_viewer_mandatory_fields_v3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
#
# Copyright (c) 2018-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
#

# Checks whether mandatory fields are in place. Also checks value of 'category 'field.

set -e

FIELDS=("title" "publisher" "category" "icon" "description" "repository" "firstPublicationDate" "latestUpdateDate" "spec" "apiVersion")
CATEGORIES=("Editor" "Debugger" "Formatter" "Language" "Linter" "Snippet" "Theme" "Other")

source ./util.sh

# check that field value, given in the parameter, is not null or empty
function check_field() {
if [[ $1 == "null" || $1 = "" ]];then
return 1;
fi
return 0
}

# Validates category value, given in the parameter.
# Arguments:
# 1 - path to meta.yaml
# 2 - value of category field
function check_category() {
# If category is absent, replace is with "Other" and consider it valid
if [[ $2 == "null" || $2 = "\'\'" ]];then
yq w "$1" category "Other" -i
return 0;
fi
for CATEGORY in "${CATEGORIES[@]}"
do
if [[ ${CATEGORY} == "$2" ]];then
return 0
fi
done
return 1
}

declare -a arr=(`find v3 -name "meta.yaml"`)
for i in "${arr[@]}"
do
plugin_id=$(evaluate_plugin_id $i)

echo "Checking plugin '${plugin_id}'"

unset NULL_OR_EMPTY_FIELDS

for FIELD in "${FIELDS[@]}"
do
VALUE=$(yq r $i "$FIELD")
if [[ "${FIELD}" == "category" ]];then
if ! check_category "$i" "${VALUE}";then
echo "!!! Invalid category in '${plugin_id}': $VALUE"
INVALID_FIELDS=true;
INVALID_FIELDS=true;
fi
continue
fi

if ! check_field "${VALUE}";then
NULL_OR_EMPTY_FIELDS+="$FIELD "
fi
done

if [[ -n "${NULL_OR_EMPTY_FIELDS}" ]];then
echo "!!! Null or empty mandatory fields in '${plugin_id}': $NULL_OR_EMPTY_FIELDS"
INVALID_FIELDS=true
fi
done

if [[ -n "${INVALID_FIELDS}" ]];then
exit 1
fi
6 changes: 5 additions & 1 deletion index_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# SPDX-License-Identifier: EPL-2.0
#

# Generated plugins index in JSON format.
# Arguments:
# 1 - plugin root folder, e.g. 'v3'

set -e

source ./util.sh
Expand Down Expand Up @@ -65,4 +69,4 @@ function buildIndex() {
echo "]"
}

buildIndex v2
buildIndex "$1"
1 change: 1 addition & 0 deletions v3/plugins/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DirectoryIndex meta.yaml index.json
30 changes: 30 additions & 0 deletions v3/plugins/che-incubator/theia-dev/0.0.1/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: v2
publisher: che-incubator
name: theia-dev
version: 0.0.1
type: Che Plugin
displayName: Che Theia Dev Plugin
title: Che Theia Dev Plugin
description: Che Theia Dev Plugin
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: /~https://github.com/che-incubator/che-theia-dev-plugin/
firstPublicationDate: "2019-02-05"
category: Other
spec:
endpoints:
- name: "theia-dev-flow"
public: true
targetPort: 3010
attributes:
protocol: http
containers:
- name: theia-dev
image: eclipse/che-theia-dev:nightly
commands:
- name: uname
workingDir: "$(project)"
command: ["uname", "-a"]
mountSources: true
ports:
- exposedPort: 3010
memoryLimit: "2Gi"
17 changes: 17 additions & 0 deletions v3/plugins/che-incubator/typescript/1.30.2/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
publisher: che-incubator
name: typescript
version: 1.30.2
type: VS Code extension
displayName: Typescript
title: Typescript language features
description: Typescript language features
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: /~https://github.com/Microsoft/vscode
category: Language
firstPublicationDate: "2019-02-19"
spec:
containers:
- image: "eclipse/che-theia-endpoint-runtime:next"
extensions:
- /~https://github.com/che-incubator/ms-code.typescript/releases/download/v1.30.2/che-typescript-language.vsix
48 changes: 48 additions & 0 deletions v3/plugins/dirigiblelabs/dirigible/1.0.0/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: v2
publisher: dirigiblelabs
name: dirigible
version: 1.0.0
type: Che Editor
displayName: dirigible-che-editor-plugin
title: Eclipse Dirigible for Eclipse Che
description: Eclipse Dirigible as App Development Platform for Eclipse Che
icon: https://www.dirigible.io/img/dirigible.svg
category: Editor
repository: /~https://github.com/dirigiblelabs/dirigible-che-editor-plugin/
firstPublicationDate: "2019-02-05"
spec:
endpoints:
- name: "dirigible"
public: true
targetPort: 8080
attributes:
protocol: http
type: ide
containers:
- name: eclipse-dirigible
image: dirigiblelabs/dirigible-openshift
env:
- name: DIRIGIBLE_DATABASE_PROVIDER
value: "local"
- name: DIRIGIBLE_REPOSITORY_LOCAL_ROOT_FOLDER
value: /projects/dirigible/repository
- name: DIRIGIBLE_REPOSITORY_LOCAL_ROOT_FOLDER_IS_ABSOLUTE
value: true
- name: DIRIGIBLE_REPOSITORY_SEARCH_ROOT_FOLDER
value: /projects/dirigible/repository
- name: DIRIGIBLE_REPOSITORY_SEARCH_ROOT_FOLDER_IS_ABSOLUTE
value: true
- name: DIRIGIBLE_CMS_INTERNAL_ROOT_FOLDER
value: /projects/dirigible/cms
- name: DIRIGIBLE_CMS_INTERNAL_ROOT_FOLDER_IS_ABSOLUTE
value: true
- name: DIRIGIBLE_DATABASE_H2_ROOT_FOLDER_DEFAULT
value: /projects/dirigible/h2
- name: DIRIGIBLE_DATABASE_H2_URL
value: jdbc:h2:/projects/dirigible/h2
- name: DIRIGIBLE_OPERATIONS_LOGS_ROOT_FOLDER_DEFAULT
value: /usr/local/tomcat/logs
mountSources: true
ports:
- exposedPort: 8080
memoryLimit: "1024M"
27 changes: 27 additions & 0 deletions v3/plugins/eclipse/che-machine-exec-plugin/0.0.1/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v2
publisher: eclipse
name: che-machine-exec-plugin
version: 0.0.1
type: Che Plugin
displayName: Che machine-exec Service
title: Che machine-exec Service Plugin
description: Che Plug-in with che-machine-exec service to provide creation terminal
or tasks for Eclipse CHE workspace machines.
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: /~https://github.com/eclipse/che-machine-exec/
firstPublicationDate: "2019-02-05"
category: Other
spec:
endpoints:
- name: "che-machine-exec"
public: true
targetPort: 4444
attributes:
protocol: ws
type: terminal
discoverable: false
containers:
- name: che-machine-exec
image: eclipse/che-machine-exec
ports:
- exposedPort: 4444
48 changes: 48 additions & 0 deletions v3/plugins/eclipse/che-theia/1.0.0/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: v2
publisher: eclipse
name: che-theia
version: 1.0.0
type: Che Editor
displayName: theia-ide
title: Eclipse Theia for Eclipse Che
description: Eclipse Theia
icon: https://raw.githubusercontent.com/theia-ide/theia/master/logo/theia-logo-no-text-black.svg?sanitize=true
category: Editor
repository: /~https://github.com/eclipse/che-theia
firstPublicationDate: "2019-02-05"
spec:
endpoints:
- name: "theia"
public: true
targetPort: 3100
attributes:
protocol: http
type: ide
secure: true
cookiesAuthEnabled: true
discoverable: false
- name: "theia-dev"
public: true
targetPort: 3130
attributes:
protocol: http
type: ide-dev
discoverable: false
containers:
- name: theia-ide
image: eclipse/che-theia:latest
env:
- name: THEIA_PLUGINS
value: local-dir:///plugins
- name: HOSTED_PLUGIN_HOSTNAME
value: 0.0.0.0
- name: HOSTED_PLUGIN_PORT
value: 3130
volumes:
- mountPath: "/plugins"
name: plugins
mountSources: true
ports:
- exposedPort: 3100
- exposedPort: 3130
memoryLimit: "1536M"
Loading