Class: MiniDeploy::SampleFile

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_deploy/sample_file.rb

Instance Method Summary collapse

Instance Method Details

#hostsObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/mini_deploy/sample_file.rb', line 3

def hosts
  content = <<SAMPLE_CONTENT
---

- node_id: NODE_ID_1
  host: 10.10.10.101
  ftp_username: sample
  ftp_password: "pass^00^"
  info:
domain: example.com
sample_file: sample.php
error_log_file: error_log

- node_id: NODE_ID_2
  host: 10.10.10.102
  ftp_username: sample
  ftp_password: "pass^00^"
  info:
domain: example-2.com
sample_file: sample.php
error_log_file: error_log

SAMPLE_CONTENT

  content
end

#receiptObject



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mini_deploy/sample_file.rb', line 30

def receipt
  content = <<SAMPLE_CONTENT
---

title: Sample Deploy
date: 2017-01-02
author: Your Name
agent_name: SampleDeploy/1.0.0

deploy_nodes:
  - NODE_ID_1
  - NODE_ID_2

tasks:

  - process: upload_file
upload_local_source: ./[info.sample_file]
remote_path: ./[info.sample_file]
upload_mode: binary
tag: Test Upload File

  - process: send_http_request
method: get
url: http://[info.domain]/get
tag: Test Http Get Request 
params:
  test: "[info.domain]"

  - process: remove_file
remote_file: ./[info.sample_file]
tag: Remove file

  - process: send_http_request
method: post
params:
  author: Guanting Chen
  do: start_parse
  test: "[info.domain]"
url: https://httpbin.org/post
tag: Test Http Post Request 

  - process: check_file
remote_file: ./[info.sample_file]
tag: Check sample.php 

  - process: find_file_content
remote_file: ./[info.sample_file]
search_content: "[a-z]pple ="
ignore_case: yes
tag: Find sample.php content

SAMPLE_CONTENT

  content
end