From 6008d85daa891de6dcb49e4885da073c23020e24 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Thu, 21 Sep 2023 19:14:14 -0300 Subject: [PATCH 1/2] add build command to devfile Change-Id: I90831fdd3ab07af88eec79a270425f34b300fd3b Signed-off-by: Nick Boldt --- devfile.yaml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/devfile.yaml b/devfile.yaml index b6055dc99..397090b46 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 Red Hat, Inc. +# Copyright (c) 2019-2023 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/ @@ -9,19 +9,26 @@ # Contributors: # Red Hat, Inc. - initial API and implementation # - schemaVersion: 2.1.0 - metadata: name: chectl-dev - components: - name: tooling-container - container: + container: image: 'quay.io/devfile/universal-developer-image:ubi8-latest' cpuLimit: 500m cpuRequest: 500m memoryLimit: 5G memoryRequest: 1G - - +commands: + - id: 1-build-chectl + exec: + label: "Build chectl" + component: tools + group: + kind: build + workingDir: ${PROJECT_SOURCE} + commandLine: >- + yarn && yarn pack-binaries +# optional other flags to pass include: +# --targets=linux-x64,arm64,... From 951add36b66a0de1e4a43a2feebb664a091a1529 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Thu, 21 Sep 2023 19:54:01 -0300 Subject: [PATCH 2/2] add build env requirements (need Node 18; then install yarn and latest npm too Change-Id: Ib6b46e97bb528d94b960b31bc95d5c47146e9fdb Signed-off-by: Nick Boldt --- devfile.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/devfile.yaml b/devfile.yaml index 397090b46..3e23c7104 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -21,6 +21,15 @@ components: memoryLimit: 5G memoryRequest: 1G commands: + - id: 0-build-env + exec: + label: "Install node and yarn" + component: tools + group: + kind: build + workingDir: ${PROJECT_SOURCE} + commandLine: >- + NODEJS_VERSION=18.18.0; nvm install $NODEJS_VERSION && nvm use v$NODEJS_VERSION && npm i yarn@1 npm@10 -g - id: 1-build-chectl exec: label: "Build chectl" @@ -29,6 +38,6 @@ commands: kind: build workingDir: ${PROJECT_SOURCE} commandLine: >- - yarn && yarn pack-binaries -# optional other flags to pass include: -# --targets=linux-x64,arm64,... + yarn && yarn pack-binaries --targets=linux-x64 +# optional other targets to build: +# --targets=linux-arm,linux-x64,linux-s390x,linux-ppc64le,darwin-x64,darwin-arm64,win32-x64,win32-x86