Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
265dda9
🔥 bump version of applier and change site to apply 🔥
springdo Jul 31, 2019
8c6fdde
🦄 update to the Jenkinsfile 🦄
springdo Aug 1, 2019
87ad2e9
🦄 update to the Jenkinsfile 🦄
springdo Aug 1, 2019
add7afb
FIX nexus and git credentials 😍🏹
springdo Aug 2, 2019
0d093e2
🎠 GITLAB_PROJECT was wrong 🎠 (#1)
eformat Aug 6, 2019
4746584
🎠 GITLAB_PROJECT was wrong 🎠 (#2)
eformat Aug 8, 2019
5698f44
Background selenium server and run e2e scripts seqentially
shaheinm Aug 9, 2019
f616bda
Merge pull request #4 from shaheinm/e2e-race-condition-fix
springdo Aug 15, 2019
3fd82e0
🐘 fixes #486 - e2e running in ide 🐘
eformat Aug 15, 2019
ea0b98b
Merge pull request #5 from eformat/fix/excercise3.1b
springdo Aug 16, 2019
a03c5ff
🎈 FIX - stop all node process 🎈
springdo Aug 16, 2019
86e7b9f
Merge pull request #6 from rht-labs/fix/stop-all-node
eformat Aug 16, 2019
ba51f1d
Update Jenkinsfile for 4.3
eformat Jan 29, 2020
fe4758d
ocp 4.3 udpdates
eformat Jan 29, 2020
e77f49f
4.3 changes
eformat Jan 29, 2020
492fe73
4.3 changes
eformat Jan 29, 2020
14e2df2
4.3 changes
eformat Jan 29, 2020
7613540
ocp 4.3
eformat Jan 29, 2020
c223987
🔥 4.3 changes 🔥
eformat Jan 30, 2020
6da1434
tls edge route
eformat Feb 3, 2020
6f6157a
🪒 https e2e tests 🪒
eformat Feb 3, 2020
3c0ec16
http perf-test
eformat Feb 3, 2020
90b5066
🍺 fix images 🍺
eformat Feb 4, 2020
e913438
🦐 v4 image registry 🦐
eformat Feb 11, 2020
ffac12d
keep 5 builds
eformat Feb 11, 2020
9f7d66d
🐜 dont archive all bake artefacts - chews up space 🐜
eformat Feb 13, 2020
0ae5125
mongodb version updated
ckavili Sep 2, 2020
0f1bc60
🐞 content updated for OCP4 🐞
ckavili Oct 21, 2020
8be10a5
🐞 content updated for OCP4 🐞
ckavili Oct 21, 2020
9f86ef3
applier version bumped
ckavili Oct 21, 2020
7609422
updated mongodb version to latest
Dec 4, 2020
5e62eba
updating credential secret name to git-auth
Dec 4, 2020
b62df92
added url encoding for password
Dec 4, 2020
46f3750
updated jenkins label
Dec 8, 2020
0a95862
updated to add git auth secret
Dec 14, 2020
92b2b66
Merge pull request #8 from ckavili/master
haithamshahin333 Jan 6, 2021
df5607c
update mongo version
Jan 8, 2021
6a69a98
Merge pull request #9 from haithamshahin333/master
jacobsee Jan 8, 2021
68d7f86
Dont valdate NExus SSL certs
jtudelag Jan 11, 2021
327e001
🐍 lets not loose the logo !! 🐍
eformat Jan 12, 2021
7d10b92
Merge pull request #12 from eformat/logo-fix
eformat Jan 27, 2021
16cfc81
Merge pull request #11 from jtudelag/ignore-nexus-ssl-certs
eformat Jan 27, 2021
28efecc
ADD - chart for front end for do500 updates
springdo Aug 4, 2021
646d9f7
🐤 ADD - helm repo to github for simples 🐤
springdo Aug 4, 2021
96e6f08
🍌 kickoff jenkins 🐒
springdo Aug 4, 2021
579ca38
readiness probe updated
springdo Aug 4, 2021
334e819
🐩 rollme removedfrom dc 🐩
springdo Aug 4, 2021
dce2053
wip
springdo Sep 22, 2022
c6bd9fe
🐳 UPDATE - adding server in for demo 🐳
springdo Sep 22, 2022
a4f9278
🐥 ADD - new app version 🐥
springdo Sep 22, 2022
2bcf9fa
🦡 ADD - new app version 🦡
springdo Sep 22, 2022
dd73e41
🐡 UPDATE - move from DeploymentConfig to Deployment 🐡
springdo May 15, 2025
c5e0984
🐄 ADD - binary update ... 🐄
springdo May 15, 2025
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
Empty file modified .buildignore
100755 → 100644
Empty file.
Empty file modified .editorconfig
100755 → 100644
Empty file.
24 changes: 24 additions & 0 deletions .gitattributes
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
* text eol=lf

# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.eot binary
*.woff binary
*.pyc binary
*.pdf binary
*.ez binary
*.bz2 binary
*.swp binary
Empty file modified .gitignore
100755 → 100644
Empty file.
File renamed without changes.
1 change: 1 addition & 0 deletions .openshift-applier/params/ocp-pipeline
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PIPELINE_SOURCE_REPOSITORY_URL=
PIPELINE_SOURCE_REPOSITORY_REF=develop
PIPELINE_SOURCE_SECRET=git-auth
NAME=todolist
2 changes: 1 addition & 1 deletion .openshift-applier/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# From 'openshift-applier'
- src: https://github.com/redhat-cop/openshift-applier
scm: git
version: v2.0.9
version: v2.1.2
name: openshift-applier
2 changes: 1 addition & 1 deletion .openshift-applier/templates/mongodb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ parameters:
- name: MONGODB_VERSION
displayName: Version of MongoDB Image
description: Version of MongoDB image to be used (2.4, 2.6, 3.2 or latest).
value: '3.2'
value: '3.6'
required: true
4 changes: 3 additions & 1 deletion .openshift-applier/templates/todolist-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ objects:
name: '${NAME}'
spec:
containers:
- image: 'docker-registry.default.svc:5000/${NAMESPACE}/${NAME}:${APP_TAG}'
- image: 'image-registry.openshift-image-registry.svc:5000/${NAMESPACE}/${NAME}:${APP_TAG}'
imagePullPolicy: Always
name: '${NAME}'
env:
Expand Down Expand Up @@ -91,6 +91,8 @@ objects:
spec:
port:
targetPort: 9000-tcp
tls:
termination: edge
to:
kind: Service
name: '${NAME}'
Expand Down
Empty file modified Dockerfile
100755 → 100644
Empty file.
4 changes: 4 additions & 0 deletions Dockerfile-vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM registry.access.redhat.com/ubi8/nodejs-12
ADD dist .
RUN npm i http-server
CMD npx http-server -p 8080
Empty file modified Gruntfile.js
100755 → 100644
Empty file.
97 changes: 37 additions & 60 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pipeline {
environment {
// Global Vars
NAMESPACE_PREFIX="<YOUR_NAME>"
GITLAB_DOMAIN = "gitlab.apps.change.me.com"
GITLAB_PROJECT = "<GIT_USERNAME>"
GITLAB_DOMAIN = "<GITLAB_FQDN>"
GITLAB_USERNAME = "<GITLAB_USERNAME>"

PIPELINES_NAMESPACE = "${NAMESPACE_PREFIX}-ci-cd"
APP_NAME = "todolist"
Expand All @@ -18,12 +18,12 @@ pipeline {
JOB_NAME = "${JOB_NAME}".replace("/", "-")

GIT_SSL_NO_VERIFY = true
GIT_CREDENTIALS = credentials('jenkins-git-creds')
GIT_CREDENTIALS = credentials("${NAMESPACE_PREFIX}-ci-cd-git-auth")
}

// The options directive is for configuration that applies to the whole job.
options {
buildDiscarder(logRotator(numToKeepStr:'10'))
buildDiscarder(logRotator(numToKeepStr:'5'))
timeout(time: 15, unit: 'MINUTES')
ansiColor('xterm')
timestamps()
Expand Down Expand Up @@ -69,20 +69,17 @@ pipeline {
stage("node-build") {
agent {
node {
label "jenkins-slave-npm"
label "jenkins-agent-npm"
}
}
steps {
// git branch: 'develop',
// credentialsId: 'jenkins-git-creds',
// url: 'https://gitlab-${NAMESPACE_PREFIX}-ci-cd.apps.somedomain.com/${NAMESPACE_PREFIX}/todolist.git'
sh 'printenv'

echo '### Install deps ###'
sh 'npm install'

echo '### Running tests ###'
sh 'npm run test:all:ci'
// sh 'npm run test:all:ci'

echo '### Running build ###'
sh 'npm run build:ci'
Expand All @@ -96,19 +93,21 @@ pipeline {
post {
always {
archive "**"
junit 'test-report.xml'
junit 'reports/server/mocha/test-results.xml'
// ADD TESTS REPORTS HERE

// publish html

// Notify slack or some such
}
success {
echo "Git tagging"
script {
env.ENCODED_PSW=URLEncoder.encode(GIT_CREDENTIALS_PSW, "UTF-8")
}
sh'''
git config --global user.email "jenkins@jmail.com"
git config --global user.name "jenkins-ci"
git tag -a ${JENKINS_TAG} -m "JENKINS automated commit"
# git push https://${GIT_CREDENTIALS_USR}:${GIT_CREDENTIALS_PSW}@${GITLAB_DOMAIN}/${GITLAB_PROJECT}/${APP_NAME}.git --tags
git push https://${GIT_CREDENTIALS_USR}:${ENCODED_PSW}@${GITLAB_DOMAIN}/${GITLAB_USERNAME}/${APP_NAME}.git --tags
'''
}
failure {
Expand Down Expand Up @@ -140,11 +139,12 @@ pipeline {
oc start-build ${APP_NAME} --from-dir=package-contents/ --follow
'''
}
post {
always {
archive "**"
}
}
// this post step chews up space. uncomment if you want all bake artefacts archived
// post {
//always {
// archive "**"
//}
//}
}

stage("node-deploy") {
Expand All @@ -157,48 +157,25 @@ pipeline {
expression { GIT_BRANCH ==~ /(.*master|.*develop)/ }
}
steps {
echo '### tag image for namespace ###'
sh '''
oc project ${PROJECT_NAMESPACE}
oc tag ${PIPELINES_NAMESPACE}/${APP_NAME}:${JENKINS_TAG} ${PROJECT_NAMESPACE}/${APP_NAME}:${JENKINS_TAG}
'''
echo '### set env vars and image for deployment ###'
sh '''
oc set env dc ${APP_NAME} NODE_ENV=${NODE_ENV}
oc set image dc/${APP_NAME} ${APP_NAME}=docker-registry.default.svc:5000/${PROJECT_NAMESPACE}/${APP_NAME}:${JENKINS_TAG}
oc rollout latest dc/${APP_NAME}
'''
echo '### Verify OCP Deployment ###'
openshiftVerifyDeployment depCfg: env.APP_NAME,
namespace: env.PROJECT_NAMESPACE,
replicaCount: '1',
verbose: 'false',
verifyReplicaCount: 'true',
waitTime: '',
waitUnit: 'sec'
}
}
stage("e2e test") {
agent {
node {
label "jenkins-slave-npm"
}
}
when {
expression { GIT_BRANCH ==~ /(.*master|.*develop)/ }
}
steps {
unstash 'source'

echo '### Install deps ###'
sh 'npm install'

echo '### Running end to end tests ###'
sh 'npm run e2e:ci'
}
post {
always {
junit 'reports/e2e/specs/*.xml'
script {
openshift.withCluster() {
openshift.withProject("${PROJECT_NAMESPACE}") {
echo '### tag image for namespace ###'
openshift.tag("${PIPELINES_NAMESPACE}/${APP_NAME}:${JENKINS_TAG}", "${PROJECT_NAMESPACE}/${APP_NAME}:${JENKINS_TAG}")

echo '### set env vars and image for deployment ###'
openshift.raw("set","env","dc/${APP_NAME}","NODE_ENV=${NODE_ENV}")
openshift.raw("set", "image", "dc/${APP_NAME}", "${APP_NAME}=image-registry.openshift-image-registry.svc:5000/${PROJECT_NAMESPACE}/${APP_NAME}:${JENKINS_TAG}")

echo '### Rollout and Verify OCP Deployment ###'
openshift.selector("dc", "${APP_NAME}").rollout().latest()
openshift.selector("dc", "${APP_NAME}").rollout().status("-w")
openshift.selector("dc", "${APP_NAME}").scale("--replicas=1")
openshift.selector("dc", "${APP_NAME}").related('pods').untilEach("1".toInteger()) {
return (it.object().status.phase == "Running")
}
}
}
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: todolist
description: DO500 App - todolist Frontend
type: application
version: 1.2.0
appVersion: 1.2.0
home: https://petbattle.github.io/helm-charts
icon: https://avatars1.githubusercontent.com/u/68044996?s=200&v=4
maintainers:
- name: springdo
- name: eformat
57 changes: 57 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "todolist.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "todolist.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "todolist.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "todolist.labels" -}}
helm.sh/chart: {{ include "todolist.chart" . }}
{{ include "todolist.selectorLabels" . }}
{{- if .Values.image_version }}
app.kubernetes.io/version: {{ .Values.image_version | quote }}
{{- else }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "todolist.selectorLabels" -}}
app.kubernetes.io/name: {{ include "todolist.name" . }}
app.kubernetes.io/component: {{ include "todolist.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/part-of: {{ include "todolist.name" . }}
deploymentconfig: {{ include "todolist.fullname" . }}
{{- end -}}
12 changes: 12 additions & 0 deletions chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.config_map }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ include "todolist.fullname" . }}-environment"
labels:
{{- include "todolist.labels" . | nindent 4 }}
data:
config.json: |-
{{ .Values.config_map }}
{{- end }}
77 changes: 77 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
{{- include "todolist.labels" . | nindent 4 }}
name: {{ include "todolist.fullname" . }}
spec:
replicas: {{ .Values.replicas }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "todolist.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
rollme: {{ randAlphaNum 5 | quote }}
labels:
{{- include "todolist.selectorLabels" . | nindent 8 }}
spec:
containers:
- image: "{{ .Values.image_repository }}/{{ .Values.image_namespace }}/{{ .Values.image_name }}:{{ .Values.image_version }}"
imagePullPolicy: Always
env:
- name: NODE_ENV
value: "development"
- name: MESSAGE
value: {{ .Values.message }}
{{- range $key := .Values.env_vars }}
{{- if .value }}
- name: {{ .name }}
value: {{ .value | default "" | quote }}
{{- end }}
{{- end }}
name: {{ include "todolist.name" . }}
ports:
- containerPort: 9000
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
{{- if .Values.config_map }}
- mountPath: "/opt/app-root/src/assets/configuration/"
name: "{{ include "todolist.fullname" . }}-config"
{{- end }}
{{- if .Values.fathom }}
- mountPath: "/opt/app-root/src/assets/analytics/"
name: "fathom-config"
{{- end }}
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 9000
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
{{- if .Values.config_map }}
- name: "{{ include "todolist.fullname" . }}-config"
configMap:
name: "{{ include "todolist.fullname" . }}-environment"
defaultMode: 420
{{- end }}
{{- if .Values.fathom }}
- name: "fathom-config"
configMap:
name: "fathom-client-config"
defaultMode: 420
{{- end }}
Loading