Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b3b886f0b3 | |||
| 93aa007c14 | |||
| 4e32f4a60d | |||
| 2759880a53 | |||
| 7bc1a852db | |||
| 00119f9723 | |||
| ff2a0e867d | |||
| 1fae85ff9d | |||
| 10fe82ab6a | |||
| 9812a92d59 | |||
| e8b12c307a | |||
| ae00ac8672 | |||
| bf92201721 | |||
| 1f2e3d41dd | |||
| f31b6da49c | |||
| f32d153b69 | |||
| 15d9ade2cf | |||
| 4587c35806 | |||
| 340614dadc | |||
| 8a0fef63b2 | |||
| 8691d19e8d | |||
| 35d196bdc2 | |||
| e2c3cb7035 | |||
| a69b3e4226 | |||
| 36285b060b | |||
| a0a9e84b91 | |||
| 01d9f9a21c | |||
| 621a777a46 | |||
| 6fbecd78a4 | |||
| 873b86a809 | |||
| 47393a5ead | |||
| 69c56ae31a | |||
| b2cdf60a32 | |||
| 91f45965a0 | |||
| 3097cb69aa | |||
| eed17d61a3 | |||
| 9e5a4069a4 | |||
| f8c20541d5 | |||
| ee07312b86 | |||
| e4eabf8aa6 | |||
| 3ec0f0ff7b | |||
| 27b32fc8f4 | |||
| ceab408ec0 | |||
| b56b618a8c |
Vendored
+34
-9
@@ -2,19 +2,16 @@ pipeline {
|
|||||||
agent any
|
agent any
|
||||||
|
|
||||||
environment {
|
environment {
|
||||||
APP_SESSION_SECRET = ''
|
|
||||||
DB_NAME = 'url_shortener.db'
|
DB_NAME = 'url_shortener.db'
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Init') {
|
stage('Init') {
|
||||||
steps {
|
steps {
|
||||||
sh 'rbenv local 3.2.2'
|
sh ''' #!/usr/local/bin/bash
|
||||||
script {
|
rbenv local 3.2.2
|
||||||
env.APP_SESSION_SECRET = sh(script: 'ruby secret.rb', returnStdout: true)
|
echo "ENV[\\\"APP_SESSION_SECRET\\\"] ||= $(ruby -rsecurerandom -e 'puts SecureRandom.base64(64).inspect()')" > .env.rb
|
||||||
}
|
echo "ENV[\\\"DB_NAME\\\"] ||= \\\"${DB_NAME}\\\"" >> .env.rb
|
||||||
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') {
|
stage('Build dependencies') {
|
||||||
@@ -35,7 +32,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Report results') {
|
stage('Report results') {
|
||||||
steps {
|
steps {
|
||||||
archive(includes: 'pkg/*.gem')
|
|
||||||
publishHTML (target: [
|
publishHTML (target: [
|
||||||
allowMissing: false,
|
allowMissing: false,
|
||||||
alwaysLinkToLastBuild: false,
|
alwaysLinkToLastBuild: false,
|
||||||
@@ -46,6 +42,32 @@ pipeline {
|
|||||||
reportTitles: 'Cucumber Results, RSpec Results, Test Coverage'])
|
reportTitles: 'Cucumber Results, RSpec Results, Test Coverage'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('Build production deliverable') {
|
||||||
|
steps {
|
||||||
|
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||||
|
sh ''' #!/usr/local/bin/bash
|
||||||
|
ZIP_FILE="url-shortener_$(date "+%Y-%m-%d_%H-%M-%S").tgz"
|
||||||
|
CUR_DIR=$(pwd)
|
||||||
|
mkdir -p /tmp/url-shortener
|
||||||
|
cp -R * /tmp/url-shortener
|
||||||
|
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
|
||||||
|
cd /tmp
|
||||||
|
tar -czvf $ZIP_FILE url-shortener/
|
||||||
|
mv /tmp/$ZIP_FILE $CUR_DIR/
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
archiveArtifacts artifacts: '*.tgz'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Clean up deliverable') {
|
||||||
|
steps {
|
||||||
|
sh 'rm -rf /tmp/url-shortener'
|
||||||
|
sh 'rm -rf *.tgz'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
@@ -57,5 +79,8 @@ pipeline {
|
|||||||
failure {
|
failure {
|
||||||
mattermostSend channel: 'git-messages', color: 'danger', message: "[${JOB_NAME}](${JOB_URL}) [#${BUILD_NUMBER}](${BUILD_URL}) ([Gitea](${GIT_URL}))", text: "Build Failed"
|
mattermostSend channel: 'git-messages', color: 'danger', message: "[${JOB_NAME}](${JOB_URL}) [#${BUILD_NUMBER}](${BUILD_URL}) ([Gitea](${GIT_URL}))", text: "Build Failed"
|
||||||
}
|
}
|
||||||
|
always {
|
||||||
|
cleanWs deleteDirs: true, patterns: [[pattern: '*', type: 'INCLUDE']]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user