Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
7fe89dd051 | |||
e6bb63c807 |
7 changed files with 42 additions and 44 deletions
29
Jenkinsfile
vendored
Normal file
29
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'crystallang/crystal:1.11.0-alpine'
|
||||||
|
reuseNode true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'shards install'
|
||||||
|
sh 'shards build --production --static'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
echo 'Testing..'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Deploy') {
|
||||||
|
steps {
|
||||||
|
echo 'Deploying....'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
2
Makefile
2
Makefile
|
@ -24,7 +24,7 @@ test:
|
||||||
install:
|
install:
|
||||||
install \
|
install \
|
||||||
-m 755 \
|
-m 755 \
|
||||||
bin/mfm \
|
bin/code-preloader \
|
||||||
$(PREFIX)/bin
|
$(PREFIX)/bin
|
||||||
|
|
||||||
.PHONY: spec test build all prepare install
|
.PHONY: spec test build all prepare install
|
||||||
|
|
|
@ -94,34 +94,11 @@ module GX
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
## PASS 1
|
|
||||||
file_data = File.read(config_path)
|
file_data = File.read(config_path)
|
||||||
file_patched = Crinja.render(
|
file_patched = Crinja.render(file_data, {"env" => ENV.to_h})
|
||||||
file_data,
|
|
||||||
{
|
|
||||||
"env" => ENV.to_h,
|
|
||||||
"mfm" => {
|
|
||||||
"global" => {"mount_point_base" => "" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
root = Models::RootConfig.from_yaml(file_patched)
|
|
||||||
|
|
||||||
mount_point_base_safe = root.global.mount_point_base
|
|
||||||
raise Models::InvalidMountpointError.new("Invalid global mount point") if mount_point_base_safe.nil?
|
|
||||||
|
|
||||||
## PASS 2
|
|
||||||
file_patched = Crinja.render(
|
|
||||||
file_data,
|
|
||||||
{
|
|
||||||
"env" => ENV.to_h,
|
|
||||||
"mfm" => {
|
|
||||||
"global" => {"mount_point_base" => mount_point_base_safe }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
root = Models::RootConfig.from_yaml(file_patched)
|
root = Models::RootConfig.from_yaml(file_patched)
|
||||||
|
|
||||||
mount_point_base_safe = root.global.mount_point_base
|
mount_point_base_safe = root.global.mount_point_base
|
||||||
raise Models::InvalidMountpointError.new("Invalid global mount point") if mount_point_base_safe.nil?
|
raise Models::InvalidMountpointError.new("Invalid global mount point") if mount_point_base_safe.nil?
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,6 @@ Log.setup do |config|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
cli = GX::Cli.new
|
app = GX::Cli.new
|
||||||
cli.parse_command_line(ARGV)
|
app.parse_command_line(ARGV)
|
||||||
cli.run
|
app.run
|
||||||
|
|
|
@ -13,7 +13,6 @@ module GX::Models
|
||||||
getter remote_user : String = ""
|
getter remote_user : String = ""
|
||||||
getter remote_host : String = ""
|
getter remote_host : String = ""
|
||||||
getter remote_port : String = "22"
|
getter remote_port : String = "22"
|
||||||
getter options : Array(String) = [] of String
|
|
||||||
|
|
||||||
include Concerns::Base
|
include Concerns::Base
|
||||||
|
|
||||||
|
@ -29,19 +28,13 @@ module GX::Models
|
||||||
mount_point_safe = @mount_point
|
mount_point_safe = @mount_point
|
||||||
raise InvalidMountpointError.new("Invalid mount point") if mount_point_safe.nil?
|
raise InvalidMountpointError.new("Invalid mount point") if mount_point_safe.nil?
|
||||||
|
|
||||||
options = [] of String
|
|
||||||
# merge sshfs options
|
|
||||||
@options.each do |option|
|
|
||||||
options.push("-o", option)
|
|
||||||
end
|
|
||||||
options.push("-p", remote_port)
|
|
||||||
options.push(
|
|
||||||
"#{@remote_user}@#{@remote_host}:#{@remote_path}",
|
|
||||||
mount_point_safe
|
|
||||||
)
|
|
||||||
process = Process.new(
|
process = Process.new(
|
||||||
"sshfs",
|
"sshfs",
|
||||||
options,
|
[
|
||||||
|
"-p", remote_port,
|
||||||
|
"#{@remote_user}@#{@remote_host}:#{@remote_path}",
|
||||||
|
mount_point_safe,
|
||||||
|
],
|
||||||
input: STDIN,
|
input: STDIN,
|
||||||
output: STDOUT,
|
output: STDOUT,
|
||||||
error: STDERR
|
error: STDERR
|
||||||
|
@ -50,4 +43,3 @@ module GX::Models
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue