Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dockerfiles #6

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
73651f1
Create README.md
lexarflash8g Feb 24, 2021
b0ad880
Update README.md
lexarflash8g Feb 24, 2021
cd526b3
Update README.md
lexarflash8g Feb 24, 2021
3541ea5
Update README.md
lexarflash8g Feb 24, 2021
3700d06
Update README.md
lexarflash8g Feb 24, 2021
f69cdea
new
lexarflash8g Feb 25, 2021
78e1dae
new
lexarflash8g Feb 25, 2021
093e9b4
new
lexarflash8g Feb 25, 2021
032139d
new
lexarflash8g Feb 25, 2021
c7bfcc0
new
lexarflash8g Feb 25, 2021
e43981b
new
lexarflash8g Feb 25, 2021
7e3f29d
new
lexarflash8g Feb 25, 2021
9631ddf
new
lexarflash8g Feb 25, 2021
328e3e5
tset
lexarflash8g Feb 25, 2021
9cb29ea
tset
lexarflash8g Feb 25, 2021
5294b62
tset
lexarflash8g Feb 25, 2021
01da7ff
new
lexarflash8g Feb 25, 2021
0a5e9b3
new
lexarflash8g Feb 25, 2021
bd06c08
new
lexarflash8g Feb 25, 2021
06f0170
Merge pull request #2 from lexarflash8g/feature/workerpipe
lexarflash8g Feb 25, 2021
57aa424
new
lexarflash8g Feb 26, 2021
08f8e14
new
lexarflash8g Feb 26, 2021
a15ca8b
new
lexarflash8g Feb 26, 2021
6f8feaf
new
lexarflash8g Feb 26, 2021
18606ae
new
lexarflash8g Feb 26, 2021
5693cf3
new
lexarflash8g Feb 26, 2021
3b4a9df
new
lexarflash8g Feb 26, 2021
6a50782
new
lexarflash8g Feb 26, 2021
d791c3c
new
lexarflash8g Feb 26, 2021
8309c63
new
lexarflash8g Feb 26, 2021
817708e
new
lexarflash8g Feb 26, 2021
3988edb
new
lexarflash8g Feb 26, 2021
3f96029
new
lexarflash8g Feb 26, 2021
709e3ac
new
lexarflash8g Feb 26, 2021
eeb8b04
new
lexarflash8g Feb 26, 2021
d65ab57
new
lexarflash8g Feb 26, 2021
8b8df2b
new
lexarflash8g Feb 26, 2021
3d181ad
new
lexarflash8g Feb 26, 2021
1aca1a2
new
lexarflash8g Feb 26, 2021
55e6335
new
lexarflash8g Feb 26, 2021
9380193
new
lexarflash8g Feb 26, 2021
444e050
new
lexarflash8g Feb 26, 2021
03eb23e
new
lexarflash8g Feb 26, 2021
548781c
new
lexarflash8g Feb 26, 2021
4a203d7
new
lexarflash8g Feb 26, 2021
35608da
new
lexarflash8g Feb 26, 2021
67bed01
new
lexarflash8g Feb 27, 2021
2e9b648
new
lexarflash8g Feb 27, 2021
88b1fe0
new
lexarflash8g Feb 27, 2021
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Voting App

#this is a sample voting app again
this application is based on Docker's example [voting app](https://github.com/docker/example-voting-app).


Expand Down
Empty file added new.test
Empty file.
4 changes: 2 additions & 2 deletions result/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN mv /app/node_modules /node_modules

ADD . /app

ENV PORT 80
EXPOSE 80
#ENV PORT 80
EXPOSE 4000

CMD ["node", "server.js"]
44 changes: 44 additions & 0 deletions result/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pipeline {
agent {
docker{
image 'node:8.16.-0-alpine'
args '-u root'
}
}

tools {
nodejs 'node'
}
stages{
stage('build'){
when{

changeset "**/result/**"
}
steps{
echo "compiling worker app"
dir('result'){
sh 'npm install'

}
}
}

stage('test'){
when{

changeset "**/result/**"
}
steps{
echo "running unit tests"
dir('result'){
sh 'npm install'
sh 'npm test'

}
}
}

}
}

