-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First version of the build pipeline * Fix problem in docker script to start tests * Remove checkout * Fix typo in docker run script * Working jenkins pipeline with instructions
- Loading branch information
Showing
6 changed files
with
137 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
pipeline { | ||
agent any | ||
stages { | ||
stage('Build') { | ||
steps { | ||
dir (path: "./docker-images/oa-java-server/") { | ||
sh './build-docker-image.sh' | ||
} | ||
} | ||
} | ||
stage('Redeploy') { | ||
steps { | ||
dir (path: "./docker-topologies/runtime/") { | ||
echo "current directory is: ${pwd()}" | ||
sh 'docker-compose down --volumes' | ||
sh 'docker-compose up -d' | ||
} | ||
} | ||
} | ||
stage('API tests') { | ||
steps { | ||
dir (path: "./docker-images/oa-server-specs/") { | ||
sh './build-docker-image.sh' | ||
sh './run-docker-image.sh' | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM jenkins:2.46.1-alpine | ||
|
||
|
||
# | ||
# Running jenkins as root (instead as jenkins) is not recommended for a regular CD server. However, | ||
# it solves a couple of issues and enables a smooth out-of-the-box experience for this repo. One of the | ||
# issues is that ADDing a directory to a VOLUME uses the uid/gid on the host (it does not use the USER | ||
# value into account). This means that the standard jenkins image will cause access rights problems at | ||
# container startup time. Another issue is that when jenkins is not run as root, then the user has to | ||
# enter a randomly generated password the first time it connects to the UI. He also sees the setup wizard, | ||
# which we want to avoid here since we install the plugins ourselves. | ||
# | ||
USER root | ||
|
||
# | ||
# Install docker and docker-compose. Note that on alpine, we may be behind latest releases... See bottom of | ||
# this file to build an image with the latest version on a another linux distribution. | ||
# | ||
RUN apk update && apk add docker make py-pip shadow && pip install docker-compose | ||
RUN usermod -aG users jenkins | ||
|
||
# | ||
# Add initial jenkins configuration. This is how jenkins knows about our job. If we were accessing a private | ||
# git repo, we would also setup credentials and keys via this process. | ||
# | ||
ADD config/jenkins_home /var/jenkins_home/ | ||
|
||
# | ||
# Install plugins that we want to use | ||
# | ||
RUN /usr/local/bin/install-plugins.sh nodejs workflow-aggregator pipeline-stage-view blueocean | ||
|
||
|
||
#FROM jenkins:2.32.3 | ||
# | ||
# Install Docker | ||
# | ||
#USER root | ||
#RUN curl -fsSL https://get.docker.com/ | sh | ||
#RUN usermod -aG docker jenkins | ||
#RUN curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose | ||
#RUN chmod +x /usr/local/bin/docker-compose | ||
#RUN usermod -aG users jenkins | ||
#USER jenkins |
32 changes: 32 additions & 0 deletions
32
...jenkins/config/jenkins_home/jobs/build, validate and deploy open affect server/config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<flow-definition plugin="[email protected]"> | ||
<actions/> | ||
<description></description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties> | ||
<org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty> | ||
<triggers/> | ||
</org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty> | ||
</properties> | ||
<definition class="org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition" plugin="[email protected]"> | ||
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]"> | ||
<configVersion>2</configVersion> | ||
<userRemoteConfigs> | ||
<hudson.plugins.git.UserRemoteConfig> | ||
<url>https://github.com/openaffect/openaffect-server</url> | ||
</hudson.plugins.git.UserRemoteConfig> | ||
</userRemoteConfigs> | ||
<branches> | ||
<hudson.plugins.git.BranchSpec> | ||
<name>*/fb-cdpipeline</name> | ||
</hudson.plugins.git.BranchSpec> | ||
</branches> | ||
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> | ||
<submoduleCfg class="list"/> | ||
<extensions/> | ||
</scm> | ||
<scriptPath>./Jenkinsfile</scriptPath> | ||
<lightweight>true</lightweight> | ||
</definition> | ||
<triggers/> | ||
</flow-definition> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
docker run -it -v ~/.m2:/root/.m2 --net runtime_default openaffect/server-specs | ||
docker run --rm -v ~/.m2:/root/.m2 --net runtime_default openaffect/server-specs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '2' | ||
services: | ||
jenkins: | ||
build: ../../docker-images/jenkins | ||
ports: | ||
- "1080:8080" | ||
volumes: | ||
- jenkins-data:/var/jenkins_home | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
volumes: | ||
jenkins-data: | ||
|