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

Set up 'latest' dirs for each existing plugin #143

Merged
merged 3 commits into from
May 24, 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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
FROM mikefarah/yq as builder
RUN apk add --no-cache bash
COPY .htaccess README.md *.sh /build/
COPY .htaccess README.md ./scripts/*.sh /build/
COPY /plugins /build/plugins
COPY /v2 /build/v2
COPY /v3 /build/v3
Expand All @@ -21,6 +21,7 @@ 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 ./ensure_latest_exists.sh
RUN ./index.sh > /build/plugins/index.json
RUN ./index_v2.sh v2 > /build/v2/plugins/index.json
RUN ./index_v2.sh v3 > /build/v3/plugins/index.json
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
FROM mikefarah/yq as builder
RUN apk add --no-cache bash
COPY .htaccess README.md *.sh /build/
COPY .htaccess README.md ./scripts/*.sh /build/
COPY /plugins /build/plugins
COPY /v2 /build/v2
COPY /v3 /build/v3
Expand All @@ -21,6 +21,7 @@ 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 ./ensure_latest_exists.sh
RUN ./index.sh > /build/plugins/index.json
RUN ./index_v2.sh v2 > /build/v2/plugins/index.json
RUN ./index_v2.sh v3 > /build/v3/plugins/index.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

set -e

# shellcheck source=./scripts/util.sh
source ./util.sh

## check that icon tags in meta.yaml files points to the .svg images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

set -e

# shellcheck source=./scripts/util.sh
source ./util.sh

readarray -d '' arr < <(find plugins -name 'meta.yaml' -print0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

set -e

# shellcheck source=./scripts/util.sh
source ./util.sh

readarray -d '' arr < <(find "$1" -name 'meta.yaml' -print0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set -e
FIELDS=("title" "publisher" "category" "icon" "description" "repository" "firstPublicationDate" "latestUpdateDate")
CATEGORIES=("Editor" "Debugger" "Formatter" "Language" "Linter" "Snippet" "Theme" "Other")

# shellcheck source=./scripts/util.sh
source ./util.sh

# check that field value, given in the parameter, is not null or empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set -e
FIELDS=("title" "publisher" "category" "icon" "description" "repository" "firstPublicationDate" "latestUpdateDate")
CATEGORIES=("Editor" "Debugger" "Formatter" "Language" "Linter" "Snippet" "Theme" "Other")

# shellcheck source=./scripts/util.sh
source ./util.sh

# check that field value, given in the parameter, is not null or empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set -e
FIELDS=("title" "publisher" "category" "icon" "description" "repository" "firstPublicationDate" "latestUpdateDate" "spec" "apiVersion")
CATEGORIES=("Editor" "Debugger" "Formatter" "Language" "Linter" "Snippet" "Theme" "Other")

# shellcheck source=./scripts/util.sh
source ./util.sh

# check that field value, given in the parameter, is not null or empty
Expand Down
24 changes: 24 additions & 0 deletions scripts/ensure_latest_exists.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/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
#
# Utility for checking that every plugin in v3 has a 'latest' directory.
#

set -e

for plugin_dir in v3/plugins/*/*; do
if [ ! -d "${plugin_dir}"/latest ] || [ ! -f "${plugin_dir}"/latest/meta.yaml ]; then
echo -e "\tMissing meta.yaml: ${plugin_dir}/latest/meta.yaml"
MISSING=true
fi
done

if [[ $MISSING ]]; then
exit 1
fi
1 change: 1 addition & 0 deletions index.sh → scripts/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

set -e

# shellcheck source=./scripts/util.sh
source ./util.sh

# Returns generated plugin ID.
Expand Down
1 change: 1 addition & 0 deletions index_v2.sh → scripts/index_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

set -e

# shellcheck source=./scripts/util.sh
source ./util.sh

# Returns generated plugin ID.
Expand Down
File renamed without changes.
52 changes: 52 additions & 0 deletions scripts/setup_latest_dirs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/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
#
# Utility for copying latest meta.yamls into 'latest' directory for each plugin
# to allow plugins to be specified with version 'latest'

set -e

