Skip to content

Commit

Permalink
feat: add nodejs v18 template
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGolms committed Jun 20, 2022
1 parent 1df9aed commit 31d6dff
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ This Jenkins agent is used to build Node.js based projects, thru `npm` and `npx`

### Features

1. Node.js v16.x | lts | current
2. npm v8.x | latest
1. Node.js `v16.x` | `v18.x` | `lts` | `current`
2. npm `v8.x` | `latest`
3. (optional) Nexus configuration

### Usage
Expand Down Expand Up @@ -59,6 +59,8 @@ odsComponentPipeline(
```sh
# v16.x
oc process -f https://raw.githubusercontent.com/SimonGolms/ods-jenkins-agent-nodejs/main/jenkins-agent-nodejs-16-template.yaml | oc create -f -
# v18.x
oc process -f https://raw.githubusercontent.com/SimonGolms/ods-jenkins-agent-nodejs/main/jenkins-agent-nodejs-18-template.yaml | oc create -f -
# lts
oc process -f https://raw.githubusercontent.com/SimonGolms/ods-jenkins-agent-nodejs/main/jenkins-agent-nodejs-lts-template.yaml | oc create -f -
# current
Expand Down Expand Up @@ -88,6 +90,8 @@ In case of a new version of Node.js or npm is released, run the following comman
```sh
# v16.x
oc start-build jenkins-agent-nodejs-16 --follow
# v18.x
oc start-build jenkins-agent-nodejs-18 --follow
# lts
oc start-build jenkins-agent-nodejs-lts --follow
# current
Expand All @@ -112,11 +116,13 @@ Go to your Build Configs <https://OPENSHIFT_INSTANCE/k8s/ns/PROJECT/buildconfigs
```sh
# v16.x
oc delete all --selector app=jenkins-agent-nodejs-16
# v18.x
oc delete all --selector app=jenkins-agent-nodejs-18
# lts
oc delete all --selector app=jenkins-agent-nodejs-lts
# current
oc delete all --selector app=jenkins-agent-nodejs-current
# v16.x & lts & current
# v16.x & v18.x & lts & current
oc delete all --selector part-of=jenkins-agent-nodejs
```

Expand Down
68 changes: 68 additions & 0 deletions jenkins-agent-nodejs-18-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: jenkins-agent-nodejs-18
annotations:
description: This template deploys a Jenkins agent to build Node.js v18.x based projects, through npm and npx v8.x
iconClass: icon-jenkins
openshift.io/display-name: Jenkins Agent Node.js (v18.x)
openshift.io/documentation-url: https://github.com/simongolms/ods-jenkins-agent-nodejs
openshift.io/provider-display-name: Simon Golms
openshift.io/support-url: https://github.com/simongolms/ods-jenkins-agent-nodejs
tags: "jenkins,agent,nodejs"
labels:
template: jenkins-agent-nodejs-18
labels:
app: jenkins-agent-nodejs-18
component: jenkins-agent
part-of: jenkins-agent-nodejs
template: jenkins-agent-nodejs-18
parameters:
- name: NEXUS_AUTH
value: ""
- name: NEXUS_URL
value: ""
objects:
- apiVersion: v1
kind: ImageStream
metadata:
name: jenkins-agent-nodejs-18
spec:
dockerImageRepository: jenkins-agent-nodejs-18
lookupPolicy:
local: true
- apiVersion: v1
kind: BuildConfig
metadata:
name: jenkins-agent-nodejs-18
spec:
failedBuildsHistoryLimit: 5
output:
to:
kind: ImageStreamTag
name: jenkins-agent-nodejs-18:latest
source:
git:
ref: v2.0.0
uri: https://github.com/simongolms/ods-jenkins-agent-nodejs.git
type: Git
strategy:
dockerStrategy:
buildArgs:
- name: NEXUS_AUTH
value: ${NEXUS_AUTH}
- name: NEXUS_URL
value: ${NEXUS_URL}
- name: NODEJS_VERSION
value: 18.x
- name: NPM_VERSION
value: 8.x
dockerfilePath: Dockerfile
type: Docker
successfulBuildsHistoryLimit: 5
triggers:
- type: "ConfigChange"
message: >-
The image is built in your active namespace and is named `jenkins-agent-nodejs-18`.
It can be referenced in a `Jenkinsfile` with `<NAMESPACE>/jenkins-agent-nodejs-18:latest`.

0 comments on commit 31d6dff

Please sign in to comment.