-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.bu
More file actions
81 lines (70 loc) · 2.23 KB
/
Copy pathdocker-compose.bu
File metadata and controls
81 lines (70 loc) · 2.23 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
variant: fcos
version: 1.6.0
storage:
files:
- path: /opt/bin/docker-compose
mode: 0755
overwrite: true
contents:
source: "https://github.com/docker/compose/releases/download/v2.32.4/docker-compose-linux-x86_64"
verification:
hash: sha256-ed1917fb54db184192ea9d0717bcd59e3662ea79db48bff36d3475516c480a6b
- path: /opt/bin/git-sync
mode: 0755
overwrite: true
contents:
inline: |
#!/usr/bin/env bash
REPO_PATH="/home/core/earthquake"
REPO_URL="git@github.com:Alvaro-Kothe/earthquake-hazzard.git"
# Clone the repository if it doesn't exist
if [ ! -d "$REPO_PATH/.git" ]; then
git clone "$REPO_URL" "$REPO_PATH"
else
# Pull changes if the repository exists
cd "$REPO_PATH" && git pull
fi
systemd:
units:
- name: selinux-label-opt-bin.service
enabled: true
contents: |
[Unit]
Description=Set SELinux label on /opt/bin binaries
[Service]
Type=oneshot
ExecStart=/usr/bin/chcon -t bin_t /opt/bin/git-sync /opt/bin/docker-compose
[Install]
WantedBy=multi-user.target
- name: git-sync.service
enabled: true
contents: |
[Unit]
Description=Synchronize Git Repository
After=network-online.target selinux-label-opt-bin.service
Requires=selinux-label-opt-bin.service
ConditionPathExists=/opt/bin/git-sync
[Service]
Type=oneshot
ExecStart=/opt/bin/git-sync
Restart=on-failure
StartLimitIntervalSec=300
StartLimitBurst=3
User=core
Group=core
[Install]
WantedBy=multi-user.target
- name: earthquake.service
enabled: true
contents: |
[Unit]
Description=Run Earthquake DAGs
After=network-online.target git-sync.service docker.service selinux-label-opt-bin.service
Requires=docker.service git-sync.service
[Service]
Restart=always
WorkingDirectory=/home/core/earthquake
ExecStart=/opt/bin/docker-compose up --build
ExecStop=/opt/bin/docker-compose down
[Install]
WantedBy=multi-user.target