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

Propose namespaced tasks #404

Merged
merged 43 commits into from
Mar 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
79680e8
Propose local tasks
michaelsauter Jan 14, 2022
a4c7767
Update docs/proposals/local-tasks.adoc
michaelsauter Jan 14, 2022
fc20384
Update docs/proposals/local-tasks.adoc
michaelsauter Jan 18, 2022
3ae2183
Update docs/proposals/local-tasks.adoc
michaelsauter Jan 18, 2022
f1ccd37
Merge branch 'master' into task/task-location-proposal
kuebler Feb 25, 2022
c9f5d2b
Make `Task` the default instead of `ClusterTask`
kuebler Feb 25, 2022
5da0f36
Adjust architecture documentation incl. diagrams
kuebler Feb 25, 2022
6b00b73
Install tasks into testcase namespaces
kuebler Feb 25, 2022
7f8e0db
Use hardcoded values.*.yaml references for now
kuebler Feb 25, 2022
4da6c05
Remove values.generated.yaml from task chart installation in tests
kuebler Feb 25, 2022
ec4075c
Merge individual charts into umbrella chart with subcharts
kuebler Mar 1, 2022
75d67f5
Merge individual charts into umbrella chart with subcharts
kuebler Mar 1, 2022
2b1afa2
Merge remote-tracking branch 'origin/master' into task/task-location-…
kuebler Mar 1, 2022
b147dfd
Fix path in check-sidecar-tasks.sh
kuebler Mar 1, 2022
abc004c
Remove unused variable in install script
kuebler Mar 1, 2022
04cece4
Add name override to comply with the established naming convention
kuebler Mar 4, 2022
24e015f
Remove sidecars, allow for resource quotas and move sonar step to sep…
kuebler Mar 8, 2022
5ffec56
Adjust shellcheck to new folder structure
kuebler Mar 8, 2022
1a80257
Change buildconfigs to use inline dockerfile
kuebler Mar 8, 2022
bc0836f
Move aqua scanner download to buildconfig
kuebler Mar 8, 2022
862624b
Update ADRs and remove proposal
kuebler Mar 8, 2022
251ee7d
Rename subcharts
kuebler Mar 8, 2022
47099dd
Update README
kuebler Mar 8, 2022
d659a4b
Remove sidecar make target
kuebler Mar 8, 2022
50fdea6
Change hardcoded path in docs generator
kuebler Mar 8, 2022
33915a0
Remove sidecar task docs
kuebler Mar 8, 2022
56943bf
Load BC inline dockerfiles from (buildable) external dockerfiles
kuebler Mar 9, 2022
74b573f
Populate aquasec build arg in BC from secrets.yaml
kuebler Mar 10, 2022
0891018
Associate secret values with correct subcharts
kuebler Mar 10, 2022
50a3a11
Enable images chart by default
kuebler Mar 10, 2022
7ecae6d
Adjust documentation
kuebler Mar 10, 2022
5e353aa
Merge remote-tracking branch 'origin/master' into task/task-location-…
kuebler Mar 10, 2022
1bb6ecc
Add change to CHANGELOG
kuebler Mar 10, 2022
d73faac
Fix type in comment
kuebler Mar 14, 2022
8f5ca3e
Remove user guide heading and move contributer's guide
kuebler Mar 14, 2022
f0dca6f
Fix indentation
kuebler Mar 14, 2022
43e7b9f
Mention centrally provided images in ADR
kuebler Mar 14, 2022
e2faa42
Remove `taskRef.kind` hint from task authoring guide
kuebler Mar 14, 2022
553e02b
Fix version of node UBI image
kuebler Mar 14, 2022
129a726
Refer to PR from ADR
kuebler Mar 14, 2022
c582005
Remove unused options in values.yaml
kuebler Mar 14, 2022
f621f43
Fix typo in sidecar example
kuebler Mar 14, 2022
c91067d
Add hint how to use public images in kind cluster
kuebler Mar 14, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ listed in the changelog.
- Git LFS support enabled ([#420](https://github.com/opendevstack/ods-pipeline/issues/420))
- Publish images to public registry (ghcr.io) ([#440](https://github.com/opendevstack/ods-pipeline/issues/440))
- Allow to cache dependencies ([#147](https://github.com/opendevstack/ods-pipeline/issues/147)). See also proposal on caching ([#412](https://github.com/opendevstack/ods-pipeline/pull/412))
- Support node production builds in docker context ([#357](https://github.com/opendevstack/ods-pipeline/issues/357))

### Changed

Expand Down
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,7 @@ start-local-env: ## Restart stopped local environment.

##@ OpenShift

install-ods-central: ## OpenShift only! Apply ODS BuildConfig, ImageStream and Task manifests
ifeq ($(strip $(namespace)),)
@echo "Argument 'namespace' is required, e.g. make install-ods-central namespace=ods"
@exit 1
endif
cd scripts && ./install-ods-central-resources.sh -n $(namespace)
.PHONY: install-ods-central

start-ods-central-builds: ## OpenShift only! Start builds for each ODS BuildConfig
start-ods-builds: ## OpenShift only! Start builds for each ODS BuildConfig
oc start-build ods-buildah
oc start-build ods-finish
oc start-build ods-go-toolset
Expand All @@ -153,9 +145,9 @@ start-ods-central-builds: ## OpenShift only! Start builds for each ODS BuildConf
oc start-build ods-start
oc start-build ods-node16-typescript-toolset
oc start-build ods-pipeline-manager
.PHONY: start-ods-central-builds
.PHONY: start-ods-builds

##@ User Installation
##@ Installation

install-cd-namespace: ## Install resources in CD namespace via Helm.
ifeq ($(strip $(namespace)),)
Expand Down
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,8 @@ ODS Pipeline is well suited for regulated development (e.g. medical device softw

## Documentation

The documentation provided by ODS pipeline has three audiences:

* **Admins** install and maintain a central ODS pipeline installation in an OpenShift cluster that can be used by many users.

* **Users** consume an existing central ODS pipeline installation. Users install ODS pipeline resources into a namespace they own to run CI/CD pipelines for their repositories.

* **Contributors** work on the ODS pipeline project itself, for example by improving existing tasks, adding new ones, updating documentation, etc.

**Admin Guide**
* [Installation & Updating](/docs/admin-installation.adoc)

**User Guide**
kuebler marked this conversation as resolved.
Show resolved Hide resolved
* [Installation & Updating](/docs/user-installation.adoc)
* [Installation & Updating](/docs/installation.adoc)
* [Getting Started](/docs/getting-started.adoc)
* [ODS.YAML Reference](/docs/ods-configuration.adoc)
* [Task Reference](/docs/tasks)
Expand Down
38 changes: 36 additions & 2 deletions build/package/scripts/build-typescript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ copyLintReport() {
cp eslint-report.txt "${ROOT_DIR}/.ods/artifacts/lint-reports/${ARTIFACT_PREFIX}report.txt"
}

# the copy commands are based on GNU cp tools
# On a mac `brew install coreutils` gives `g` prefixed cmd line tools such as gcp
# to use these define env variable GNU_CP=gcp before invoking this script.
CP="${GNU_CP:-cp}"
BUILD_DIR="dist"
OUTPUT_DIR="docker"
WORKING_DIR="."
Expand Down Expand Up @@ -78,6 +82,16 @@ if [ -n "${NEXUS_HOST}" ] && [ -n "${NEXUS_USERNAME}" ] && [ -n "${NEXUS_PASSWOR
npm config set strict-ssl=false
fi;

echo "package-*.json checks ..."
if [ ! -f package.json ]; then
echo "File package.json not found"
exit 1
fi
if [ ! -f package-lock.json ]; then
echo "File package-lock.json not found"
exit 1
fi

echo "Installing dependencies ..."
npm ci --ignore-scripts

Expand All @@ -97,12 +111,19 @@ fi

echo "Building ..."
npm run build
# Copying most build output before testing so
# that additional modules which may be installed by testing
# is not included.
# However copying package.json too early can confuse the tests.
mkdir -p "${OUTPUT_DIR}"
cp -r "${BUILD_DIR}" "${OUTPUT_DIR}/dist"
echo "Copying contents of ${BUILD_DIR} into ${OUTPUT_DIR}/dist ..."
# see https://unix.stackexchange.com/questions/228597/how-to-copy-a-folder-recursively-in-an-idempotent-way-using-cp
"$CP" -r "${BUILD_DIR}/." "${OUTPUT_DIR}/dist"

if [ "${COPY_NODE_MODULES}" = true ]; then
echo "Copying node_modules to ${OUTPUT_DIR}/dist/node_modules ..."
cp -r node_modules "${OUTPUT_DIR}/dist/node_modules"
# note "${OUTPUT_DIR}/dist" exists now and node_modules name will be maintained.
"$CP" -r node_modules "${OUTPUT_DIR}/dist"
fi

echo "Testing ..."
Expand Down Expand Up @@ -131,4 +152,17 @@ else
cp build/coverage/lcov.info "${ROOT_DIR}/.ods/artifacts/code-coverage/${ARTIFACT_PREFIX}lcov.info"
fi

# Doing this earlier can confuse jest.
# test build_typescript_app_with_custom_build_directory fails with
# jest-haste-map: Haste module naming collision: src
# The following files share their name; please adjust your hasteImpl:
# * <rootDir>/package.json
# * <rootDir>/docker/package.json
# No tests found, exiting with code 1
# While one could demand to change the config of the test, there is no need
# to copy this earlier
echo "Copying package.json and package-lock.json to ${OUTPUT_DIR}/dist ..."
cp package.json package-lock.json "${OUTPUT_DIR}/dist"


supply-sonar-project-properties-default
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:

The following steps are executed:

- checks that package.json and package-lock.json exists to require best practice of using lock files. See also link:https://github.com/opendevstack/ods-pipeline/discussions/411[discussion 411]
- linting using `eslint`
- build typescript application, using `npm run build`
- test execution
Expand Down Expand Up @@ -82,13 +83,15 @@ spec:
- name: build-dir
description: >-
Must match the directory into which `npm run build` places files.
The files inside `build-dir` will be copied to `output-dir`.
The files inside `build-dir` will be copied to the `dist` folder in `output-dir`
As a result the files will be in `$output-dir/dist`
Other common build directories are `build` and `public`.
type: string
default: "dist"
- name: copy-node-modules
description: >-
Whether `node-modules` is copied to the `output-dir` or not.
If copied the node modules are in `$output-dir/dist/node_modules`.
For frontend components this should be set to "false",
while for backend components this should be set to "true".
type: string
Expand Down
124 changes: 0 additions & 124 deletions docs/admin-installation.adoc

This file was deleted.

Loading