Page MenuHomeDevCentral

D2992.id7725.diff
No OneTemporary

D2992.id7725.diff

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,105 @@
+import groovy.json.JsonOutput
+
+pipeline {
+ agent none
+
+ stages {
+ stage('Build') {
+ agent {
+ label "rust"
+ }
+ steps {
+ git 'https://devcentral.nasqueron.org/source/alkane.git'
+
+ sh 'make'
+ }
+ post {
+ success {
+ archiveArtifacts artifacts: 'target/release/alkane'
+ }
+ }
+ }
+
+ stage('Doc') {
+ parallel {
+ stage('Cargo doc') {
+ agent {
+ label "rust"
+ }
+ steps {
+ git 'https://devcentral.nasqueron.org/source/alkane.git'
+
+ sh '''
+ make
+ cargo doc || cargo doc --no-deps
+ cd target/doc
+ tar czf ../doc-rust.tar.gz *
+ '''
+ }
+ post {
+ success {
+ archiveArtifacts artifacts: 'target/doc-rust.tar.gz'
+ }
+ }
+ }
+
+ stage('OpenAPI doc') {
+ agent {
+ label "node"
+ }
+ steps {
+ git 'https://devcentral.nasqueron.org/source/alkane.git'
+
+ sh '''
+ mkdir -p target
+ cd target
+
+ spectacle ../nasqueron-api-alkane.spec.yaml --logo-file "https://assets.nasqueron.org/logos/logo-main-133px.png"
+ cd public
+
+ mkdir -p images
+ cd images
+ wget https://assets.nasqueron.org/logos/logo-main-133px.png
+ cd ..
+ sed -i "s/75px/131px/g" stylesheets/*.css
+
+ tar czf ../doc-openapi.tar.gz *
+ '''
+ }
+ post {
+ success {
+ archiveArtifacts artifacts: 'target/doc-openapi.tar.gz'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Publish') {
+ dependsOn 'Doc'
+ agent any
+
+ steps {
+ def payload = [
+ doc: "alkane"
+ url: ${env.BUILD_URL}
+ ]
+
+ try {
+ def request = new URL("http://172.27.27.10:10206/deploy/docs.nasqueron.org").openConnection();
+ request.setRequestMethod("POST")
+ request.setDoOutput(true)
+ request.setRequestProperty("Content-Type", "application/json")
+ request.getOutputStream().write(JsonOutput.toJson(payload).getBytes("UTF-8"));
+ if(!post.getResponseCode().equals(200)) {
+ System.err << request.getInputStream().getText()
+ unstable("Alkane HTTP API didn't acknowledge the build request. When we refer to Alkane, it means the one currently installed on the PaaS, *NOT* this build.")
+ }
+ } catch (ex) {
+ System.err << ex.getMessage()
+ unstable("Can't send payload to Alkane HTTP API")
+ }
+ }
+ }
+ }
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 15:08 (2 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258138
Default Alt Text
D2992.id7725.diff (3 KB)

Event Timeline