Empty file added result/new.txt
Empty file.
44 changes: 44 additions & 0 deletions vote/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pipeline {
agent {
docker{
image 'python:2.7.16-slim'
args '-u root'
}
}


stages{
stage('build'){
when{

changeset "**/vote/**"
}
steps{
echo "compiling worker app"
dir('vote'){
sh 'pip install -r requirements.txt'

}
}
}

stage('test'){
when{

changeset "**/vote/**"
}
steps{
echo "running unit tests"
dir('vote'){
sh 'pip install nose'
sh 'nosetests -v'

}
}
}

}
}


// #comment
19 changes: 13 additions & 6 deletions worker/Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
FROM microsoft/dotnet:1.0.0-preview2-sdk
FROM java:openjdk-8-jdk-alpine

RUN MAVEN_VERSION=3.3.3 \
&& cd /usr/share \
&& wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz -O - | tar xzf - \
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

WORKDIR /code

ADD src/Worker /code/src/Worker
ADD pom.xml /code/pom.xml
RUN ["mvn", "dependency:resolve"]
RUN ["mvn", "verify"]

RUN dotnet restore -v minimal src/ \
&& dotnet publish -c Release -o ./ src/Worker/ \
&& rm -rf src/ $HOME/.nuget/
ADD src/main /code/src/main
RUN ["mvn", "package"]
CMD ["java", "-jar", "target/worker-jar-with-dependencies.jar"]

CMD dotnet Worker.dll
11 changes: 11 additions & 0 deletions worker/Dockerfile.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM microsoft/dotnet:1.0.0-preview2-sdk

WORKDIR /code

ADD src/Worker /code/src/Worker

RUN dotnet restore -v minimal src/ \
&& dotnet publish -c Release -o ./ src/Worker/ \
&& rm -rf src/ $HOME/.nuget/

CMD dotnet Worker.dll
Empty file modified worker/Dockerfile.j
100644 → 100755
Empty file.
18 changes: 18 additions & 0 deletions worker/Dockerfile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM java:openjdk-8-jdk-alpine

RUN MAVEN_VERSION=3.3.3 \
&& cd /usr/share \
&& wget http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz -O - | tar xzf - \
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

WORKDIR /code

ADD pom.xml /code/pom.xml
RUN ["mvn", "dependency:resolve"]
RUN ["mvn", "verify"]

ADD src/main /code/src/main
RUN ["mvn", "package"]
CMD ["java", "-jar", "target/worker-jar-with-dependencies.jar"]

82 changes: 82 additions & 0 deletions worker/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
pipeline {
agent{
docker{
image 'maven:3.6.1-jdk-8-slim'
args '-v $HOME/.m2:/root/.m2:z -u root'
reuseNode true
}
}


stages{
stage('build'){

steps{
echo "compiling worker app"
dir('worker'){
sh 'mvn compile'
}
}
}

stage('test'){


steps{
echo "running unit tests"
dir('worker'){
sh 'mvn clean test'
}
}
}
stage('package'){


steps{
echo "packaging worker app"
dir('worker'){
sh 'mvn package -DskipTests'
archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
}
}
}


stage('docker package'){


steps{
echo "docker package"
dir('worker'){
script{
docker.WithRegistry('https://index.docker.io/v1','dockerlogin') }
def workerImage = docker.build("lexarflash8g/worker:{env.BUILD_ID}", "./worker")
workerImage.push()
workerImage.push("${env.BRANCH_NAME}")
}
}
}
}

post{
always{
echo 'Building multibranch pipeline for worker is completed..'
}
failure{
slackSend (channel: "instavote-cd", message: "Build Failed - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
}
success{
slackSend (channel: "instavote-cd", message: "Build Succeeded - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)")
}
}
}





// }

// when{
// branch 'master'
// changeset "**/worker"
4 changes: 4 additions & 0 deletions worker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[![Build Status](http://192.168.219.219:8081/buildStatus/icon?job=compile)](http://192.168.219.219:8081/job/compile/)


NEW
Empty file modified worker/codefresh.build.and.push.yml
100644 → 100755
Empty file.
Empty file modified worker/codefresh.yml
100644 → 100755
Empty file.
Empty file added worker/new
Empty file.
Empty file added worker/new.txt
Empty file.
Empty file added worker/new.txt2
Empty file.
Empty file added worker/new1.txt
Empty file.
Empty file modified worker/pom.xml
100644 → 100755
Empty file.
Empty file modified worker/src/Worker/Program.cs
100644 → 100755
Empty file.
Empty file modified worker/src/Worker/project.json
100644 → 100755
Empty file.
Empty file modified worker/src/main/java/worker/Worker.java
100644 → 100755
Empty file.