Compare commits

..

No commits in common. "b3b886f0b3ee39c4266bd76d52fae6cec9afbb98" and "10fe82ab6a77d6021e2abd97a623f4ca510bec63" have entirely different histories.

2 changed files with 6 additions and 6 deletions

10
Jenkinsfile vendored
View File

@ -7,11 +7,9 @@ pipeline {
stages {
stage('Init') {
steps {
sh ''' #!/usr/local/bin/bash
rbenv local 3.2.2
echo "ENV[\\\"APP_SESSION_SECRET\\\"] ||= $(ruby -rsecurerandom -e 'puts SecureRandom.base64(64).inspect()')" > .env.rb
echo "ENV[\\\"DB_NAME\\\"] ||= \\\"${DB_NAME}\\\"" >> .env.rb
'''
sh 'rbenv local 3.2.2'
sh 'echo "ENV[\\\"APP_SESSION_SECRET\\\"] ||= $(ruby secret.rb)" > .env.rb'
sh 'echo "ENV[\\\"DB_NAME\\\"] ||= \\\"${DB_NAME}\\\"" >> .env.rb'
}
}
stage('Build dependencies') {
@ -53,7 +51,7 @@ pipeline {
cp .env.rb /tmp/url-shortener/
cp .ruby-version /tmp/url-shortener/
cd /tmp/url-shortener
rm -rf features spec coverage db/*.db .git* Jenkinsfile *.html
rm -rf features spec coverage db/*.db .git* Jenkinsfile *.html secret.rb
cd /tmp
tar -czvf $ZIP_FILE url-shortener/
mv /tmp/$ZIP_FILE $CUR_DIR/

2
secret.rb 100644
View File

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