diff --git a/Branch_1.py b/Branch_1.py new file mode 100644 index 00000000..b2bdcf33 --- /dev/null +++ b/Branch_1.py @@ -0,0 +1,2 @@ + +print("Multi branch Pipeline : Branch 1") diff --git a/Jenkinsfile b/Jenkinsfile index da9c3aaa..236e6fe4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,39 +1,44 @@ pipeline { - agent { + agent { node { - label 'docker-agent-python' - } - } + label 'jenkins-agent-python' + } + } triggers { - pollSCM '* * * * *' + pollSCM('H/10 * * * *') + } + options { + disableConcurrentBuilds() } stages { stage('Build') { steps { - echo "Building.." - sh ''' - cd myapp - pip install -r requirements.txt - ''' + dir('myapp') { + sh ''' + python3 -m venv venv + . venv/bin/activate + pip install --upgrade pip + pip install -r requirements.txt + ''' + } } } stage('Test') { steps { - echo "Testing.." + echo "Testing Master Branch..." sh ''' cd myapp + . venv/bin/activate python3 hello.py - python3 hello.py --name=Brad + python3 hello.py --name=Sai ''' } } stage('Deliver') { steps { - echo 'Deliver....' - sh ''' - echo "doing delivery stuff.." - ''' + echo 'Delivering Master Branch...' + sh 'echo "Master Branch delivery logic..."' } } } -} \ No newline at end of file +} diff --git a/helloworld.py b/helloworld.py deleted file mode 100644 index daa3c4af..00000000 --- a/helloworld.py +++ /dev/null @@ -1,2 +0,0 @@ - -print("Hello world")