Let's evaluate the Jenkins Pipeline Plugin for driving the new release pipeline. A simple verification could be to checkout the master branch of scap and have it run tox.
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | thcipriani | T161661 Install Jenkins Pipeline Plugin for ci-staging and verify its basic functionality | |||
| Resolved | thcipriani | T161659 Port existing `differential-docker-test` job to Jenkinsfile/Groovy |
Event Timeline
So the Jenkins pipeline plugin is installed and working on ci-staging-jenkins-master01.
Right now the JenkinsFile job is looking at some machine I spun up on digital ocean and downloading the scap repo from there: http://ci-staging-jenkins.wmflabs.org/ci/job/JenkinsFile
I put a simple Jenkinsfile in the scap repo on that host:
node {
stage('Build') {
echo 'Building...'
}
stage('Test') {
git url: 'https://github.com/wikimedia/scap'
sh 'ls'
sh '/usr/local/bin/docker-test-build'
}
stage('Deploy') {
echo 'Deploying....'
}
}This downloads scap from github and runs ls then /usr/local/bin/docker-test-build which I pulled and modified from a our https://integration.wikimedia.org/ci/job/differential-docker-test/
#!/bin/bash set -e DOCKER_FILE=Dockerfile.ci DOCKER_WORKSPACE=/srv/workspace JOB_LOWER=$(echo "$JOB_NAME" | tr '[:upper:]' '[:lower:]') DOCKER_BUILD_TAG="${JOB_LOWER}:${BUILD_ID}" DOCKER_NAME="$BUILD_TAG" [ -f "$DOCKER_FILE" ] || exit 0 onexit() { docker rm "${DOCKER_NAME}" || true } trap 'onexit $?' EXIT docker build --file "${DOCKER_FILE}" --tag "${DOCKER_BUILD_TAG}" . docker run --tty --name "${DOCKER_NAME}" "${DOCKER_BUILD_TAG}" # copy all newly created files in log/ back to host workspace to be archived as artifacts ID="$(docker ps -a --no-trunc --filter name="$DOCKER_NAME" --format "{{.ID}}" | tail -n 1)" docker diff "$ID" | awk '$2 ~ "^'"$DOCKER_WORKSPACE"'/log/"' | while read change path; do if [[ "$change" == "A" ]]; then docker cp "$ID":"$path" "${path#"$DOCKER_WORKSPACE"/}" fi done
From that simple jenkins-file I got a job that builds our scap Docker image and runs our unit tests: http://ci-staging-jenkins.wmflabs.org/ci/job/JenkinsFile/18/
And one can view the step by step on http://ci-staging-jenkins.wmflabs.org/ci/job/JenkinsFile/18/flowGraphTable/
Well done :]