🏡 index : ~doyle/1p.git

author Jordan Doyle <jordan@doyle.la> 2020-08-03 2:38:29.0 +00:00:00
committer Jordan Doyle <jordan@doyle.la> 2020-08-03 2:38:29.0 +00:00:00
commit
f6ec267d0da4a978bc4aef82d091c79929b98145 [patch]
tree
110a38a569385b17dba2b8dc7ff1fb4883b42ea9
parent
b0d4705d8ed3facea778e72a3b882db73f9623e2
download
f6ec267d0da4a978bc4aef82d091c79929b98145.tar.gz

Add Jenkinsfile



Diff

 Jenkinsfile | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000..e3fe53d
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,50 @@
pipeline {
    agent {
        kubernetes {
            yaml """
spec:
  securityContext:
    runAsUser: 1000
  containers:
  - name: rust-build-agent
    image: rust:1.45.1-stretch
    tty: true
    command:
    - cat
"""
            defaultContainer 'rust-build-agent'
        }
    }

    stages {
        stage('Check') {
            parallel {
                stage('Rustfmt') {
                    steps {
                        sh 'rustup component add rustfmt'
                        sh 'cargo fmt --all -- --check'
                    }
                }

                stage('Clippy') {
                    steps {
                        sh 'rustup component add clippy'
                        sh 'cargo clippy --all --all-targets --all-features -- -Dwarnings'
                    }
                }
            }
        }

        stage('Test') {
            steps {
                sh 'cargo test --all --all-targets --all-features'
            }
        }

        stage('Build') {
            steps {
                sh 'cargo build --release --all --all-targets --all-features'
            }
        }
    }
}