Jenkinsfile and Dockerfile added
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..71ae7cf --- /dev/null +++ b/Dockerfile
@@ -0,0 +1,45 @@ +FROM myserver:withproxy +#linux 16.04 +MAINTAINER Dimitris + +WORKDIR / + + +### HOME SERVICE #### +WORKDIR microservices +RUN git clone http://172.18.22.160:8880/gitblit-1.8.0/r/Dropwizard/Microservices/mics-home-service.git && cd mics-home-service && git checkout DEVELOP_BE + +WORKDIR mics-home-service + +RUN rm -f -r ./target/mics-home-service && rm -f -r ./target/mics-home-service.war + + +RUN mvn install -DskipTests + +RUN mv ./target/mics-home-service.war /opt/tomcat/webapps/mics-home-service.war + +WORKDIR / + +### DIAGNOSIS APP #### +WORKDIR microservices +# use this lnik if no proxy(WLAN) - http://87.128.212.254:8880/gitblit-1.8.0/r/Dropwizard/Microservices/mics-diagnosis-app.git +RUN git clone http://172.18.22.160:8880/gitblit-1.8.0/r/Dropwizard/Microservices/mics-diagnosis-app.git && cd mics-diagnosis-app && git checkout DEVELOP_FE + +WORKDIR mics-diagnosis-app + +RUN npm install -g @angular/cli@1.6.1 +RUN npm install +RUN ng build --prod + +RUN mv ./dist/ /opt/tomcat/webapps/mics-diagnosis-app/ + +WORKDIR / + +### ADD PARAMETER TO TOMCAT CONTEXT ### +RUN sed -i '/<\/Context>/i <Parameter name="OK_MICS_HOME_ENVIRONMENT" override="false" value="Docker"/>' /opt/tomcat/conf/context.xml + +CMD ["/opt/tomcat/bin/catalina.sh", "run"] + +EXPOSE 8080 + +
diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..94548ff --- /dev/null +++ b/Jenkinsfile
@@ -0,0 +1,20 @@ +node { + def app + + stage('Clone repository') { + /* Let's make sure we have the repository cloned to our workspace */ + + checkout scm + } + + stage('Build image') { + /* This builds the actual image; synonymous to + * docker build on the command line */ + + app = docker.build("myserver_home:jenkinsversion", "--no-cache") + } + + stage('Refresh containers') { + bat 'start cmd.exe /c C:\\Jenkinshelper\\refresh_docker.bat' + } +} \ No newline at end of file