Compare commits

...

26 Commits

Author SHA1 Message Date
bucky 0f0838ae5a Merge pull request 'jenkins-file' (#15) from jenkins-file into master
Reviewed-on: #15
2023-10-06 20:49:11 -07:00
Adam Townsend 47e5a093b4 added tests stage to jenkinsfile and added a note to the readme about pkgconf 2023-10-06 20:00:04 -07:00
Adam Townsend a0ba8ba9f3 wrap steps in the steps block 2023-10-06 18:42:44 -07:00
Adam Townsend c0a0548662 added dependencies stage 2023-10-06 18:40:51 -07:00
Adam Townsend 2448c93fa7 wrap setting the env var in a script wrapper 2023-10-06 18:35:00 -07:00
Adam Townsend e720761106 try it again 2023-10-06 18:33:30 -07:00
Adam Townsend 450dc26df7 another attempt 2023-10-06 18:11:00 -07:00
Adam Townsend 7a32edb6e3 wrap it in an env var and add it to the env file 2023-10-06 18:09:17 -07:00
Adam Townsend 6160174c5d generate secret in rb file 2023-10-06 18:07:07 -07:00
Adam Townsend d972cc2c3b another shot 2023-10-06 18:04:54 -07:00
Adam Townsend 6795508d3e simplified 2023-10-06 17:42:48 -07:00
Adam Townsend b5af621ee2 another shot 2023-10-06 17:41:29 -07:00
Adam Townsend a4fbdeabe3 going back to the old style 2023-10-06 17:39:45 -07:00
Adam Townsend 3a71e58e22 trying to run the script, nothing else 2023-10-06 17:35:21 -07:00
Adam Townsend ef9cef8915 wrap it in a script 2023-10-06 17:25:53 -07:00
Adam Townsend ee5a6e673b attempting to use variables 2023-10-06 17:23:56 -07:00
Adam Townsend 721ce33adb trying by setting the output of the base64 generation to a jenkins variable to use later 2023-10-06 16:59:16 -07:00
Adam Townsend e1d0c6162d trying again 2023-10-06 16:49:03 -07:00
Adam Townsend 435eeb9601 another quotes try 2023-10-06 14:02:54 -07:00
Adam Townsend 95eb1fea4c trying with different quotes around commands 2023-10-06 14:01:55 -07:00
Adam Townsend 03eafcdf4c reset the file on the initial append 2023-10-06 13:59:12 -07:00
Adam Townsend 38f92d83c3 add app session secret generation to the mix 2023-10-06 13:57:42 -07:00
Adam Townsend 6c40ae6311 syntax error in Jenkinsfile, missing " at the end of the line to add to the env file 2023-10-06 13:47:11 -07:00
Adam Townsend 5cc79ed54d added line to add db name to the env file 2023-10-06 13:41:53 -07:00
Adam Townsend b70b0846a1 syntax error in Jenkinsfile 2023-10-06 12:04:46 -07:00
Adam Townsend de61253db6 added jenkinsfile with initial step for init 2023-10-06 12:02:38 -07:00
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()