Compare commits
34 Commits
c29d53a33b
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 1822004460 | |||
| b9345f9cb5 | |||
| 166c68570d | |||
| 28fc8b3b86 | |||
| 2c7a18c374 | |||
| 0a3f6c5fab | |||
| ca29051dc2 | |||
| 0b51b52b84 | |||
| 4659942800 | |||
| 6d0f594bba | |||
| 4ca73cc3ca | |||
| 1f96facbf2 | |||
| e362cef9ba | |||
| 25d94bbfc2 | |||
| 40e3703650 | |||
| 21eeb9db72 | |||
| 2cbe5f85b0 | |||
| b62d45d0d8 | |||
| 0dc792b0bf | |||
| 5f4209dbe8 | |||
| fbba67a9bd | |||
| 5cd296cb70 | |||
| 7c0f6eb603 | |||
| de3dcc48ab | |||
| 958091e000 | |||
| 35583e404e | |||
| 0e9342fab6 | |||
| ca4182d798 | |||
| 7d04c46728 | |||
| 4490ed3e7c | |||
| 30c1192e27 | |||
| 6e30705810 | |||
| d7c9105995 | |||
| a732eb2a61 |
@@ -2,6 +2,10 @@
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'rackup', '~> 2.1'
|
||||
|
||||
gem 'falcon', '~> 0.42.3'
|
||||
|
||||
gem 'roda', '~> 3.72'
|
||||
|
||||
gem 'sequel', '~> 5.72'
|
||||
@@ -24,8 +28,8 @@ group :test do
|
||||
gem 'simplecov'
|
||||
|
||||
gem 'rubocop', require: false
|
||||
|
||||
gem 'ruby_audit', '~> 2.2'
|
||||
|
||||
gem 'bundle-audit', '~> 0.1.0'
|
||||
end
|
||||
|
||||
gem 'puma', '~> 6.4'
|
||||
|
||||
gem 'rackup', '~> 2.1'
|
||||
|
||||
+74
-4
@@ -4,9 +4,37 @@ GEM
|
||||
addressable (2.8.5)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
ast (2.4.2)
|
||||
async (2.6.5)
|
||||
console (~> 1.10)
|
||||
fiber-annotation
|
||||
io-event (~> 1.1)
|
||||
timers (~> 4.1)
|
||||
async-container (0.16.12)
|
||||
async
|
||||
async-io
|
||||
async-http (0.61.0)
|
||||
async (>= 1.25)
|
||||
async-io (>= 1.28)
|
||||
async-pool (>= 0.2)
|
||||
protocol-http (~> 0.25.0)
|
||||
protocol-http1 (~> 0.16.0)
|
||||
protocol-http2 (~> 0.15.0)
|
||||
traces (>= 0.10.0)
|
||||
async-http-cache (0.4.3)
|
||||
async-http (~> 0.56)
|
||||
async-io (1.37.0)
|
||||
async
|
||||
async-pool (0.4.0)
|
||||
async (>= 1.25)
|
||||
base64 (0.1.1)
|
||||
bigdecimal (3.1.4)
|
||||
build-environment (1.13.0)
|
||||
builder (3.2.4)
|
||||
bundle-audit (0.1.0)
|
||||
bundler-audit
|
||||
bundler-audit (0.9.1)
|
||||
bundler (>= 1.2.0, < 3)
|
||||
thor (~> 1.0)
|
||||
capybara (3.39.2)
|
||||
addressable
|
||||
matrix
|
||||
@@ -16,6 +44,9 @@ GEM
|
||||
rack-test (>= 0.6.3)
|
||||
regexp_parser (>= 1.5, < 3.0)
|
||||
xpath (~> 3.2)
|
||||
console (1.23.2)
|
||||
fiber-annotation
|
||||
fiber-local
|
||||
cucumber (9.0.2)
|
||||
builder (~> 3.2, >= 3.2.4)
|
||||
cucumber-ci-environment (~> 9.2, >= 9.2.0)
|
||||
@@ -43,24 +74,53 @@ GEM
|
||||
diff-lcs (1.5.0)
|
||||
docile (1.4.0)
|
||||
erubi (1.12.0)
|
||||
falcon (0.42.3)
|
||||
async
|
||||
async-container (~> 0.16.0)
|
||||
async-http (~> 0.57)
|
||||
async-http-cache (~> 0.4.0)
|
||||
async-io (~> 1.22)
|
||||
build-environment (~> 1.13)
|
||||
bundler
|
||||
localhost (~> 1.1)
|
||||
openssl (~> 3.0)
|
||||
process-metrics (~> 0.2.0)
|
||||
protocol-rack (~> 0.1)
|
||||
samovar (~> 2.1)
|
||||
ffi (1.16.2)
|
||||
fiber-annotation (0.2.0)
|
||||
fiber-local (1.0.0)
|
||||
io-event (1.3.3)
|
||||
json (2.6.3)
|
||||
language_server-protocol (3.17.0.3)
|
||||
localhost (1.1.10)
|
||||
mapping (1.1.1)
|
||||
matrix (0.4.2)
|
||||
mini_mime (1.1.5)
|
||||
mini_portile2 (2.8.4)
|
||||
multi_test (1.1.0)
|
||||
nio4r (2.5.9)
|
||||
nokogiri (1.15.4)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
openssl (3.2.0)
|
||||
parallel (1.23.0)
|
||||
parser (3.2.2.4)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
process-metrics (0.2.1)
|
||||
console (~> 1.8)
|
||||
samovar (~> 2.1)
|
||||
protocol-hpack (1.4.2)
|
||||
protocol-http (0.25.0)
|
||||
protocol-http1 (0.16.0)
|
||||
protocol-http (~> 0.22)
|
||||
protocol-http2 (0.15.1)
|
||||
protocol-hpack (~> 1.4)
|
||||
protocol-http (~> 0.18)
|
||||
protocol-rack (0.2.6)
|
||||
protocol-http (~> 0.23)
|
||||
rack (>= 1.0)
|
||||
public_suffix (5.0.3)
|
||||
puma (6.4.0)
|
||||
nio4r (~> 2.0)
|
||||
racc (1.7.1)
|
||||
rack (3.0.8)
|
||||
rack-test (2.1.0)
|
||||
@@ -101,7 +161,12 @@ GEM
|
||||
rubocop-ast (1.29.0)
|
||||
parser (>= 3.2.1.0)
|
||||
ruby-progressbar (1.13.0)
|
||||
ruby_audit (2.2.0)
|
||||
bundler-audit (~> 0.9.0)
|
||||
rubyzip (2.3.2)
|
||||
samovar (2.2.0)
|
||||
console (~> 1.0)
|
||||
mapping (~> 1.0)
|
||||
selenium-webdriver (4.13.1)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
rubyzip (>= 1.2.2, < 3.0)
|
||||
@@ -118,7 +183,10 @@ GEM
|
||||
mini_portile2 (~> 2.8.0)
|
||||
sys-uname (1.2.3)
|
||||
ffi (~> 1.1)
|
||||
thor (1.3.0)
|
||||
tilt (2.3.0)
|
||||
timers (4.3.5)
|
||||
traces (0.11.1)
|
||||
unicode-display_width (2.5.0)
|
||||
webrick (1.8.1)
|
||||
websocket (1.2.10)
|
||||
@@ -129,14 +197,16 @@ PLATFORMS
|
||||
x86_64-freebsd-13
|
||||
|
||||
DEPENDENCIES
|
||||
bundle-audit (~> 0.1.0)
|
||||
capybara (~> 3.39)
|
||||
cucumber (~> 9.0)
|
||||
erubi (~> 1.12)
|
||||
puma (~> 6.4)
|
||||
falcon (~> 0.42.3)
|
||||
rackup (~> 2.1)
|
||||
roda (~> 3.72)
|
||||
rspec (~> 3.12)
|
||||
rubocop
|
||||
ruby_audit (~> 2.2)
|
||||
selenium-webdriver (~> 4.13)
|
||||
sequel (~> 5.72)
|
||||
simplecov
|
||||
|
||||
Vendored
+81
-8
@@ -1,3 +1,5 @@
|
||||
def buildArtifact = true
|
||||
|
||||
pipeline {
|
||||
agent { label 'ruby && freebsd' }
|
||||
|
||||
@@ -18,25 +20,64 @@ pipeline {
|
||||
}
|
||||
stage('Build dependencies') {
|
||||
steps {
|
||||
sh 'bundle config set --local path "vendor"'
|
||||
sh 'bundle install'
|
||||
sh 'sequel -m db/migrations sqlite://db/${DB_NAME}'
|
||||
}
|
||||
}
|
||||
stage('Audit Dependencies') {
|
||||
steps {
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec ruby-audit check'
|
||||
sh 'bundle exec bundle-audit check >> audit.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Code Linting') {
|
||||
steps {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh 'bundle exec rubocop --format html --out rubocop.html'
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec rubocop --format html --out rubocop.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Run tests') {
|
||||
steps {
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh 'bundle exec cucumber features --format html --out cucumber.html'
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec cucumber features --format html --out cucumber.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
|
||||
sh 'bundle exec rspec spec --format html --out spec.html'
|
||||
script {
|
||||
try {
|
||||
sh 'bundle exec rspec spec --format html --out spec.html'
|
||||
} catch (e) {
|
||||
script {
|
||||
buildArtifact = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,17 +88,25 @@ pipeline {
|
||||
alwaysLinkToLastBuild: false,
|
||||
keepAll: true,
|
||||
reportDir: '.',
|
||||
reportFiles: 'rubocop.html, cucumber.html, spec.html, coverage/index.html',
|
||||
reportFiles: 'rubocop.html, audit.html, cucumber.html, spec.html, coverage/index.html',
|
||||
reportName: 'Test Results',
|
||||
reportTitles: 'Rubocop Results, Cucumber Results, RSpec Results, Test Coverage'])
|
||||
reportTitles: 'Rubocop Results, Bundler Audit Results, Cucumber Results, RSpec Results, Test Coverage'])
|
||||
}
|
||||
}
|
||||
stage('Build production deliverable') {
|
||||
when {
|
||||
expression {
|
||||
buildArtifact
|
||||
}
|
||||
}
|
||||
steps {
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
sh ''' #!/usr/local/bin/bash
|
||||
ZIP_FILE="url-shortener_${BRANCH_NAME}_$(date "+%Y-%m-%d_%H-%M-%S").tgz"
|
||||
ZIP_FILE="url-shortener_${BRANCH_NAME}_$(cat VERSION | cut -d"'" -f2).tgz"
|
||||
CUR_DIR=$(pwd)
|
||||
bundle config set --local without 'test'
|
||||
bundle config set --local path "vendor"
|
||||
bundle install
|
||||
mkdir -p /tmp/url-shortener
|
||||
cp -R * /tmp/url-shortener
|
||||
cp .env.rb /tmp/url-shortener/
|
||||
@@ -72,10 +121,34 @@ pipeline {
|
||||
archiveArtifacts artifacts: '*.tgz'
|
||||
}
|
||||
}
|
||||
stage('Generate SHA256 Hash and Upload to Artifact Repository') {
|
||||
environment {
|
||||
ARTIFACTS_KEY = credentials('artifactor-key')
|
||||
}
|
||||
steps {
|
||||
sshagent(['artifactor-key']) {
|
||||
sh ''' #!/usr/local/bin/bash
|
||||
UUID=$(uuidgen -r)
|
||||
VERSION=$(cat VERSION | cut -d"'" -f2)
|
||||
BRANCH=${BRANCH_NAME}
|
||||
ZIP_FILE="url-shortener_${BRANCH_NAME}_$(cat VERSION | cut -d"'" -f2).tgz"
|
||||
sha256 $ZIP_FILE >> SHA256.sig
|
||||
ssh artifactor@artifacts mkdir -p projects/url-shortener/$BRANCH/$VERSION/$UUID
|
||||
rsync SHA256.sig artifactor@artifacts:projects/url-shortener/$BRANCH/$VERSION/$UUID/
|
||||
rsync $ZIP_FILE artifactor@artifacts:projects/url-shortener/$BRANCH/$VERSION/$UUID/
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Clean up deliverable') {
|
||||
when {
|
||||
expression {
|
||||
buildArtifact
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh 'rm -rf /tmp/url-shortener'
|
||||
sh 'rm -rf *.tgz'
|
||||
sh 'rm SHA256.sig'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user