This repository was archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·145 lines (124 loc) · 2.94 KB
/
deploy.sh
File metadata and controls
executable file
·145 lines (124 loc) · 2.94 KB
1
2
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
29
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/usr/bin/env bash
#
# Copyright 2018 NewClarity Consulting, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
declare="${CI_LOG:=}"
declare="${CI_BRANCH:=}"
declare="${CI_DEPLOY_REPO_DIR:=}"
declare="${CI_PROJECT_DIR:=}"
declare="${CI_SOURCED_FILE:=}"
source "${CI_SOURCED_FILE}"
announce "Setting the Git user"
git_set_user
if is_error ; then
announce "$(last_output)"
exit 1
fi
#announce "Locking the deploy"
#deploy_lock
#if is_error ; then
# announce "$(last_output)"
# exit 2
#fi
announce "Disabling SSH StrictHostKeyChecking"
git_disable_strict
if is_error ; then
announce "$(last_output)"
exit 3
fi
announce "Setting up Composer"
composer_setup
if is_error ; then
announce "$(last_output)"
exit 4
fi
announce "Checking out branch '${CI_BRANCH}'"
git_checkout_branch "${CI_BRANCH}" "${CI_PROJECT_DIR}"
if is_error ; then
announce "$(last_output)"
exit 5
fi
announce "Resetting branch '${CI_BRANCH}' hard"
git_reset_branch_hard "${CI_BRANCH}" "${CI_PROJECT_DIR}"
if is_error ; then
announce "$(last_output)"
exit 6
fi
announce "Deleting untracked files"
git_delete_untracked_files "${CI_PROJECT_DIR}"
if is_error ; then
announce "$(last_output)"
exit 7
fi
announce "Running 'composer install'"
composer_run "${CI_PROJECT_DIR}"
if is_error ; then
announce "$(last_output)"
exit 8
fi
announce "Cloning deploy repo"
build_clone_repo
if is_error ; then
announce "$(last_output)"
exit 9
fi
announce "Processing files"
build_process_files
if is_error ; then
announce "$(last_output)"
exit 10
fi
announce "Removing 'delete' files"
build_delete_files "${CI_DEPLOY_REPO_DIR}"
if is_error ; then
announce "$(last_output)"
exit 11
fi
#announce "Incrementing deploy"
#deploy_increment
#if is_error ; then
# announce "$(last_output)"
# exit 12
#fi
announce "Generating BUILD file"
build_generate_file
if is_error ; then
announce "$(last_output)"
exit 12
fi
announce "Pushing deploy to host"
deploy_push
if is_error ; then
announce "$(last_output)"
exit 13
fi
announce "Tagging build"
build_tag_remote "${CI_PROJECT_DIR}"
if is_error ; then
announce "$(last_output)"
exit 14
fi
build_tag_remote "${CI_DEPLOY_REPO_DIR}"
if is_error ; then
announce "$(last_output)"
exit 15
fi
announce "Build tagged as $(build_get_current_tag)"
#announce "Unlocking the deploy"
#deploy_unlock
#if is_error ; then
# announce "$(last_output)"
# exit 16
#fi