Skip to content

Commit

Permalink
added npm install test (#769)
Browse files Browse the repository at this point in the history
* added npm install test

* fixed jenkins failing to install and run tests
  • Loading branch information
garethahealy committed Apr 8, 2024
1 parent 8923dc8 commit 32e7c67
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _test/kind/jenkins-values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
controller:
additionalPlugins:
- job-dsl:1.78.3
- job-dsl:1.87
ingress:
enabled: true
persistence:
Expand Down
22 changes: 20 additions & 2 deletions _test/kind/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -euo pipefail

AGENT=$1
## todo: renovate config for below
JENKINS_CHART_VERSION="4.9.1"
# renovate: datasource=github-releases depName=jenkinsci/helm-charts
JENKINS_CHART_VERSION="5.1.5"
AGENT_PATH="jenkins-agents/${AGENT}"
SCRIPT_DIR=$(dirname -- "$(readlink -f "${BASH_SOURCE[0]}" || realpath "${BASH_SOURCE[0]}")")

Expand Down Expand Up @@ -66,8 +66,10 @@ then
podman save ${AGENT}:latest | docker load
docker tag localhost/${AGENT}:latest ${AGENT}:latest
kind load docker-image ${AGENT}:latest

# Create Nginx Ingress controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml

echo "### Wait for Ingress controller to install ###"
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
Expand All @@ -82,6 +84,7 @@ then
# Use Helm to deploy and configure Jenkins
helm repo add jenkinsci https://charts.jenkins.io --force-update
helm repo update

echo "### Jenkins content will look like... ###"
helm template jenkins \
--version ${JENKINS_CHART_VERSION} \
Expand All @@ -100,8 +103,23 @@ then
-f ${TPL_TEMP}/jenkins-casc-config-scripts.yaml \
jenkinsci/jenkins

echo "### Checking statefulset config ###"
sleep 30

kubectl get statefulsets -n jenkins
kubectl describe statefulsets/jenkins -n jenkins

echo "### Checking pod logs... ###"
echo "### config-reload-init ###"
kubectl logs statefulsets/jenkins -c config-reload-init -n jenkins

echo "### init ###"
kubectl logs statefulsets/jenkins -c init -n jenkins

echo "### jenkins ###"
kubectl logs statefulsets/jenkins -c jenkins -n jenkins

echo "### Waiting for deployment... ###"
kubectl rollout status statefulsets/jenkins --watch=true --timeout=5m -n jenkins

# Make sure Jenkins is available
Expand Down
2 changes: 2 additions & 0 deletions jenkins-agents/jenkins-agent-npm/Jenkinsfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ pipeline {
sh """
npm -v
node -v

npm i express
"""
}
}
Expand Down
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
{
"customType": "regex",
"fileMatch": [
"^.+\\/VERSION$"
"^.+\\/VERSION$",
"_test/kind/setup.sh"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[^\\s]+?))?(?: extractVersion=(?<extractVersion>[^\\s]+?))?\\s+[A-Za-z0-9_]+?_VERSION=(?<currentValue>.+?)?\\s"
Expand Down

0 comments on commit 32e7c67

Please sign in to comment.