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

Update to the upstream #6

Merged
merged 49 commits into from
Jul 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
58198ff
Add simple console app to java-maven devfile
sleshchenko Jun 13, 2019
7e19dde
Add simple console app to java-gradle devfile
sleshchenko Jun 13, 2019
4045d87
Fix build.sh
sleshchenko Jun 14, 2019
91469d9
Update Python and Django samples
sleshchenko Jun 14, 2019
b4b30f5
Add Sample project to apache-camel-springboot devfile
sleshchenko Jun 14, 2019
1e89e61
Add sample project for dotnet stack
sleshchenko Jun 14, 2019
486e726
Adds an example project to go devfile.
metlos Jun 17, 2019
5a64991
Merge pull request #12 from sleshchenko/moreDevfiles
sleshchenko Jun 18, 2019
cdcc741
Fix invalid indents.
monaka Jun 19, 2019
4d140f3
Add new nodejs-express stack
l0rd Jun 18, 2019
609143d
Merge remote-tracking branch 'upstream/master' into go-stack-example-…
metlos Jun 20, 2019
5a71913
Update gradle mounted volume path to match dockerfile
amisevsk Jun 18, 2019
e47400f
Add AngularJS devfile along with sample project (#19)
sleshchenko Jun 25, 2019
15bd742
Move working directory to a dedicated field instead of using 'cd' com…
sleshchenko Jun 26, 2019
3f85a84
Add devfiles for PHP (#21)
svor Jun 27, 2019
14df7b2
Add a simple command to run the "outyet" example.
metlos Jun 28, 2019
b1ab699
Add also a test command to have an example with useful output
metlos Jun 28, 2019
d78bd4a
Add a node+mongodb application stack. (#22)
metlos Jul 2, 2019
a58284d
Merge pull request #13 from metlos/go-stack-example-project
metlos Jul 3, 2019
6e8a450
Updating codeowners for Che 7 endgame code reviews
l0rd Jul 3, 2019
96165c2
chore(github): Update issue template to use external main che repository
benoitf Jul 4, 2019
8ede3f9
Clarify names of default stacks (#25)
sparkoo Jul 8, 2019
916fee5
Add NodeJS stack with react realworld app (#29)
tolusha Jul 9, 2019
878e574
che #13454 Adding Che 7 java 11 community images with support of arbi…
ibuziuk Jul 2, 2019
1fe3504
Fix typo in python-django stack (#30)
tolusha Jul 11, 2019
a09926b
rh-che #13813: Pushing rhel images to 'quay.io/openshiftio' and cento…
ibuziuk Jul 11, 2019
b50cedd
che #13813: Pushing centos images to 'eclipse' org on quay.io
ibuziuk Jul 12, 2019
11dfdbc
Cosmetic fix in Readme
ibuziuk Jul 12, 2019
f0ebbfa
che #13813: Adding script for the nightly ci build
ibuziuk Jul 12, 2019
73967c0
che #13813: Adding missing REGISTRY env var to the nightly ci build
ibuziuk Jul 12, 2019
93bcd2e
Add Java Web devfiles (#18)
sleshchenko Jul 16, 2019
94a6c92
Patch all used images for arbitrary users on OpenShift (#38)
amisevsk Jul 18, 2019
b1206a9
Build and push patched images *after* logging in
amisevsk Jul 18, 2019
fda2ec2
Fix some references to quay.io/openshiftio
l0rd Jul 18, 2019
ad611dd
Add task to debug django app remotely (#43)
tolusha Jul 21, 2019
91f5b9b
fix helm chart deployment strategy config (#44)
sparkoo Jul 22, 2019
d344183
Adding ci nightly build icon to README
ibuziuk Jul 24, 2019
c1f2d05
Update dockerfile patch and make new java devfiles used patched images
amisevsk Jul 19, 2019
f518878
Update angular stack to use non-alpine image
amisevsk Jul 22, 2019
ba6553a
che-13953: Adding cico release script for CI
ibuziuk Jul 24, 2019
6c0be1e
Set back lower memory limits to have stack working by default on
apupier Jul 23, 2019
fd23188
che #13953 Fixing the release script to pass the correct version to t…
ibuziuk Jul 25, 2019
9262459
Changing version to 7.0.0-SNAPSHOT and adding release CI icon to README
ibuziuk Jul 25, 2019
1787bf6
Build and Push rhel images as well when releasing
l0rd Jul 25, 2019
d46214d
Removing duplicate code in scripts
l0rd Jul 25, 2019
30aefd8
Small fix in cico functions
l0rd Jul 25, 2019
ba89754
Fix comments in cico funtions
l0rd Jul 25, 2019
b4a78f9
Build and push arbitrary-user patched images to 'eclipse' quay.io org…
ibuziuk Jul 26, 2019
462c317
Merge remote-tracking branch 'upstream/master' into pr-update-to-the-…
monaka Jul 29, 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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global Owners
* @vparfonov @l0rd @rhopp @skabashnyuk
14 changes: 0 additions & 14 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/where-to-report-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: "⚠️ Where to report issues?"
about: File issues in the main Eclipse Che repository at https://github.com/eclipse/che/issues
title: Issues need to be filed in the main Eclipse Che repository
labels: ''
assignees: ''

---

## Where to report issues?

This repository is not the primary repository of Eclipse Che.

🚨 Please don't submit new issues here. 🚨

All issues for Eclipse Che are managed at [https://github.com/eclipse/che/issues](https://github.com/eclipse/che/issues).
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://ci.centos.org/buildStatus/icon?job=devtools-che-devfile-registry-build-master/)](https://ci.centos.org/job/devtools-che-devfile-registry-build-master/)
[![Build Status](https://ci.centos.org/buildStatus/icon?job=devtools-che-devfile-registry-nightly/)](https://ci.centos.org/job/devtools-che-devfile-registry-nightly/)
[![Build Status](https://ci.centos.org/buildStatus/icon?job=devtools-che-devfile-registry-release/)](https://ci.centos.org/job/devtools-che-devfile-registry-release/)

# Eclipse Che devfile registry

Expand All @@ -8,22 +10,22 @@ This repository holds ready-to-use Devfiles for different languages and technolo

Execute
```shell
docker build --no-cache -t openshiftio/che-devfile-registry .
docker build --no-cache -t quay.io/eclipse/che-devfile-registry:nightly .
```
Where `--no-cache` is needed to prevent usage of cached layers with devfile registry files.
Useful when you change devfile files and rebuild the image.

Note that the Dockerfiles feature multi-stage build, so it requires Docker of version 17.05 and higher.
Though you may also just provide the image to the older versions of Docker (ex. on Minishift) by having it build on newer version, and pushing and pulling it from Docker Hub.

`quay.io/openshiftio/che-devfile-registry:latest` image would be rebuilt after each commit in master
`quay.io/eclipse/che-devfile-registry:nightly` image would be rebuilt after each commit in master.

## OpenShift
You can deploy Che devfile registry on Openshift with command.
```
oc new-app -f deploy/openshift/che-devfile-registry.yaml \
-p IMAGE="quay.io/openshiftio/che-devfile-registry" \
-p IMAGE_TAG="latest" \
-p IMAGE="quay.io/eclipse/che-devfile-registry" \
-p IMAGE_TAG="nightly" \
-p PULL_POLICY="Always"
```

Expand Down Expand Up @@ -52,8 +54,9 @@ helm delete --purge che-devfile-registry
```

## Docker

```
docker run -it --rm -p 8080:8080 quay.io/openshiftio/che-devfile-registry
docker run -it --rm -p 8080:8080 quay.io/eclipse/che-devfile-registry:nightly
```

### License
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.0.0-SNAPSHOT
15 changes: 15 additions & 0 deletions arbitrary-users-patch/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ARG FROM_IMAGE
FROM ${FROM_IMAGE}
USER 0
# Set permissions on /etc/passwd and /home to allow arbitrary users to write
RUN mkdir -p /home/user
RUN chgrp -R 0 /home
RUN chmod -R g=u /etc/passwd /home
COPY [--chown=0:0] entrypoint.sh /
RUN chmod +x /entrypoint.sh

USER 10001
ENV HOME=/home/user
WORKDIR /projects
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["tail", "-f", "/dev/null"]
10 changes: 10 additions & 0 deletions arbitrary-users-patch/base_images
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
che-python-3.6 centos/python-36-centos7:1
che-php-7 eclipse/php:7.1-che7
che-golang-1.10 golang:1.10.7-stretch
che-java11-gradle gradle:5.2.1-jdk11
che-java11-maven maven:3.6.0-jdk-11
che-java8-maven maven:3.6.1-jdk-8
che-dotnet-2.2 mcr.microsoft.com/dotnet/core/sdk:2.2-stretch
che-nodejs10-community node:10.16
che-nodejs10-ubi registry.access.redhat.com/ubi8/nodejs-10
che-nodejs8-centos registry.centos.org/che-stacks/centos-nodejs
39 changes: 39 additions & 0 deletions arbitrary-users-patch/build_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
#
# Copyright (c) 2012-2018 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
#

set -e

SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)

DEFAULT_REGISTRY="quay.io"
DEFAULT_ORGANIZATION="eclipse"
DEFAULT_TAG="nightly"

REGISTRY=${REGISTRY:-${DEFAULT_REGISTRY}}
ORGANIZATION=${ORGANIZATION:-${DEFAULT_ORGANIZATION}}
TAG=${TAG:-${DEFAULT_TAG}}

NAME_FORMAT="${REGISTRY}/${ORGANIZATION}"

PUSH_IMAGES=false
if [ "$1" == "--push" ]; then
PUSH_IMAGES=true
fi

while read -r line; do
base_image_name=$(echo "$line" | tr -s ' ' | cut -f 1 -d ' ')
base_image=$(echo "$line" | tr -s ' ' | cut -f 2 -d ' ')
echo "Building ${NAME_FORMAT}/${base_image_name}:${TAG} based on $base_image ..."
docker build -t "${NAME_FORMAT}/${base_image_name}:${TAG}" --build-arg FROM_IMAGE="$base_image" "${SCRIPT_DIR}"/
if ${PUSH_IMAGES}; then
echo "Pushing ${NAME_FORMAT}/${base_image_name}:${TAG}" to remote registry
docker push "${NAME_FORMAT}/${base_image_name}:${TAG}"
fi
done < "${SCRIPT_DIR}"/base_images
20 changes: 20 additions & 0 deletions arbitrary-users-patch/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Ensure $HOME exists when starting
if [ ! -d "${HOME}" ]; then
mkdir -p "${HOME}"
fi

# Setup $PS1 for a consistent and reasonable prompt
if [ -w "${HOME}" ] && [ ! -f "${HOME}"/.bashrc ]; then
echo "PS1='\s-\v \w \$ '" > "${HOME}"/.bashrc
fi

# Add current (arbitrary) user to /etc/passwd
if ! whoami &> /dev/null; then
if [ -w /etc/passwd ]; then
echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd
fi
fi

exec "$@"
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# SPDX-License-Identifier: EPL-2.0
#

docker build -t quay.io/openshiftio/che-devfile-registry:latest .
docker build -t quay.io/eclipse/che-devfile-registry:nightly .
26 changes: 26 additions & 0 deletions cico_build_ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Copyright (c) 2012-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
#

# Output command before executing
set -x

# Exit on error
set -e

SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
export SCRIPT_DIR

# shellcheck disable=SC1090
. "${SCRIPT_DIR}"/cico_functions.sh

load_jenkins_vars
install_deps
set_ci_tag
build_and_push
26 changes: 26 additions & 0 deletions cico_build_nightly.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Copyright (c) 2012-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
#

# Output command before executing
set -x

# Exit on error
set -e

SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
export SCRIPT_DIR

# shellcheck disable=SC1090
. "${SCRIPT_DIR}"/cico_functions.sh

load_jenkins_vars
install_deps
set_nightly_tag
build_and_push
26 changes: 26 additions & 0 deletions cico_build_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#
# Copyright (c) 2012-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
#

# Output command before executing
set -x

# Exit on error
set -e

SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
export SCRIPT_DIR

# shellcheck disable=SC1090
. "${SCRIPT_DIR}"/cico_functions.sh

load_jenkins_vars
install_deps
set_release_tag
build_and_push
57 changes: 39 additions & 18 deletions cico_build.sh → cico_functions.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2012-2018 Red Hat, Inc.
# Copyright (c) 2012-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/
Expand All @@ -22,6 +22,8 @@ function load_jenkins_vars() {
DEVSHIFT_TAG_LEN \
QUAY_USERNAME \
QUAY_PASSWORD \
QUAY_ECLIPSE_CHE_USERNAME \
QUAY_ECLIPSE_CHE_PASSWORD \
JENKINS_URL \
GIT_BRANCH \
GIT_COMMIT \
Expand All @@ -44,47 +46,66 @@ function install_deps() {
git

service docker start

echo 'CICO: Dependencies installed'
}

function set_release_tag() {
# Let's obtain the tag based on the
# version defined in the 'VERSION' file
TAG=$(head -n 1 VERSION)
export TAG
}

function set_ci_tag() {
# Let's obtain the tag based on the
# git commit hash
TAG=$(echo "$GIT_COMMIT" | cut -c1-"${DEVSHIFT_TAG_LEN}")
export TAG
}

function set_nightly_tag() {
# Let's set the tag as nightly
export TAG="nightly"
}

function tag_push() {
local TARGET=$1
docker tag "${IMAGE}" "$TARGET"
docker push "$TARGET"
}

function deploy() {
function build_and_push() {
TARGET=${TARGET:-"centos"}
REGISTRY="quay.io"

if [ "$TARGET" == "rhel" ]; then
DOCKERFILE="Dockerfile.rhel"
ORGANIZATION="openshiftio"
IMAGE="rhel-che-devfile-registry"
else
DOCKERFILE="Dockerfile"
ORGANIZATION="eclipse"
IMAGE="che-devfile-registry"
# For pushing to quay.io 'eclipse' organization we need to use different credentials
QUAY_USERNAME=${QUAY_ECLIPSE_CHE_USERNAME}
QUAY_PASSWORD=${QUAY_ECLIPSE_CHE_PASSWORD}
fi

if [ -n "${QUAY_USERNAME}" ] && [ -n "${QUAY_PASSWORD}" ]; then
docker login -u "${QUAY_USERNAME}" -p "${QUAY_PASSWORD}" "${REGISTRY}"
else
echo "Could not login, missing credentials for the registry"
echo "Could not login, missing credentials for pushing to the '${ORGANIZATION}' organization"
fi

# Let's deploy
docker build -t ${IMAGE} -f ${DOCKERFILE} .

TAG=$(echo "$GIT_COMMIT" | cut -c1-"${DEVSHIFT_TAG_LEN}")

tag_push "${REGISTRY}/openshiftio/$IMAGE:$TAG"
tag_push "${REGISTRY}/openshiftio/$IMAGE:latest"
echo 'CICO: Image pushed, ready to update deployed app'
}
# Let's build and push arbitrary-user patched images only to 'eclipse' quay.io organization
# which is done as part of the 'centos' target execution
if [ "$TARGET" == "centos" ]; then
"${SCRIPT_DIR}"/arbitrary-users-patch/build_images.sh --push
echo "CICO: pushed '${TAG}' version of the arbitrary-user patched base images"
fi

function cico_setup() {
load_jenkins_vars;
install_deps;
# Let's build and push images to 'quay.io'
docker build -t ${IMAGE} -f ${DOCKERFILE} .
tag_push "${REGISTRY}/${ORGANIZATION}/${IMAGE}:${TAG}"
echo "CICO: '${TAG}' version of images pushed to '${REGISTRY}/${ORGANIZATION}' organization"
}
cico_setup
deploy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# SPDX-License-Identifier: EPL-2.0
#

apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
Expand All @@ -21,12 +21,9 @@ spec:
app: che-devfile-registry
strategy:
type: RollingUpdate
rollingParams:
intervalSeconds: 1
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
template:
metadata:
labels:
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/che-devfile-registry/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# SPDX-License-Identifier: EPL-2.0
#

cheDevfileRegistryImage: quay.io/openshiftio/che-devfile-registry
cheDevfileRegistryImage: quay.io/eclipse/che-devfile-registry:nightly
cheDevfileRegistryImagePullPolicy: Always
cheDevfileRegistryMemoryLimit: 256Mi
#cheDevfileRegistryIngressSecretName: che-tls
Expand Down
Loading