Skip to content

Commit

Permalink
replace jenkins-agent for nodejs12 with nodejs 16, update chrome and …
Browse files Browse the repository at this point in the history
…yarn to latest, update quickstarters to use nodejs 16, update documentation
  • Loading branch information
cschweikert committed Mar 18, 2022
1 parent 7c9589a commit 929c653
Show file tree
Hide file tree
Showing 27 changed files with 57 additions and 56 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,34 @@ jobs:
--build-arg nexusPassword=s3cr3t \
.
jenkins-agent-nodejs12-centos7:
name: Jenkins agent NodeJS 12 (CENTOS7)
jenkins-agent-nodejs16-centos7:
name: Jenkins agent NodeJS 16 (CENTOS7)
runs-on: ubuntu-18.04
steps:
-
name: Checkout repository
uses: actions/[email protected]
-
name: Build docker image
working-directory: common/jenkins-agents/nodejs12/docker
working-directory: common/jenkins-agents/nodejs16/docker
run: |
docker build --tag agent-nodejs12-test-centos7 --file Dockerfile.centos7 \
docker build --tag agent-nodejs16-test-centos7 --file Dockerfile.centos7 \
--build-arg nexusUrl=https://nexus.example.com \
--build-arg nexusAuth=developer:s3cr3t \
.
jenkins-agent-nodejs12-ubi8:
name: Jenkins agent NodeJS 12 (UBI8)
jenkins-agent-nodejs16-ubi8:
name: Jenkins agent NodeJS 16 (UBI8)
runs-on: ubuntu-18.04
steps:
-
name: Checkout repository
uses: actions/[email protected]
-
name: Build docker image
working-directory: common/jenkins-agents/nodejs12/docker
working-directory: common/jenkins-agents/nodejs16/docker
run: |
docker build --tag agent-nodejs12-test-ubi8 --file Dockerfile.ubi8 \
docker build --tag agent-nodejs16-test-ubi8 --file Dockerfile.ubi8 \
--build-arg nexusUrl=https://nexus.example.com \
--build-arg nexusAuth=developer:s3cr3t \
.
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- inf-terraform-aws: Update versions for ruby, terraform, kitchen-terraform, Gemfile ([#677](https://github.com/opendevstack/ods-quickstarters/issues/677))
- jupyter lab: reduction to a minimal initial env ([#710](https://github.com/opendevstack/ods-quickstarters/issues/710))
- upgrade python flask quickstarter to Flask 2 version and general dependencies upgrades ([#746](https://github.com/opendevstack/ods-quickstarters/issues/746))
- replaced nodeJS 12 builder agent with nodeJS 16 builder agent ([#763](https://github.com/opendevstack/ods-quickstarters/issues/763)

## [4.0] - 2021-11-05

Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ ODS_NAMESPACE := $(shell grep ODS_NAMESPACE $(CURDIR)/../ods-configuration/ods-c

# JENKINS AGENT
## Install or update Jenkins agent resources.
install-jenkins-agent: install-jenkins-agent-golang install-jenkins-agent-maven install-jenkins-agent-nodejs12 install-jenkins-agent-python install-jenkins-agent-scala install-jenkins-agent-terraform
install-jenkins-agent: install-jenkins-agent-golang install-jenkins-agent-maven install-jenkins-agent-nodejs16 install-jenkins-agent-python install-jenkins-agent-scala install-jenkins-agent-terraform
.PHONY: install-jenkins-agent

## Update OpenShift resources related Jenkins agent resources.
apply-jenkins-agent-build: apply-jenkins-agent-golang-build apply-jenkins-agent-maven-build apply-jenkins-agent-nodejs12-build apply-jenkins-agent-python-build apply-jenkins-agent-scala-build apply-jenkins-agent-terraform-build
apply-jenkins-agent-build: apply-jenkins-agent-golang-build apply-jenkins-agent-maven-build apply-jenkins-agent-nodejs16-build apply-jenkins-agent-python-build apply-jenkins-agent-scala-build apply-jenkins-agent-terraform-build
.PHONY: apply-jenkins-agent-build

## Start builds of Jenkins agents.
start-jenkins-agent-build: start-jenkins-agent-golang-build start-jenkins-agent-maven-build start-jenkins-agent-nodejs12-build start-jenkins-agent-python-build start-jenkins-agent-scala-build start-jenkins-agent-terraform-build
start-jenkins-agent-build: start-jenkins-agent-golang-build start-jenkins-agent-maven-build start-jenkins-agent-nodejs16-build start-jenkins-agent-python-build start-jenkins-agent-scala-build start-jenkins-agent-terraform-build
.PHONY: start-jenkins-agent-build


Expand Down Expand Up @@ -54,18 +54,18 @@ start-jenkins-agent-maven-build:

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

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

## Start build of BuildConfig "jenkins-agent-nodejs12".
start-jenkins-agent-nodejs12-build:
oc -n $(ODS_NAMESPACE) start-build jenkins-agent-nodejs12 --follow
.PHONY: start-jenkins-agent-nodejs12-build
apply-jenkins-agent-nodejs16-build:
cd common/jenkins-agents/nodejs16/ocp-config && tailor apply --namespace $(ODS_NAMESPACE)
.PHONY: apply-jenkins-agent-nodejs16-build

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


# JENKINS AGENT PYTHON
Expand Down
2 changes: 1 addition & 1 deletion 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-nodejs12:${agentImageTag}",
imageStreamTag: "${odsNamespace}/jenkins-agent-nodejs16:${agentImageTag}",
) { context ->

stage("init Project") {
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-nodejs12:@agent_image_tag@',
imageStreamTag: '@ods_namespace@/jenkins-agent-nodejs16:@agent_image_tag@',
branchToEnvironmentMapping: [
'master': 'dev',
// 'release/': 'test'
Expand Down
2 changes: 1 addition & 1 deletion common/jenkins-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The ODS [jenkins shared library](https://github.com/opendevstack/ods-jenkins-sha

1. [GoLang](golang)
2. [Maven / Gradle](maven)
3. [Node.js 12](nodejs12)
3. [Node.js 16](nodejs16)
5. [Python](python)
6. [Scala & SBT](scala)
7. [Terraform](terraform)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ LABEL com.redhat.component="jenkins-agent-nodejs-rhel7-docker" \
ARG nexusUrl
ARG nexusAuth

ENV NODEJS_VERSION=12 \
ENV NODEJS_VERSION=16 \
NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \
BASH_ENV=/usr/local/bin/scl_enable \
ENV=/usr/local/bin/scl_enable \
PROMPT_COMMAND=". /usr/local/bin/scl_enable" \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
CHROME_VERSION=94.0.4606.81
CHROME_VERSION=99.0.4844.74

# install google-chrome (for angular)
RUN yum-config-manager --enable rhel-7-server-extras-rpms && \
Expand Down Expand Up @@ -58,7 +58,7 @@ COPY contrib/bin/scl_enable /usr/local/bin/scl_enable

# Install NodeJS
# https://github.com/nodesource/distributions#installation-instructions-1
RUN curl --silent --location https://rpm.nodesource.com/setup_12.x | bash - && \
RUN curl --silent --location https://rpm.nodesource.com/setup_${NODEJS_VERSION}.x | bash - && \
yum install -y nodejs && \
yum install -y gcc-c++ make

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM opendevstackorg/ods-jenkins-agent-base-ubi8:latest

# Labels consumed by Red Hat build service
LABEL com.redhat.component="jenkins-agent-nodejs-12-rhel7-container" \
name="openshift4/jenkins-agent-nodejs-12-rhel7" \
LABEL com.redhat.component="jenkins-agent-nodejs-16-rhel7-container" \
name="openshift4/jenkins-agent-nodejs-16-rhel7" \
architecture="x86_64" \
io.k8s.display-name="Jenkins Agent Nodejs" \
io.k8s.description="The jenkins agent nodejs image has the nodejs tools on top of the jenkins slave base image." \
Expand All @@ -12,8 +12,8 @@ LABEL com.redhat.component="jenkins-agent-nodejs-12-rhel7-container" \
ARG nexusUrl
ARG nexusAuth

ENV NODEJS_VERSION=12 \
YARN_VERSION=1.22.5 \
ENV NODEJS_VERSION=16 \
YARN_VERSION=1.22.18 \
NPM_CONFIG_PREFIX=$HOME/.npm-global \
PATH=$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$HOME/node_modules/.bin/:$HOME/.npm-global/bin/:$PATH \
LANG=en_US.UTF-8 \
Expand All @@ -24,7 +24,7 @@ COPY contrib/bin/configure-agent /usr/local/bin/configure-agent
# Generate machine ID
RUN dbus-uuidgen > /etc/machine-id

# Install NodeJS (https://rpm.nodesource.com/setup_12.x does NOT work)
# Install NodeJS (https://rpm.nodesource.com/setup_${NODEJS_VERSION}.x does NOT work)
RUN INSTALL_PKGS="nodejs nodejs-nodemon make gcc-c++" && \
yum module enable -y nodejs:${NODEJS_VERSION} && \
yum install -y --setopt=tsflags=nodocs --disableplugin=subscription-manager $INSTALL_PKGS && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This will make scl collection binaries work out of box.
unset BASH_ENV PROMPT_COMMAND ENV
source scl_source enable rh-nodejs12
source scl_source enable rh-nodejs16
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace ods
selector app=jenkins-agent-nodejs12
selector app=jenkins-agent-nodejs16
param-file ../../../../../ods-configuration/ods-core.env
ignore-unknown-parameters true
bc,is
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: jenkins-agent-nodejs12
name: jenkins-agent-nodejs16
parameters:
- name: ODS_BITBUCKET_PROJECT
description: Bitbucket project name.
Expand All @@ -24,16 +24,16 @@ objects:
- apiVersion: v1
kind: BuildConfig
metadata:
name: jenkins-agent-nodejs12
name: jenkins-agent-nodejs16
labels:
app: jenkins-agent-nodejs12
app: jenkins-agent-nodejs16
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
output:
to:
kind: ImageStreamTag
name: jenkins-agent-nodejs12:${ODS_IMAGE_TAG}
name: jenkins-agent-nodejs16:${ODS_IMAGE_TAG}
postCommit: {}
resources:
limits:
Expand All @@ -44,7 +44,7 @@ objects:
memory: "1Gi"
runPolicy: Serial
source:
contextDir: common/jenkins-agents/nodejs12/docker
contextDir: common/jenkins-agents/nodejs16/docker
git:
ref: ${ODS_GIT_REF}
uri: ${REPO_BASE}/${ODS_BITBUCKET_PROJECT}/ods-quickstarters.git
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: jenkins-agent-nodejs12
name: jenkins-agent-nodejs16
objects:
- apiVersion: v1
kind: ImageStream
metadata:
name: jenkins-agent-nodejs12
name: jenkins-agent-nodejs16
labels:
app: jenkins-agent-nodejs12
app: jenkins-agent-nodejs16
spec:
lookupPolicy:
local: false
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
= Nodejs 12 - Jenkins agent
= Nodejs 16 - Jenkins agent

== Introduction
This agent is used to build Nodejs based projects, through `npm` or `yarn`.

The image is built in the global `ods` project and is named `jenkins-agent-nodejs12`.
It can be referenced in a `Jenkinsfile` with `ods/jenkins-agent-nodejs12`.
The image is built in the global `ods` project and is named `jenkins-agent-nodejs16`.
It can be referenced in a `Jenkinsfile` with `ods/jenkins-agent-nodejs16`.

== Features
1. Nexus configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/quickstarters/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*** xref:jenkins:agent-base.adoc[Base Image]
*** xref:jenkins-agents:golang.adoc[Go]
*** xref:jenkins-agents:maven.adoc[Maven]
*** xref:jenkins-agents:nodejs12.adoc[Nodejs12 Angular]
*** xref:jenkins-agents:nodejs16.adoc[NodeJS 16]
*** xref:jenkins-agents:python.adoc[Python]
*** xref:jenkins-agents:scala.adoc[Scala]
** xref:quickstarters:authoring-quickstarters.adoc[Authoring Quickstarters]
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The build pipeline is defined in the `Jenkinsfile` in the project root. The main
== Builder agent used

This quickstarter uses
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs12[Nodejs12 builder agent] Jenkins builder agent.
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs16[NodeJS 16 builder agent] Jenkins builder agent.

== Known limitations

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/quickstarters/pages/e2e-cypress.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ In Jenkinsfile, there is the following stage:
== Builder agent used

This quickstarter uses
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs12[Nodejs12 builder agent] Jenkins builder agent.
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs16[NodeJS 16 builder agent] Jenkins builder agent.

== 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 @@ -97,7 +97,7 @@ Please note: By default the applciation is always build as full production build
== Builder agent used

This quickstarter uses
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs12[Nodejs12 builder agent] Jenkins builder agent.
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs16[NodeJS 16 builder agent] Jenkins builder agent.

== Known limitations

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/quickstarters/pages/fe-ionic.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ When the code in your git repository is updated the `Jenkinsfile` comes into act
== Builder agent used

This quickstarter uses
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs12[Nodejs12 builder agent] Jenkins builder agent.
https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents/nodejs16[NodeJS 16 builder agent] Jenkins builder agent.

== Known Limitation

Expand Down
2 changes: 1 addition & 1 deletion e2e-cypress/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-nodejs12:${agentImageTag}",
imageStreamTag: "${odsNamespace}/jenkins-agent-nodejs16:${agentImageTag}",
) { context ->

odsQuickstarterStageCopyFiles(context)
Expand Down
2 changes: 1 addition & 1 deletion e2e-cypress/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-nodejs12:@agent_image_tag@',
imageStreamTag: '@ods_namespace@/jenkins-agent-nodejs16:@agent_image_tag@',
branchToEnvironmentMapping: [
'master': 'dev',
// 'release/': 'test'
Expand Down
2 changes: 1 addition & 1 deletion fe-angular/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library("ods-jenkins-shared-library@${sharedLibraryRef}")
def angularCliVersion = "8.0.3"

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

stage("update angular cli") {
Expand Down
2 changes: 1 addition & 1 deletion fe-angular/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-nodejs12:@agent_image_tag@',
imageStreamTag: '@ods_namespace@/jenkins-agent-nodejs16:@agent_image_tag@',
branchToEnvironmentMapping: [
'master': 'dev',
// 'release/': 'test'
Expand Down
2 changes: 1 addition & 1 deletion fe-ionic/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def ionicVersion = "6.13.1"
def eslintVersion = "7.24.0"

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

stage("update ionic cli") {
Expand Down
2 changes: 1 addition & 1 deletion fe-ionic/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-nodejs12:@agent_image_tag@',
imageStreamTag: '@ods_namespace@/jenkins-agent-nodejs16:@agent_image_tag@',
branchToEnvironmentMapping: [
'master': 'dev',
// 'release/': 'test'
Expand Down

0 comments on commit 929c653

Please sign in to comment.