Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp90023-assignment-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Matthew O'Halloran
comp90023-assignment-2
Commits
06aa7c5a
Commit
06aa7c5a
authored
May 24, 2020
by
matt01671
Browse files
Options
Downloads
Patches
Plain Diff
react build
parent
5abc4525
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ansible/roles/react-build/tasks/main.yaml
+28
-9
28 additions, 9 deletions
ansible/roles/react-build/tasks/main.yaml
with
28 additions
and
9 deletions
ansible/roles/react-build/tasks/main.yaml
+
28
−
9
View file @
06aa7c5a
...
...
@@ -71,6 +71,28 @@
with_items
:
-
"
{{
volumes
}}"
-
name
:
stop all the running server
become
:
yes
command
:
pm2 kill
register
:
stop_server
-
debug
:
msg
:
'
all
servers
stopped'
-
name
:
Ansible check directory exists on server.
stat
:
path
:
/var/lib/react/react-app
register
:
delete_from_server
-
name
:
delete previous build folder in server
become
:
yes
shell
:
rm -rf /var/lib/react/react-app
args
:
chdir
:
/var/lib/react/
-
debug
:
msg
:
"
deleting
old
build
from
server"
when
:
delete_from_server.stat.exists ==
true
-
name
:
traverse into the project directory.
become
:
yes
shell
:
cd
...
...
@@ -142,7 +164,9 @@
-
name
:
install dependencies
become
:
yes
command
:
npm install --save express
shell
:
npm install --save express
args
:
chdir
:
/var/lib/react/react-app/reactUI/
-
debug
:
msg
:
'
Client
express
installed'
...
...
@@ -252,16 +276,11 @@
msg
:
'
build
copied'
when
:
build_delete_server.rc ==
0
-
name
:
stop all the running server
become
:
yes
command
:
pm2 stop all
register
:
stop_server
-
debug
:
msg
:
'
all
servers
stopped'
-
name
:
start the server
become
:
yes
command
:
pm2 start /var/lib/react/react-app/reactUI/server.js
shell
:
pm2 start /var/lib/react/react-app/reactUI/server.js
args
:
chdir
:
/var/lib/react/react-app/reactUI/
-
debug
:
msg
:
'
yayyyyyyyyyyy
app
is
running'
# when: stop_server.rc == 0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment