Skip to content

Commit

Permalink
Merge branch 'master' of github.com:STAMP-project/camp
Browse files Browse the repository at this point in the history
  • Loading branch information
fchauvel committed Oct 29, 2019
2 parents d628290 + 4da42b3 commit 628348f
Show file tree
Hide file tree
Showing 17 changed files with 199 additions and 922 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ pipeline {
steps{
sh '''
docker pull fchauvel/camp:dev;
docker run -d --rm -i -t --name camp -v /var/run/docker.sock:/var/run/docker.sock -v /var/jenkins_home/workspace/citygo_camp/:/stamp_docker_citygoApp/ -t fchauvel/camp:dev
docker run -d -u root -i -t --name camp -v /var/run/docker.sock:/var/run/docker.sock -v /var/jenkins_home/workspace/citygo_case2_camp/:/stamp_docker_citygoApp/ -t fchauvel/camp:dev
'''
}
}
stage('CAMP generate'){
steps{
sh '''
docker exec -d camp sh -c 'rm /stamp_docker_citygoApp/apache/app/Dockerfile && cp -R /stamp_docker_citygoApp/apache/app/* ./samples/stamp/atos/performance/template/citygo/';
docker exec -d camp sh -c 'rm /stamp_docker_citygoApp/apache/app/Dockerfile && cp -R /stamp_docker_citygoApp/nginx/ARTIST/app/* ./samples/stamp/atos/performance/template/citygo/';
docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp generate -d . --all';
exit;
'''
Expand All @@ -32,8 +32,6 @@ pipeline {
docker exec -i camp sh -c 'cd samples/stamp/atos/performance/ && camp realize -d . && cp -R out/ /stamp_docker_citygoApp/';
exit;
'''
zip zipFile: 'testconf.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/out', glob: '**/*.yml'
zip zipFile: 'dockerfiles.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_camp/out', glob: '**/Dockerfile'
}
}
stage('CAMP execute'){
Expand All @@ -47,22 +45,31 @@ pipeline {
stage('Publish reports') {
steps {
script {
sh 'ls -d /var/jenkins_home/workspace/citygo_camp/out/*/ > reportDirNames.txt'
sh '''
docker exec -i camp sh -c 'cp -R samples/stamp/atos/performance/out/* /stamp_docker_citygoApp/out/ &&
cp samples/stamp/atos/performance/camp_execute.log /stamp_docker_citygoApp/ && exit';
ls -d /var/jenkins_home/workspace/citygo_case2_camp/out/*/ > reportDirNames.txt;
exit;
'''
zip zipFile: 'JMetterTestsLogs.zip', archive: true, dir: '/var/jenkins_home/workspace/citygo_case2_camp', glob: '**/camp_execute.log'

def reportDirectories = readFile('reportDirNames.txt').split("\\r?\\n")
sh 'rm -f reportDirNames.txt'
for (i = 0; i < reportDirectories.size(); i++) {
publishHTML (target: [
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: reportDirectories[i] + '/test-reports',
reportFiles: 'index.html',
reportDir: reportDirectories[i] + '/test-reports/nginx-logs/',
reportFiles: 'error.log',
reportName: reportDirectories[i].tokenize('/').last()
])
}
sh '''
docker stop camp && docker rm camp
'''
}
}
}
}
}

24 changes: 1 addition & 23 deletions samples/stamp/atos/functional/camp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,6 @@ components:
docker:
image: selenium/hub

apache:
provides_services: [ HttpProxy ]
requires_services: [ CityGo ]
implementation:
docker:
file: apache/Dockerfile
realization:
- select: docker-compose-apache.yml
instead_of:
- docker-compose-nginx.yml
as: docker-compose.yml

nginx:
provides_services: [ HttpProxy ]
requires_services: [ CityGo ]
Expand Down Expand Up @@ -105,17 +93,7 @@ components:

postgres:
provides_services: [ Postgres ]
variables:
version:
values: [v9, v10, v11]
realization:
- targets: [ "postgres/Dockerfile" ]
pattern: "FROM postgres:9.3"
replacements:
- "FROM postgres:9.3"
- "FROM postgres:10"
- "FROM postgres:11"
implementation:
docker:
file: postgres/Dockerfile
file: postgres:9.3

43 changes: 0 additions & 43 deletions samples/stamp/atos/functional/template/apache/Dockerfile

This file was deleted.

40 changes: 0 additions & 40 deletions samples/stamp/atos/functional/template/apache/demo_site.conf

This file was deleted.

19 changes: 0 additions & 19 deletions samples/stamp/atos/functional/template/apache/mpm_event.conf

This file was deleted.

15 changes: 11 additions & 4 deletions samples/stamp/atos/functional/template/browser/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ RUN sudo apt-get update && \
python2.7 \
python-pip

WORKDIR ./
WORKDIR /browser

USER root
RUN chmod 777 -R /browser

RUN pip install --upgrade pip

ADD ./requirements.txt ./
RUN pip install -r requirements.txt
# Install BlazeMetter to run performance Tests
RUN sudo -H pip install bzt
COPY ./citygo.jmx /browser/citygo-tests/citygo.jmx

#Funtional Tests
COPY ./tests.py /browser/citygo-tests/citygo.jmx/tests.py

COPY ./tests.py citygo-tests/tests.py
RUN ls -lR /browser

CMD echo "Ready!"
26 changes: 24 additions & 2 deletions samples/stamp/atos/functional/template/citygo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@

# See explanation in the README.

FROM camp/runtime
# Describe here how to install Citygo ontop of the "python" component.

ENV PYTHONUNBUFFERED 1
ENV C_FORCE_ROOT true

# Describe here how to install Citygo ontop of the "python" component.
# Set work directory
WORKDIR /usr/src/app

RUN chmod -R +x /usr/src/app
RUN pip install --upgrade pip

COPY ./requirements.txt /usr/src/app/
RUN pip install -r requirements.txt

#copy entrypoint.sh
COPY ./entrypoint.sh /usr/src/app/

RUN chmod +x /usr/src/app/entrypoint.sh
# copy project
COPY . /usr/src/app/

EXPOSE 80

# run entrypoint.sh
ENTRYPOINT ["/bin/sh","/usr/src/app/entrypoint.sh"]
15 changes: 15 additions & 0 deletions samples/stamp/atos/functional/template/citygo/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

#Starting gunicorm
echo Starting Gunicorm

#python manage.py migrate --no-input
python manage.py collectstatic --no-input

# Run coverage

#coverage run manage.py test -v 2
#coverage html
export BROWSER=firefox
exec "$@"

25 changes: 25 additions & 0 deletions samples/stamp/atos/functional/template/citygo/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Django==1.10.2
django-allauth==0.27.0
django-rest-auth==0.8.1
djangorestframework==3.4.7
httplib2==0.9.2
oauth2==1.9.0.post1
oauthlib==2.0.0
psycopg2
psycopg2-binary
python-openid==2.2.5
requests>=2.18.2
requests-cache==0.4.12
requests-oauthlib==0.7.0
six==1.10.0
pyowm==2.9.0
unidecode
pymongo
pandas
gunicorn==19.6.0
redis==2.10.6
coverage==3.6
selenium
html-testRunner==1.2
pytest-html
unittest-xml-reporting==2.5.1
Loading

0 comments on commit 628348f

Please sign in to comment.