Skip to content

Commit

Permalink
Add Jenkins CI Pipeline (#5)
Browse files Browse the repository at this point in the history
* Create Jenkinsfile

* Add run nose to Jenkinsfile

* pip3: not found

* install pip

* public keys for jenkins

* Update Jenkinsfile

* still addressing public key

* Update utilitylib.py

* Create greetings.yml

* pwd

* Update Jenkinsfile

* Find test

* Update Jenkinsfile

* bash commands needs to pipline

* Update PYTHONPATH

* export PYTHONPATH

* Update triggers for python-nose.yml
  • Loading branch information
mammatus95 authored May 15, 2024
1 parent 6a8df70 commit 3be1aff
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Message that will be displayed on users' first issue"
pr-message: "Message that will be displayed on users' first pull request"
4 changes: 1 addition & 3 deletions .github/workflows/python-nose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Unittest

on:
push:
branches: [ "main", "modellevel", "preslevel" ]
on: [push, pull_request_target, issues]

jobs:
build-linux:
Expand Down
29 changes: 29 additions & 0 deletions .jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pipeline {
agent any
stages {
stage('Install pip') {
steps {
//sh 'wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | gpg --dearmor | sudo tee /usr/share/keyrings/jenkins-archive-keyring.gpg > /dev/null'
sh 'sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BA31D57EF5975CA'
sh 'apt-get update && apt-get install -y python3-pip'
}
}
stage('Install Requirements') {
steps {
sh 'pip3 install --upgrade pip' // sh means bash
sh 'pip3 install -r requirements.txt'
}
}
stage('version') {
steps {
sh 'python3 --version'
}
}
stage('Run nose2') {
steps {
sh 'export PYTHONPATH=$(pwd) && cd $(pwd)/test && nose2'
}
}
// Add more stages as needed
}
}
2 changes: 1 addition & 1 deletion src/utilitylib.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def datum(leadtime, start, datetime_obj):
# ---------------------------------------------------------------------------------------------------------------------


def load_yaml(yaml_file, yaml_path='./'):
def load_yaml(yaml_file, yaml_path='.'):
"""
Parameters:
-----------
Expand Down

0 comments on commit 3be1aff

Please sign in to comment.