Discussion:
[nx-pub] nuxeo-openshift: NXCT-127: Make studio-only plan work (branch@NXCT-127-studio-only)
Estelle Giuly
2018-12-11 09:53:49 UTC
Permalink
Message:
NXCT-127: Make studio-only plan work

Repository: nuxeo-openshift
Branch: NXCT-127-studio-only
Author: Estelle Giuly <***@nuxeo.com>
Date: 2018-12-11T09:53:31 UTC
URL: https://github.com/nuxeo/nuxeo-openshift/commit/2ec9516cf9d7f73c34fe9791cc2d558f95619b4d
JIRA: https://jira.nuxeo.com/browse/NXCT-127

Files:
A jenkinsfile/Jenkinsfile-studio
M nuxeo-dev-apb/apb.yml
M nuxeo-dev-apb/defaults/main.yml
M nuxeo-dev-apb/tasks/main.yml
M nuxeo-dev-apb/templates/global-config.yml.j2
M nuxeo-dev-apb/templates/pipeline-service.yml.j2
M nuxeo-dev-apb/vars/main.yaml
M nuxeo-pipeline-apb/apb.yml
M nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
M nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
M nuxeo-pipeline-apb/templates/nuxeo-service.yml.j2
M nuxeo-pipeline-apb/vars/main.yml
M scripts/install.sh

