openshift-pipelines / task-containers Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
task-containers/.github/workflows/release.yaml
Lines 17 to 19 in 75564f7
This action should be coming from openshift-pipelines/release-tektoncd-task
Certain s2i
builder-images need a alternative location for the workflow scripts, i.e.:
$ s2i build --help |grep image-scripts-url
--image-scripts-url string Specify a URL containing the default assemble and run scripts for the builder image (default "image:///usr/libexec/s2i")
The s2i
Tasks rendered by this project should as well support this configuration accordingly, like for instance an additional param.
The template being followed in the repository doesn't work for Java and .NET repositories. Checked it with all sorts of base builder images certified by Red Hat.
The task(s) we publish from here should rely on Red Hat supported images, aka from registry.redhat.io (and worse case from a trusted quay.io organization).
As of today, we rely on docker.io/library/bash
, which we should probably change to use ubi
directly.
Source-to-Image (s2i
) supports a alternative directory to narrow down the container build context, relative to the source code repository root. Here supported by passing the SUBDIRECTORY
param location to the s2i build
command:
task-containers/scripts/s2i-generate.sh
Lines 35 to 38 in 4d82da5
The tool copies the context data to the same directory where the Containerfile (Dockerfile.gen
) is generated, and later runs the following COPY
directive:
# Copying in source code
COPY upload/src /tmp/src
However, buildah
uses the same SUBDIRECTORY
param to define the build context based on source
Workspace, which is no longer the desired working directory for s2i
workflow causing buildah-bud.sh
to fail [0]:
task-containers/scripts/buildah-bud.sh
Lines 33 to 35 in 4d82da5
Thus, s2i-build.sh
script must intercept the PARAMS_SUBDIRECTORY
environment variable to ensure it's always set to .
(current working directory) before loading buildah-common.sh
, i.e.:
# loading buildah settings overwritting the full path to the container file
declare -x CONTAINERFILE_PATH_FULL="${S2I_CONTAINERFILE_PATH}"
# setting the buildah context directory to the same location s2i copied over it's context data, the
# same directory where the "--as-dockerfile" is set
declare -x PARAMS_SUBDIRECTORY="."
source "${cur_dir}/buildah-common.sh"
[0] Additionally, the error message is misleading, instead, it should mention the ${PWD}
because ${PARAMS_SUBDIRECTORY}
is a relative location.
The s2i
build workflow supports setting environment variables:
$ s2i build --help |grep env
-e, --env string Specify an single environment variable in NAME=VALUE format
-E, --environment-file string Specify the path to the file with environment
S2I Tasks rendered by this project should leverage the setting, like for instance on task-buildpacks repository ENV_VARS
param.
A practical approach is receiving the params via STDIN and loop over the key-value pairs:
steps:
- name: example
args: [ "$(params.ENV_VARS[*])" ]
Then, on s2i-generate.sh
script can loop over the arguments to store on a file, for instance:
for kv in "${@}"; do
# ...
done
The set of key-value should be stored on a temporary location (/s2i-generate/s2i.env
?), informed to s2i
using --environment-file
flag.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.