Skip to content

Commit 3d5e263

Browse files
author
anandkumarpatel
committed
Merge pull request #228 from CodeNow/revert-222-build-on-server
Revert "modify building for faster deploys"
2 parents 545c9b6 + bb8bb64 commit 3d5e263

3 files changed

Lines changed: 5 additions & 22 deletions

File tree

ansible/ansible.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

ansible/roles/builder/tasks/main.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66
path="{{ build_dir }}/{{ name }}"
77
state=directory
88

9-
- name: pull the git repository
10-
sudo: yes
11-
git:
12-
repo="{{ repo }}"
13-
dest="{{ build_dir }}/{{ name }}"
14-
version="{{ git_branch }}"
15-
update=yes
16-
accept_hostkey=True
17-
force=yes
18-
depth=1
19-
209
- name: copy dockerfile to build folder
2110
sudo: yes
2211
template:

ansible/roles/builder/templates/basic_node/Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,18 @@ ENV {{ env }}
1515
# setup node and npm versions
1616
RUN n {{ node_version }} && npm install -g npm@{{ npm_version }}
1717

18+
# Download Repo
19+
RUN git clone -b {{ git_branch }} --single-branch {{ repo }} /{{ name }}
20+
21+
WORKDIR /{{ name }}
1822
{% if dockerfile_pre_install_commands is defined %}
1923
{% for command in dockerfile_pre_install_commands %}
2024
RUN {{ command }}
2125
{% endfor %}
2226
{% endif %}
2327

24-
# Add package.json from the current build context (`.` is the repo) first
25-
ADD ./package.json /{{ name }}/package.json
26-
27-
# install, should will skip if no package.json change
28-
WORKDIR /{{ name }}
2928
RUN npm install --production
3029

31-
# move the current build context (`.` is the repo) to /{{ name }}
32-
ADD . /{{ name }}
33-
3430
{% if dockerfile_post_install_commands is defined %}
3531
{% for command in dockerfile_post_install_commands %}
3632
RUN {{ command }}
@@ -39,3 +35,4 @@ RUN {{ command }}
3935

4036
# Define default command.
4137
CMD ulimit -c unlimited && /usr/local/bin/npm {{ npm_start_command | default('start') }} > /var/log/{{ name }}.log 2>&1
38+

0 commit comments

Comments
 (0)