diff --git a/jenkinsfile/Jenkinsfile-studio b/jenkinsfile/Jenkinsfile-studio
new file mode 100644
index 0000000..e675d52
--- /dev/null
+++ b/jenkinsfile/Jenkinsfile-studio
@@ -0,0 +1,114 @@
+def nuxeo_image_build = ""
+def app_name = ""
+def nuxeo_image_name = ""
+
+pipeline {
+ agent {
+ node {
+ label 'master'
+ }
+ }
+
+ options {
+ timeout(time: 60, unit: 'MINUTES')
+ }
+
+ stages {
+
+ stage('Initialize') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ app_name = env.APP_NAME
+ echo "Using project: ${openshift.project()} with app: ${app_name}"
+ nuxeo_image_build = env.NUXEO_IMAGE_BUILD
+ nuxeo_image_name = env.NUXEO_IMAGE_NAME
+ }
+ }
+ }
+ }
+ }
+
+ stage('Build Docker image') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ // Build docker image
+ openshift.selector("bc", nuxeo_image_build).startBuild("--wait")
+ def build_last_version = openshift.selector("bc", nuxeo_image_build).object().status.lastVersion
+ def last_build = openshift.selector("builds", "${nuxeo_image_build}-${build_last_version}")
+ timeout(10) {
+ waitUntil {
+ last_build.object().status.phase == "Complete"
+ }
+ }
+
+ // Promote to dev
+ openshift.tag("${nuxeo_image_name}:latest", "${nuxeo_image_name}:dev")
+ }
+ }
+ }
+ }
+ }
+
+ stage('Deploy DEV') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ openshiftDeploy(deploymentConfig: "${app_name}-dev-interactive")
+ timeout(5) {
+ openshift.selector("dc", "${app_name}-dev-interactive").related('pods').untilEach(1) {
+ return (it.object().status.phase == "Running")
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ stage('User validation') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ timeout(60) {
+ input message: "Do you want to deploy to UAT environment too?", id: "approval"
+ openshift.tag("${nuxeo_image_name}:latest", "${nuxeo_image_name}:uat")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ stage('Deploy UAT') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ openshiftDeploy(deploymentConfig: "${app_name}-uat-interactive")
+ timeout(5) {
+ openshift.selector("dc", "${app_name}-uat-interactive").related('pods').untilEach(1) {
+ return (it.object().status.phase == "Running")
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ post {
+ always {
+ // Clean workspace
+ cleanWs()
+ }
+ }
+
+}
diff --git a/nuxeo-dev-apb/apb.yml b/nuxeo-dev-apb/apb.yml
index b69289c..919fa3a 100644
--- a/nuxeo-dev-apb/apb.yml
+++ b/nuxeo-dev-apb/apb.yml
@@ -156,44 +156,55 @@ plans:
default: shared
display_group: Backend storages

- # TODO: Make studio-only plan work before showing it available.
- #
- # - name: studio-only
- # description: Development with Studio project only
- # free: true
- # metadata: {}
- # parameters:
- # - name: project_name
- # type: string
- # title: Project Name
-
- # - name: nuxeo_connect_username
- # type: string
- # title: |
- # A Nuxeo Connect userId used to register the instance, pull
- # studio project etc...
-
- # - name: nuxeo_connect_token
- # type: string
- # title: |
- # A token for the Connect account
- # ( https://connect.nuxeo.com/nuxeo/site/connect/tokens )
- # display_type: password
-
- # - name: nuxeo_studio_project
- # type: string
- # title: The name of the studio project to register to
-
- # - name: nuxeo_studio_version
- # type: string
- # title: The name of the studio project to register to
-
- # - name: backend_pv_storage_class
- # type: string
- # title: Storage class for backend persistence volumes
- # default: gp2
-
- # - name: binaries_pv_storage_class
- # type: string
- # title: Storage class for backend persistence volumes
- # default: shared
+ - name: studio-only
+ description: Development with Studio project only
+ free: true
+ metadata: {}
+ parameters:
+ - name: project_name
+ type: string
+ title: Project Name
+
+ - name: nuxeo_connect_username
+ type: string
+ title: |
+ A Nuxeo Connect userId used to register the instance, pull
+ studio project etc...
+
+ - name: nuxeo_connect_token
+ type: string
+ title: |
+ A token for the Connect account
+ ( https://connect.nuxeo.com/nuxeo/site/connect/tokens )
+ display_type: password
+
+ - name: nuxeo_studio_project
+ type: string
+ title: The name of the studio project to register to
+
+ - name: nuxeo_studio_version
+ type: string
+ title: The version of the studio project to register to
+
+ - name: nuxeo_version
+ default: '9.10'
+ type: enum
+ enum: ['8.10','9.10', '10.2', 'master']
+ title: Nuxeo version to use
+ display_group: Nuxeo Configuration
+
+ - name: nuxeo_packages
+ default: 'nuxeo-web-ui'
+ type: string
+ title: List of Nuxeo packages to install at startup
+ display_group: Nuxeo Configuration
+
+ - name: backend_pv_storage_class
+ type: string
+ title: Storage class for backend persistence volumes
+ default: gp2
+
+ - name: binaries_pv_storage_class
+ type: string
+ title: Storage class for backend persistence volumes
+ default: shared
diff --git a/nuxeo-dev-apb/defaults/main.yml b/nuxeo-dev-apb/defaults/main.yml
index 2ce25fc..d61fc68 100644
--- a/nuxeo-dev-apb/defaults/main.yml
+++ b/nuxeo-dev-apb/defaults/main.yml
@@ -39,4 +39,5 @@ nuxeo_connect_token: ""
hotfix_release_username: nuxeo
hotfix_release_password: nuxeo

+studio_only: false
testing: false
diff --git a/nuxeo-dev-apb/tasks/main.yml b/nuxeo-dev-apb/tasks/main.yml
index 7109d3c..4e7d0a2 100644
--- a/nuxeo-dev-apb/tasks/main.yml
+++ b/nuxeo-dev-apb/tasks/main.yml
@@ -43,4 +43,4 @@
- name: "Update last operation"
asb_last_operation:
description: "100%: Cluster objects state={{ state }}"
- when: in_cluster
\ No newline at end of file
+ when: in_cluster
diff --git a/nuxeo-dev-apb/templates/global-config.yml.j2 b/nuxeo-dev-apb/templates/global-config.yml.j2
index 3c4bb02..20f59e1 100644
--- a/nuxeo-dev-apb/templates/global-config.yml.j2
+++ b/nuxeo-dev-apb/templates/global-config.yml.j2
@@ -21,6 +21,7 @@ data:
nuxeo_version: "{{ nuxeo_version }}"
nuxeo_packages: "{{ nuxeo_packages }}"
nuxeo_templates: "{{ nuxeo_templates }}"
+ studio_only: "{{ studio_only }}"
backend_repository_type: "{{ backend_repository_type }}"
backend_stream_type: "{{ backend_stream_type }}"
backend_pubsub_type: "{{ backend_pubsub_type }}"
diff --git a/nuxeo-dev-apb/templates/pipeline-service.yml.j2 b/nuxeo-dev-apb/templates/pipeline-service.yml.j2
index f564bfc..ffe2335 100644
--- a/nuxeo-dev-apb/templates/pipeline-service.yml.j2
+++ b/nuxeo-dev-apb/templates/pipeline-service.yml.j2
@@ -17,4 +17,4 @@ spec:
parameters:
app_name: "{{ app_name }}"
pipeline_git_ref: "{{ project_git_ref }}"
-
+ pipeline_definition: "{{ 'studio' if studio_only else 'uat-dev' }}"
diff --git a/nuxeo-dev-apb/vars/main.yaml b/nuxeo-dev-apb/vars/main.yaml
index e416ba6..1660b02 100644
--- a/nuxeo-dev-apb/vars/main.yaml
+++ b/nuxeo-dev-apb/vars/main.yaml
@@ -56,6 +56,7 @@ pod_name: "{{ lookup('env', 'POD_NAME') }}"
pod_namespace: "{{ lookup('env', 'POD_NAMESPACE') }}"
in_cluster: "{{ True if (pod_name and pod_namespace) else False }}"

+studio_only: "{{ True if (_apb_plan_id == 'studio-only') else False }}"

default_pipeline_name: "default"
global_config_name: "{{ app_name }}-global-config"
diff --git a/nuxeo-pipeline-apb/apb.yml b/nuxeo-pipeline-apb/apb.yml
index b9a00c1..0fb5977 100644
--- a/nuxeo-pipeline-apb/apb.yml
+++ b/nuxeo-pipeline-apb/apb.yml
@@ -35,5 +35,5 @@ plans:
- name: pipeline_definition
default: 'uat-dev'
type: enum
- enum: ['uat-dev','single']
+ enum: ['uat-dev','single', 'studio']
title: Pipeline definition to use
diff --git a/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2 b/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
index 6fb14f8..c5717b0 100644
--- a/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
+++ b/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
@@ -22,6 +22,9 @@ spec:
type: Binary
strategy:
dockerStrategy:
+ env:
+ - name: FORCE_STUDIO_PACKAGE_INSTALL
+ value: {{ global_config.studio_only }}
forcePull: true
from:
kind: ImageStreamTag
diff --git a/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2 b/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
index ee9c4bd..d3d00ba 100644
--- a/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
+++ b/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
@@ -1,7 +1,9 @@
FROM {{ base_image_name }}:latest
# Set up the /build folder with the install script, the marketplace package and the studio credentials
USER root
-COPY marketplace.zip /build/marketplace
+{% if not global_config.studio_only %}
+ COPY marketplace.zip /build/marketplace
+{% endif %}
RUN chmod -R 777 /build
COPY ./connect.properties /opt/nuxeo/connect/connect.properties
RUN chmod 777 /opt/nuxeo/connect/connect.properties
@@ -13,4 +15,4 @@ USER root
RUN rm -f /opt/nuxeo/connect/connect.properties && \
chgrp -fR 0 /opt/nuxeo/server/ && \
chmod -fR g+rwX /opt/nuxeo/server/
-USER 1000
\ No newline at end of file
+USER 1000
diff --git a/nuxeo-pipeline-apb/templates/nuxeo-service.yml.j2 b/nuxeo-pipeline-apb/templates/nuxeo-service.yml.j2
index 5d43b3a..1f3f238 100644
--- a/nuxeo-pipeline-apb/templates/nuxeo-service.yml.j2
+++ b/nuxeo-pipeline-apb/templates/nuxeo-service.yml.j2
@@ -30,7 +30,7 @@ spec:
applicationUrl: "{{ app_name }}-{{ item }}.apps.prod.nuxeo.io"
nuxeoPackages: "{{ global_config.nuxeo_packages }}"
nuxeoTemplates: "{{ global_config.nuxeo_templates }}"
- nuxeoStudioProject:
+ nuxeoStudioProject: "{{ global_config.nuxeo_studio_project }}"
connect_enabled: true
connectExistingSecret: "{{ global_config.connect_secret_name}} "
nuxeoJavaOpts: "-Xms512m -Xmx1024m -Djava.net.preferIPv4Stack=true"
diff --git a/nuxeo-pipeline-apb/vars/main.yml b/nuxeo-pipeline-apb/vars/main.yml
index afa92b4..ef505b5 100644
--- a/nuxeo-pipeline-apb/vars/main.yml
+++ b/nuxeo-pipeline-apb/vars/main.yml
@@ -24,6 +24,15 @@ pipeline_map:
path: jenkinsfile/Jenkinsfile-single
environments:
- "{{ pipeline_name }}"
+ studio:
+ jenkinsfile:
+ git:
+ uri: "https://github.com/nuxeo/nuxeo-openshift"
+ ref: master
+ path: jenkinsfile/Jenkinsfile-studio
+ environments:
+ - dev
+ - uat

pipeline: "{{ pipeline_map[pipeline_definition] }}"

diff --git a/scripts/install.sh b/scripts/install.sh
index 365dd6a..0e2c3c3 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -18,13 +18,13 @@ function fixRights() {

echo "---> Installing what has been built"
find /build
+ADDITIONAL_NUXEO_PACKAGES=""

if [ "$(ls -A /build/artifacts 2>/dev/null)" ]; then
echo "---> Copying JAR artifacts in bundles directory"
cp -v /build/artifacts/*.jar $NUXEO_HOME/nxserver/bundles
fi

-
if [ -f /build/nuxeo.conf ]; then
echo "---> Copying nuxeo.conf"
cp -v /build/nuxeo.conf /docker-entrypoint-init.d/
@@ -42,6 +42,12 @@ if [ -f /opt/nuxeo/connect/connect.properties ]; then
/docker-entrypoint.sh nuxeoctl mp-hotfix
fi

+ if [ -n "$NUXEO_STUDIO_PROJECT_VERSION" ]; then
+ STUDIO_PACKAGE=$NUXEO_STUDIO_PROJECT-$NUXEO_STUDIO_PROJECT_VERSION
+ else
+ STUDIO_PACKAGE=$NUXEO_STUDIO_PROJECT-0.0.0-SNAPSHOT
+ fi
+
else
echo "---> No connect.properties found"
fi
@@ -53,12 +59,25 @@ if [ "$(ls -A /build/marketplace 2>/dev/null)" ]; then
/docker-entrypoint.sh nuxeoctl mp-init
/docker-entrypoint.sh $NUXEO_HOME/bin/nuxeoctl mp-install /build/marketplace/$PACKAGE
else
- echo "---> No Nuxeo Package found"
+ echo "---> No Nuxeo Package found"
fi

if [ -n "$NUXEO_PACKAGES" ]; then
- echo "---> Installing additional packages $NUXEO_PACKAGES"
- /docker-entrypoint.sh $NUXEO_HOME/bin/nuxeoctl mp-install $NUXEO_PACKAGES
+ ADDITIONAL_NUXEO_PACKAGES=$NUXEO_PACKAGES
+fi
+
+if [ -n "$FORCE_STUDIO_PACKAGE_INSTALL" ]; then
+ echo "---> Forcing installation of Studio Package $STUDIO_PACKAGE"
+ ADDITIONAL_NUXEO_PACKAGES="$ADDITIONAL_NUXEO_PACKAGES $STUDIO_PACKAGE"
+else
+ echo "---> No forcing of Studio Package installation"
+fi
+
+if [ "$ADDITIONAL_NUXEO_PACKAGES" != "" ]; then
+ echo "---> Installing additional packages $ADDITIONAL_NUXEO_PACKAGES"
+ /docker-entrypoint.sh $NUXEO_HOME/bin/nuxeoctl mp-install $ADDITIONAL_NUXEO_PACKAGES
+else
+ echo "---> No additional Nuxeo Package to install"
fi

echo "---> Resetting image configuration"
--
You received this message because you are subscribed to the Google Groups "ecm-checkins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ecm-checkins+***@lists.nuxeo.com.
Visit this group at https://groups.google.com/a/lists.nuxeo.com/group/ecm-checkins/.
Estelle Giuly
2018-12-11 09:54:43 UTC
Permalink
Message:
NXCT-127: Make studio-only plan work

Repository: nuxeo-openshift
Branch: NXCT-127-studio-only
Author: Estelle Giuly <***@nuxeo.com>
Date: 2018-12-11T09:54:35 UTC
URL: https://github.com/nuxeo/nuxeo-openshift/commit/e599364e49b3b1349d177b4a5c53f3642e8e72cf
JIRA: https://jira.nuxeo.com/browse/NXCT-127

Files:
A jenkinsfile/Jenkinsfile-studio
M nuxeo-dev-apb/apb.yml
M nuxeo-dev-apb/defaults/main.yml
M nuxeo-dev-apb/tasks/main.yml
M nuxeo-dev-apb/templates/global-config.yml.j2
M nuxeo-dev-apb/templates/pipeline-service.yml.j2
M nuxeo-dev-apb/vars/main.yaml
M nuxeo-pipeline-apb/apb.yml
M nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
M nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
M nuxeo-pipeline-apb/vars/main.yml
M scripts/install.sh

diff --git a/jenkinsfile/Jenkinsfile-studio b/jenkinsfile/Jenkinsfile-studio
new file mode 100644
index 0000000..e675d52
--- /dev/null
+++ b/jenkinsfile/Jenkinsfile-studio
@@ -0,0 +1,114 @@
+def nuxeo_image_build = ""
+def app_name = ""
+def nuxeo_image_name = ""
+
+pipeline {
+ agent {
+ node {
+ label 'master'
+ }
+ }
+
+ options {
+ timeout(time: 60, unit: 'MINUTES')
+ }
+
+ stages {
+
+ stage('Initialize') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ app_name = env.APP_NAME
+ echo "Using project: ${openshift.project()} with app: ${app_name}"
+ nuxeo_image_build = env.NUXEO_IMAGE_BUILD
+ nuxeo_image_name = env.NUXEO_IMAGE_NAME
+ }
+ }
+ }
+ }
+ }
+
+ stage('Build Docker image') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ // Build docker image
+ openshift.selector("bc", nuxeo_image_build).startBuild("--wait")
+ def build_last_version = openshift.selector("bc", nuxeo_image_build).object().status.lastVersion
+ def last_build = openshift.selector("builds", "${nuxeo_image_build}-${build_last_version}")
+ timeout(10) {
+ waitUntil {
+ last_build.object().status.phase == "Complete"
+ }
+ }
+
+ // Promote to dev
+ openshift.tag("${nuxeo_image_name}:latest", "${nuxeo_image_name}:dev")
+ }
+ }
+ }
+ }
+ }
+
+ stage('Deploy DEV') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ openshiftDeploy(deploymentConfig: "${app_name}-dev-interactive")
+ timeout(5) {
+ openshift.selector("dc", "${app_name}-dev-interactive").related('pods').untilEach(1) {
+ return (it.object().status.phase == "Running")
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ stage('User validation') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ timeout(60) {
+ input message: "Do you want to deploy to UAT environment too?", id: "approval"
+ openshift.tag("${nuxeo_image_name}:latest", "${nuxeo_image_name}:uat")
+ }
+ }
+ }
+ }
+ }
+ }
+
+ stage('Deploy UAT') {
+ steps {
+ script {
+ openshift.withCluster() {
+ openshift.withProject() {
+ openshiftDeploy(deploymentConfig: "${app_name}-uat-interactive")
+ timeout(5) {
+ openshift.selector("dc", "${app_name}-uat-interactive").related('pods').untilEach(1) {
+ return (it.object().status.phase == "Running")
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ post {
+ always {
+ // Clean workspace
+ cleanWs()
+ }
+ }
+
+}
diff --git a/nuxeo-dev-apb/apb.yml b/nuxeo-dev-apb/apb.yml
index b69289c..919fa3a 100644
--- a/nuxeo-dev-apb/apb.yml
+++ b/nuxeo-dev-apb/apb.yml
@@ -156,44 +156,55 @@ plans:
default: shared
display_group: Backend storages

- # TODO: Make studio-only plan work before showing it available.
- #
- # - name: studio-only
- # description: Development with Studio project only
- # free: true
- # metadata: {}
- # parameters:
- # - name: project_name
- # type: string
- # title: Project Name
-
- # - name: nuxeo_connect_username
- # type: string
- # title: |
- # A Nuxeo Connect userId used to register the instance, pull
- # studio project etc...
-
- # - name: nuxeo_connect_token
- # type: string
- # title: |
- # A token for the Connect account
- # ( https://connect.nuxeo.com/nuxeo/site/connect/tokens )
- # display_type: password
-
- # - name: nuxeo_studio_project
- # type: string
- # title: The name of the studio project to register to
-
- # - name: nuxeo_studio_version
- # type: string
- # title: The name of the studio project to register to
-
- # - name: backend_pv_storage_class
- # type: string
- # title: Storage class for backend persistence volumes
- # default: gp2
-
- # - name: binaries_pv_storage_class
- # type: string
- # title: Storage class for backend persistence volumes
- # default: shared
+ - name: studio-only
+ description: Development with Studio project only
+ free: true
+ metadata: {}
+ parameters:
+ - name: project_name
+ type: string
+ title: Project Name
+
+ - name: nuxeo_connect_username
+ type: string
+ title: |
+ A Nuxeo Connect userId used to register the instance, pull
+ studio project etc...
+
+ - name: nuxeo_connect_token
+ type: string
+ title: |
+ A token for the Connect account
+ ( https://connect.nuxeo.com/nuxeo/site/connect/tokens )
+ display_type: password
+
+ - name: nuxeo_studio_project
+ type: string
+ title: The name of the studio project to register to
+
+ - name: nuxeo_studio_version
+ type: string
+ title: The version of the studio project to register to
+
+ - name: nuxeo_version
+ default: '9.10'
+ type: enum
+ enum: ['8.10','9.10', '10.2', 'master']
+ title: Nuxeo version to use
+ display_group: Nuxeo Configuration
+
+ - name: nuxeo_packages
+ default: 'nuxeo-web-ui'
+ type: string
+ title: List of Nuxeo packages to install at startup
+ display_group: Nuxeo Configuration
+
+ - name: backend_pv_storage_class
+ type: string
+ title: Storage class for backend persistence volumes
+ default: gp2
+
+ - name: binaries_pv_storage_class
+ type: string
+ title: Storage class for backend persistence volumes
+ default: shared
diff --git a/nuxeo-dev-apb/defaults/main.yml b/nuxeo-dev-apb/defaults/main.yml
index 2ce25fc..d61fc68 100644
--- a/nuxeo-dev-apb/defaults/main.yml
+++ b/nuxeo-dev-apb/defaults/main.yml
@@ -39,4 +39,5 @@ nuxeo_connect_token: ""
hotfix_release_username: nuxeo
hotfix_release_password: nuxeo

+studio_only: false
testing: false
diff --git a/nuxeo-dev-apb/tasks/main.yml b/nuxeo-dev-apb/tasks/main.yml
index 7109d3c..4e7d0a2 100644
--- a/nuxeo-dev-apb/tasks/main.yml
+++ b/nuxeo-dev-apb/tasks/main.yml
@@ -43,4 +43,4 @@
- name: "Update last operation"
asb_last_operation:
description: "100%: Cluster objects state={{ state }}"
- when: in_cluster
\ No newline at end of file
+ when: in_cluster
diff --git a/nuxeo-dev-apb/templates/global-config.yml.j2 b/nuxeo-dev-apb/templates/global-config.yml.j2
index 3c4bb02..20f59e1 100644
--- a/nuxeo-dev-apb/templates/global-config.yml.j2
+++ b/nuxeo-dev-apb/templates/global-config.yml.j2
@@ -21,6 +21,7 @@ data:
nuxeo_version: "{{ nuxeo_version }}"
nuxeo_packages: "{{ nuxeo_packages }}"
nuxeo_templates: "{{ nuxeo_templates }}"
+ studio_only: "{{ studio_only }}"
backend_repository_type: "{{ backend_repository_type }}"
backend_stream_type: "{{ backend_stream_type }}"
backend_pubsub_type: "{{ backend_pubsub_type }}"
diff --git a/nuxeo-dev-apb/templates/pipeline-service.yml.j2 b/nuxeo-dev-apb/templates/pipeline-service.yml.j2
index f564bfc..ffe2335 100644
--- a/nuxeo-dev-apb/templates/pipeline-service.yml.j2
+++ b/nuxeo-dev-apb/templates/pipeline-service.yml.j2
@@ -17,4 +17,4 @@ spec:
parameters:
app_name: "{{ app_name }}"
pipeline_git_ref: "{{ project_git_ref }}"
-
+ pipeline_definition: "{{ 'studio' if studio_only else 'uat-dev' }}"
diff --git a/nuxeo-dev-apb/vars/main.yaml b/nuxeo-dev-apb/vars/main.yaml
index e416ba6..1660b02 100644
--- a/nuxeo-dev-apb/vars/main.yaml
+++ b/nuxeo-dev-apb/vars/main.yaml
@@ -56,6 +56,7 @@ pod_name: "{{ lookup('env', 'POD_NAME') }}"
pod_namespace: "{{ lookup('env', 'POD_NAMESPACE') }}"
in_cluster: "{{ True if (pod_name and pod_namespace) else False }}"

+studio_only: "{{ True if (_apb_plan_id == 'studio-only') else False }}"

default_pipeline_name: "default"
global_config_name: "{{ app_name }}-global-config"
diff --git a/nuxeo-pipeline-apb/apb.yml b/nuxeo-pipeline-apb/apb.yml
index b9a00c1..0fb5977 100644
--- a/nuxeo-pipeline-apb/apb.yml
+++ b/nuxeo-pipeline-apb/apb.yml
@@ -35,5 +35,5 @@ plans:
- name: pipeline_definition
default: 'uat-dev'
type: enum
- enum: ['uat-dev','single']
+ enum: ['uat-dev','single', 'studio']
title: Pipeline definition to use
diff --git a/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2 b/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
index 6fb14f8..c5717b0 100644
--- a/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
+++ b/nuxeo-pipeline-apb/templates/nuxeo-image-build.yml.j2
@@ -22,6 +22,9 @@ spec:
type: Binary
strategy:
dockerStrategy:
+ env:
+ - name: FORCE_STUDIO_PACKAGE_INSTALL
+ value: {{ global_config.studio_only }}
forcePull: true
from:
kind: ImageStreamTag
diff --git a/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2 b/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
index ee9c4bd..d3d00ba 100644
--- a/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
+++ b/nuxeo-pipeline-apb/templates/nuxeo-image-dockerfile.j2
@@ -1,7 +1,9 @@
FROM {{ base_image_name }}:latest
# Set up the /build folder with the install script, the marketplace package and the studio credentials
USER root
-COPY marketplace.zip /build/marketplace
+{% if not global_config.studio_only %}
+ COPY marketplace.zip /build/marketplace
+{% endif %}
RUN chmod -R 777 /build
COPY ./connect.properties /opt/nuxeo/connect/connect.properties
RUN chmod 777 /opt/nuxeo/connect/connect.properties
@@ -13,4 +15,4 @@ USER root
RUN rm -f /opt/nuxeo/connect/connect.properties && \
chgrp -fR 0 /opt/nuxeo/server/ && \
chmod -fR g+rwX /opt/nuxeo/server/
-USER 1000
\ No newline at end of file
+USER 1000
diff --git a/nuxeo-pipeline-apb/vars/main.yml b/nuxeo-pipeline-apb/vars/main.yml
index afa92b4..ef505b5 100644
--- a/nuxeo-pipeline-apb/vars/main.yml
+++ b/nuxeo-pipeline-apb/vars/main.yml
@@ -24,6 +24,15 @@ pipeline_map:
path: jenkinsfile/Jenkinsfile-single
environments:
- "{{ pipeline_name }}"
+ studio:
+ jenkinsfile:
+ git:
+ uri: "https://github.com/nuxeo/nuxeo-openshift"
+ ref: master
+ path: jenkinsfile/Jenkinsfile-studio
+ environments:
+ - dev
+ - uat

pipeline: "{{ pipeline_map[pipeline_definition] }}"

diff --git a/scripts/install.sh b/scripts/install.sh
index 365dd6a..0e2c3c3 100644
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -18,13 +18,13 @@ function fixRights() {

echo "---> Installing what has been built"
find /build
+ADDITIONAL_NUXEO_PACKAGES=""

if [ "$(ls -A /build/artifacts 2>/dev/null)" ]; then
echo "---> Copying JAR artifacts in bundles directory"
cp -v /build/artifacts/*.jar $NUXEO_HOME/nxserver/bundles
fi

-
if [ -f /build/nuxeo.conf ]; then
echo "---> Copying nuxeo.conf"
cp -v /build/nuxeo.conf /docker-entrypoint-init.d/
@@ -42,6 +42,12 @@ if [ -f /opt/nuxeo/connect/connect.properties ]; then
/docker-entrypoint.sh nuxeoctl mp-hotfix
fi

+ if [ -n "$NUXEO_STUDIO_PROJECT_VERSION" ]; then
+ STUDIO_PACKAGE=$NUXEO_STUDIO_PROJECT-$NUXEO_STUDIO_PROJECT_VERSION
+ else
+ STUDIO_PACKAGE=$NUXEO_STUDIO_PROJECT-0.0.0-SNAPSHOT
+ fi
+
else
echo "---> No connect.properties found"
fi
@@ -53,12 +59,25 @@ if [ "$(ls -A /build/marketplace 2>/dev/null)" ]; then
/docker-entrypoint.sh nuxeoctl mp-init
/docker-entrypoint.sh $NUXEO_HOME/bin/nuxeoctl mp-install /build/marketplace/$PACKAGE
else
- echo "---> No Nuxeo Package found"
+ echo "---> No Nuxeo Package found"
fi

if [ -n "$NUXEO_PACKAGES" ]; then
- echo "---> Installing additional packages $NUXEO_PACKAGES"
- /docker-entrypoint.sh $NUXEO_HOME/bin/nuxeoctl mp-install $NUXEO_PACKAGES
+ ADDITIONAL_NUXEO_PACKAGES=$NUXEO_PACKAGES
+fi
+
+if [ -n "$FORCE_STUDIO_PACKAGE_INSTALL" ]; then
+ echo "---> Forcing installation of Studio Package $STUDIO_PACKAGE"
+ ADDITIONAL_NUXEO_PACKAGES="$ADDITIONAL_NUXEO_PACKAGES $STUDIO_PACKAGE"
+else
+ echo "---> No forcing of Studio Package installation"
+fi
+
+if [ "$ADDITIONAL_NUXEO_PACKAGES" != "" ]; then
+ echo "---> Installing additional packages $ADDITIONAL_NUXEO_PACKAGES"
+ /docker-entrypoint.sh $NUXEO_HOME/bin/nuxeoctl mp-install $ADDITIONAL_NUXEO_PACKAGES
+else
+ echo "---> No additional Nuxeo Package to install"
fi

echo "---> Resetting image configuration"
--
You received this message because you are subscribed to the Google Groups "ecm-checkins" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ecm-checkins+***@lists.nuxeo.com.
Visit this group at https://groups.google.com/a/lists.nuxeo.com/group/ecm-checkins/.
Loading...