Skip to content

Commit db3edc1

Browse files
Merge pull request #370 from continuouspipe/feature/spryker-crons
Spryker Crons
2 parents 2e2d3b8 + 79b4dd0 commit db3edc1

File tree

9 files changed

+62
-4
lines changed

9 files changed

+62
-4
lines changed

spryker/Dockerfile.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ RUN curl -sL https://deb.nodesource.com/setup_6.x > /tmp/install-node.sh \
1818
&& rm -rf /var/lib/apt/lists/*
1919

2020
COPY ./{{WEB_SERVER}}/ /
21+
COPY ./etc/ /etc/
2122
COPY ./usr/ /usr/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[template]
2+
src = "cron/spryker.tmpl"
3+
dest = "/etc/cron.d/spryker"
4+
mode = "0644"
5+
keys = [
6+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[template]
2+
src = "supervisor/spryker_collectors_crons.conf.tmpl"
3+
dest = "/etc/supervisor/conf.d/spryker_collectors_crons.conf"
4+
mode = "0644"
5+
keys = [
6+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[template]
2+
src = "supervisor/spryker_crons.conf.tmpl"
3+
dest = "/etc/supervisor/conf.d/spryker_crons.conf"
4+
mode = "0644"
5+
keys = [
6+
]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# don't send any mail
2+
MAILTO=""
3+
SUPERVISORCTL="supervisorctl -c /etc/supervisor/supervisord.conf -u supervisor -p supervisor"
4+
5+
*/10 * * * * root $SUPERVISORCTL start mailqueue-registration-send
6+
* * * * * root $SUPERVISORCTL start stores-collectors
7+
* * * * * root $SUPERVISORCTL start oms-check-condition
8+
* * * * * root $SUPERVISORCTL start oms-check-timeout
9+
0 6 * * * root $SUPERVISORCTL start oms-clear-locks
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[program: stores-collectors]
2+
command = /usr/local/bin/container run_collectors
3+
startsecs = 0
4+
startretries = 0
5+
stdout_logfile=/dev/stdout
6+
stdout_logfile_maxbytes=0
7+
stderr_logfile=/dev/stderr
8+
stderr_logfile_maxbytes=0
9+
user = root
10+
autostart = false
11+
autorestart = false
12+
priority = 5
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{ $nodes := split "mailqueue:registration:send,oms:check-condition,oms:check-timeout,oms:clear-locks" "," }}
2+
{{ range $nodes }}
3+
[program: {{ replace ( . ) ":" "-" -1 }}]
4+
command = /app/vendor/bin/console {{ . }}
5+
startsecs = 0
6+
startretries = 0
7+
stdout_logfile=/dev/stdout
8+
stdout_logfile_maxbytes=0
9+
stderr_logfile=/dev/stderr
10+
stderr_logfile_maxbytes=0
11+
user = www-data
12+
autostart = false
13+
autorestart = false
14+
priority = 5
15+
{{ end }}

spryker/usr/local/share/env/30-framework

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ export YVES_HOST_PROTOCOL=${YVES_HOST_PROTOCOL:-https://}
3131
export ZED_HOST=${ZED_HOST:-zed}
3232
export ZED_HOST_PROTOCOL=${ZED_HOST_PROTOCOL:-https://}
3333

34-
export YVES_SESSION_COOKIE_SECURE=${YVES_SESSION_COOKIE_SECURE:-true}
35-
export ZED_SESSION_COOKIE_SECURE=${ZED_SESSION_COOKIE_SECURE:-true}
34+
YVES_SESSION_COOKIE_SECURE="$(convert_to_boolean_string "${YVES_SESSION_COOKIE_SECURE:-true}")"
35+
export YVES_SESSION_COOKIE_SECURE
36+
ZED_SESSION_COOKIE_SECURE="$(convert_to_boolean_string "${ZED_SESSION_COOKIE_SECURE:-true}")"
37+
export ZED_SESSION_COOKIE_SECURE
3638

3739
export APP_ENDPOINT_STRICT=${APP_ENDPOINT_STRICT:-true}
3840

spryker/usr/local/share/spryker/spryker_functions.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ do_spryker_install() {
119119
do_spryker_import_demodata
120120
do_spryker_product_label_relations_update
121121
do_spryker_setup_search
122+
do_spryker_app_permissions
122123
do_spryker_run_collectors
123124
fi
124125
}
@@ -128,8 +129,8 @@ do_spryker_migrate() {
128129
}
129130

130131
do_spryker_run_collectors() {
131-
as_code_owner "vendor/bin/console collector:search:export"
132-
as_code_owner "vendor/bin/console collector:storage:export"
132+
as_app_user "vendor/bin/console collector:search:export"
133+
as_app_user "vendor/bin/console collector:storage:export"
133134
}
134135

135136
do_spryker_propel_install() {

0 commit comments

Comments
 (0)