Merge pull request 'jenkins-file' (#15) from jenkins-file into master

Reviewed-on: #15
pull/17/head
bucky 2023-10-06 20:49:11 -07:00
commit 0f0838ae5a
3 changed files with 36 additions and 1 deletions

32
Jenkinsfile vendored 100644
View File

@ -0,0 +1,32 @@
pipeline {
agent any
environment {
APP_SESSION_SECRET = ''
DB_NAME = 'url_shortener.db'
}
stages {
stage('Init') {
steps {
sh 'rbenv local 3.2.2'
script {
env.APP_SESSION_SECRET = sh(script: 'ruby secret.rb', returnStdout: true)
}
sh 'echo "ENV[\\\"APP_SESSION_SECRET\\\"] ||= $(ruby secret.rb)" > .env.rb'
sh 'echo "ENV[\\\"DB_NAME\\\"] ||= \\\"${DB_NAME}\\\"" >> .env.rb'
sh 'cat .env.rb'
}
}
stage('Build dependencies') {
steps {
sh 'bundle install'
sh 'sequel -m db/migrations sqlite://db/${DB_NAME}'
}
}
stage('Run tests') {
steps {
sh 'cucumber'
}
}
}
}

View File

@ -5,7 +5,8 @@ Roda, Falcon, Sequel, and SQLite
the point of this project is to quickly build something and work on continuous deployment while making small refinements to the functional pieces.
the only outside piece of software that this project relies on is sqlite3.
the outside pieces of software that this project relies on are sqlite3 and pkgconf.
first you have to install the dependencies:

2
secret.rb 100644
View File

@ -0,0 +1,2 @@
require 'securerandom'
puts SecureRandom.base64(64).inspect()