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 Nodejs Quickstarters #1046

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -2,6 +2,7 @@

## Unreleased

- Update Angular, Ionic and Typescript Quickstarters ([#1033](https://github.com/opendevstack/ods-quickstarters/issues/1033))
- Update Rust Axum Quickstarter to Rust 1.79.0 ([#1024](https://github.com/opendevstack/ods-quickstarters/pull/1024))
- Gitleaks docs fix and update ([#1028](https://github.com/opendevstack/ods-quickstarters/issues/1028))
- Enable OpenSSL vendored compilation for Rust Jenkins Agent ([#1026](https://github.com/opendevstack/ods-quickstarters/pull/1026))
Expand Down
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ install-jenkins-agent: install-jenkins-agent-golang install-jenkins-agent-jdk in
.PHONY: install-jenkins-agent

## Update OpenShift resources related Jenkins agent resources.
apply-jenkins-agent-build: apply-jenkins-agent-golang-build apply-jenkins-agent-jdk-build apply-jenkins-agent-nodejs16-build apply-jenkins-agent-nodejs18-build apply-jenkins-agent-nodejs20-build apply-jenkins-agent-python-build apply-jenkins-agent-scala-build apply-jenkins-agent-terraform-build apply-jenkins-agent-terraform-build-2306 apply-jenkins-agent-rust-build
apply-jenkins-agent-build: apply-jenkins-agent-golang-build apply-jenkins-agent-jdk-build apply-jenkins-agent-nodejs16-build apply-jenkins-agent-nodejs18-build apply-jenkins-agent-nodejs20-build apply-jenkins-agent-nodejs22-build apply-jenkins-agent-python-build apply-jenkins-agent-scala-build apply-jenkins-agent-terraform-build apply-jenkins-agent-terraform-build-2306 apply-jenkins-agent-rust-build
.PHONY: apply-jenkins-agent-build

## Start builds of Jenkins agents.
start-jenkins-agent-build: start-jenkins-agent-golang-build start-jenkins-agent-jdk-build start-jenkins-agent-nodejs16-build start-jenkins-agent-nodejs18-build start-jenkins-agent-nodejs20-build start-jenkins-agent-python-build start-jenkins-agent-scala-build start-jenkins-agent-terraform-build start-jenkins-agent-terraform-build-2306 start-jenkins-agent-rust-build
start-jenkins-agent-build: start-jenkins-agent-golang-build start-jenkins-agent-jdk-build start-jenkins-agent-nodejs16-build start-jenkins-agent-nodejs18-build start-jenkins-agent-nodejs20-build start-jenkins-agent-nodejs22-build start-jenkins-agent-python-build start-jenkins-agent-scala-build start-jenkins-agent-terraform-build start-jenkins-agent-terraform-build-2306 start-jenkins-agent-rust-build
.PHONY: start-jenkins-agent-build


Expand Down Expand Up @@ -54,7 +54,7 @@ start-jenkins-agent-jdk-build:

# JENKINS AGENT NODEJS
## Install or update Jenkins Node agent resources.
install-jenkins-agent-nodejs: apply-jenkins-agent-nodejs16-build apply-jenkins-agent-nodejs18-build apply-jenkins-agent-nodejs20-build start-jenkins-agent-nodejs16-build start-jenkins-agent-nodejs18-build start-jenkins-agent-nodejs20-build
install-jenkins-agent-nodejs: apply-jenkins-agent-nodejs16-build apply-jenkins-agent-nodejs18-build apply-jenkins-agent-nodejs20-build apply-jenkins-agent-nodejs22-build start-jenkins-agent-nodejs16-build start-jenkins-agent-nodejs18-build start-jenkins-agent-nodejs20-build start-jenkins-agent-nodejs22-build
.PHONY: install-jenkins-agent-nodejs

## Update OpenShift resources related to Jenkins Node 16 agent image.
Expand All @@ -72,6 +72,11 @@ apply-jenkins-agent-nodejs20-build:
cd common/jenkins-agents/nodejs20/ocp-config && tailor apply --namespace $(ODS_NAMESPACE)
.PHONY: apply-jenkins-agent-nodejs20-build

## Update OpenShift resources related to Jenkins Node 22 agent image.
apply-jenkins-agent-nodejs22-build:
cd common/jenkins-agents/nodejs22/ocp-config && tailor apply --namespace $(ODS_NAMESPACE)
.PHONY: apply-jenkins-agent-nodejs22-build

## Start build of BuildConfig "jenkins-agent-nodejs16".
start-jenkins-agent-nodejs16-build:
oc -n $(ODS_NAMESPACE) start-build jenkins-agent-nodejs16 --follow
Expand All @@ -87,6 +92,11 @@ start-jenkins-agent-nodejs20-build:
oc -n $(ODS_NAMESPACE) start-build jenkins-agent-nodejs20 --follow
.PHONY: start-jenkins-agent-nodejs20-build

## Start build of BuildConfig "jenkins-agent-nodejs22".
start-jenkins-agent-nodejs22-build:
oc -n $(ODS_NAMESPACE) start-build jenkins-agent-nodejs22 --follow
.PHONY: start-jenkins-agent-nodejs22-build

# JENKINS AGENT PYTHON
## Install or update Jenkins Python agent resources.
install-jenkins-agent-python: apply-jenkins-agent-python-build start-jenkins-agent-python-build
Expand Down
10 changes: 5 additions & 5 deletions be-typescript-express/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ node {
library("ods-jenkins-shared-library@${sharedLibraryRef}")

odsQuickstarterPipeline(
imageStreamTag: "${odsNamespace}/jenkins-agent-nodejs20:${agentImageTag}",
imageStreamTag: "${odsNamespace}/jenkins-agent-nodejs22:${agentImageTag}",
) { context ->

stage("init Project") {
Expand All @@ -24,11 +24,11 @@ odsQuickstarterPipeline(
sh "npm init -y"

print "Install dependencies"
def typescriptVersion = "5.3.2"
def nodeTypeVersion = "20.10.0"
def expressVersion = "4.18.2"
def typescriptVersion = "5.5.4"
def nodeTypeVersion = "22.4.1"
def expressVersion = "4.19.2"
def jestVersion = "29.7.0"
def jestTypeVersion = "29.5.10"
def jestTypeVersion = "29.5.12"
def jestJunitVersion = "16.0.0"

sh "npm i typescript@$typescriptVersion express@$expressVersion @types/node@$nodeTypeVersion jest@$jestVersion @types/jest@$jestTypeVersion"
Expand Down
2 changes: 1 addition & 1 deletion be-typescript-express/Jenkinsfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@Library('ods-jenkins-shared-library@@shared_library_ref@') _

odsComponentPipeline(
imageStreamTag: '@ods_namespace@/jenkins-agent-nodejs20:@agent_image_tag@',
imageStreamTag: '@ods_namespace@/jenkins-agent-nodejs22:@agent_image_tag@',
branchToEnvironmentMapping: [
'master': 'dev',
// 'release/': 'test'
Expand Down
2 changes: 1 addition & 1 deletion be-typescript-express/files/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20-alpine
FROM node:22-alpine

COPY dist /node

Expand Down
2 changes: 1 addition & 1 deletion be-typescript-express/files/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: TypeScript
description: "TypeScript is an open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript, and adds optional static typing to the language. TypeScript is designed for development of large applications and transcompiles to JavaScript. Technologies: TypeScript 5.x, Node 20"
description: "TypeScript is an open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript, and adds optional static typing to the language. TypeScript is designed for development of large applications and transcompiles to JavaScript. Technologies: TypeScript 5.x, Node 22"
supplier: https://www.typescriptlang.org
version: 4.x
type: ods
12 changes: 6 additions & 6 deletions docs/modules/quickstarters/pages/be-typescript-express.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

== Purpose of this quickstarter (use this when you want to ...)

This is a https://nodejs.org/en/[Node.js] (v20) quickstarter with https://expressjs.com/[express] using http://www.typescriptlang.org/[Typescript].
This is a https://nodejs.org/en/[Node.js] (v22) quickstarter with https://expressjs.com/[express] using http://www.typescriptlang.org/[Typescript].
If you are doing non-blocking operation and does not have heavy algorithm/Job which consumes lots of CPU power, this could be an ideal fit.
It contains a basic setup for https://www.docker.com/[Docker], https://jenkins.io/[Jenkins], https://www.sonarqube.org/[SonarQube] and https://www.openshift.com/[OpenShift].

Expand Down Expand Up @@ -33,15 +33,15 @@ The package json is generated by simply using `npm init -y`, while the tsconfig

== Frameworks used

. https://expressjs.com/[Express ({caret}4.18.2)]
. https://expressjs.com/[Express ({caret}4.19.2)]
. https://jestjs.io/[Jest ({caret}29.7.0) for Unit Testing]
. http://www.typescriptlang.org/[Typescript ({caret}5.3.2)]
. http://www.typescriptlang.org/[Typescript ({caret}5.5.4)]

== Libraries
On top of the mentioned frameworks above, we use libraries:

. https://www.npmjs.com/package/jest-junit/[Jest Junit ({caret}16.0.0)]
. https://www.npmjs.com/package/@types/node[@types/node ({caret}20.10.0)]
. https://www.npmjs.com/package/@types/node[@types/node ({caret}22.4.1)]

== Node version
When you push your code, your runtime and test code will be compiled using node v10. After deployment the compiled code also runs in node v10. If you developed your code and tests using a different node version locally, this might cause some problems.
Expand Down Expand Up @@ -76,7 +76,7 @@ version: 1.0.1
type: ods
role: backend
runtime: node
runtimeVersion: 20
runtimeVersion: 22
```


Expand All @@ -91,7 +91,7 @@ include::partials$secret-scanning-with-gitleaks.adoc

== Builder agent used

This quickstarter uses https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs20[Node.JS 20 builder agent] for Jenkins.
This quickstarter uses https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs22[Node.JS 22 builder agent] for Jenkins.

== Known limitations

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/quickstarters/pages/fe-angular.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ version: 1.0.1
type: ods
role: frontend
runtime: angular-cli
runtimeVersion: 18.0.1
runtimeVersion: 18.2.1
```

== How this quickstarter is built through Jenkins
Expand Down
2 changes: 1 addition & 1 deletion fe-angular/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ node {

library("ods-jenkins-shared-library@${sharedLibraryRef}")

def angularCliVersion = "18.0.1"
def angularCliVersion = "18.2.1"

odsQuickstarterPipeline(
imageStreamTag: "${odsNamespace}/jenkins-agent-nodejs22:${agentImageTag}",
Expand Down
2 changes: 1 addition & 1 deletion fe-angular/files/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx:1.26.0-alpine
FROM nginx:1.27.1-alpine

RUN chmod -R 777 /var/log/nginx /var/cache/nginx /var/run \
&& chgrp -R 0 /etc/nginx \
Expand Down
2 changes: 1 addition & 1 deletion fe-angular/files/metadata.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Angular
description: "Angular is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations. Technologies: Angular 18.0.1"
description: "Angular is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations. Technologies: Angular 18.2.1"
supplier: https://angular.io
version: 4.x
type: ods
2 changes: 1 addition & 1 deletion fe-ionic/files/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nginx:1.25.3-alpine
FROM nginx:1.27.1-alpine

RUN chmod -R 777 /var/log/nginx /var/cache/nginx /var/run \
&& chgrp -R 0 /etc/nginx \
Expand Down