# Copies the meta.yaml corresponding to the newest version into
# 'latest' folder for plugin. If that plugin contains a folder named 'next',
# this overrides all other versions. If the plugin contains a folder named
# 'latest', nothing is done.
#
# Takes one parameter: the relative path to a specific publisher/name
# (e.g. v3/plugins/redhat/java)
function create_latest_dir() {
path=$1

# Create latest dir if it does not exist
mkdir -p "$path"/latest

# Get version of plugin with latest 'firstPublishedDate'
mapfile -t metas < <(find "${path}" -path "${path}"/latest -prune -o -name 'meta.yaml' -print)
latest_ver=$(yq -s -r 'max_by(.firstPublicationDate | strptime("%Y-%m-%d") | mktime) | .version' "${metas[@]}")

# Rewrite version in latest meta.yaml to be 'latest'
latest_meta=$(yq '.version = "latest"' "${path}"/"${latest_ver}"/meta.yaml)

# Compare this new latest.meta with current latest, if it exists.
if [ ! -f "${path}"/latest/meta.yaml ]; then
echo "${latest_meta}" | yq -y '.' > "${path}"/latest/meta.yaml
echo " Added latest meta.yaml from " "${path}"/"${latest_ver}"/meta.yaml
else
if ! diff <(yq -S '.' "${path}"/latest/meta.yaml) <(echo "${latest_meta}" | yq -S '.') > /dev/null; then
echo " WARN: Found newer meta.yaml in " "${path}"/"${latest_ver}"/meta.yaml
echo " No changes are made, but ensure the correct version is in 'latest'"
else
echo " No changes required"
fi
fi
}

for d in v3/plugins/*/*; do
echo "Working on directory: $d"
create_latest_dir "$d"
done
File renamed without changes.
17 changes: 17 additions & 0 deletions v3/plugins/camel-tooling/vscode-apache-camel/latest/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
publisher: camel-tooling
name: vscode-apache-camel
version: latest
type: VS Code extension
displayName: Language Support for Apache Camel
title: Language Support for Apache Camel
description: This VS Code extension provides support for Apache Camel.
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
repository: https://github.com/camel-tooling/camel-lsp-client-vscode
category: Language
firstPublicationDate: '2018-04-23'
spec:
containers:
- image: eclipse/che-remote-plugin-runner-java8:next
extensions:
- https://github.com/camel-tooling/camel-lsp-client-vscode/releases/download/0.0.14/camel-tooling.vscode-apache-camel-0.0.14.vsix
32 changes: 32 additions & 0 deletions v3/plugins/che-incubator/theia-dev/latest/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v2
publisher: che-incubator
name: theia-dev
version: latest
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: null
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/latest/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v2
publisher: che-incubator
name: typescript
version: latest
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/latest/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apiVersion: v2
publisher: dirigiblelabs
name: dirigible
version: latest
type: Che Editor
displayName: Eclipse Dirigible
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:3.4.0
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
85 changes: 85 additions & 0 deletions v3/plugins/eclipse/che-gwt-ide/latest/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
apiVersion: v2
publisher: eclipse
name: che-gwt-ide
version: latest
type: Che Editor
displayName: Eclipse GWT IDE
title: Eclipse GWT IDE for Eclipse Che
description: Eclipse GWT IDE
icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
category: Editor
repository: https://github.com/eclipse/che-editor-gwt-ide/
firstPublicationDate: '2019-02-05'
spec:
endpoints:
- name: che-gwt-ide-and-master
public: true
targetPort: 8085
attributes:
protocol: http
type: ide
discoverable: false
path: gwt/ide/sidecar/entrypoint
secure: true
cookiesAuthEnabled: true
- name: wsagent/http
public: true
targetPort: 8087
attributes:
protocol: http
path: api
discoverable: false
secure: true
cookiesAuthEnabled: true
- name: wsagent/ws
public: true
targetPort: 8087
attributes:
protocol: ws
path: wsagent
discoverable: false
secure: true
cookiesAuthEnabled: true
- name: exec-agent/http
public: true
targetPort: 4412
attributes:
protocol: http
path: process
discoverable: false
secure: true
cookiesAuthEnabled: true
- name: exec-agent/ws
public: true
targetPort: 4412
attributes:
protocol: ws
path: connect
discoverable: false
secure: true
cookiesAuthEnabled: true
- name: terminal
public: true
targetPort: 4411
attributes:
protocol: ws
path: pty
discoverable: false
secure: true
cookiesAuthEnabled: true
containers:
- name: che-editor-gwt-ide
image: eclipse/che-editor-gwt-ide:7.0.0-beta-1.0
env:
- name: SERVER_PORT
value: 8080
volumes:
- mountPath: /plugins
name: plugins
mountSources: true
ports:
- exposedPort: 8085
- exposedPort: 8087
- exposedPort: 4411
- exposedPort: 4412
memoryLimit: 512M
Loading