Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
108 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/checksum-collector/test/snapshots/checksum/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[ | ||
{ | ||
"range": [ | ||
462, | ||
483 | ||
513, | ||
534 | ||
], | ||
"statement": "chmod 755 jq-linux64 ", | ||
"binary": "jq-linux64", | ||
|
20 changes: 10 additions & 10 deletions
20
packages/checksum-collector/test/snapshots/install-shellscript/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash -x | ||
username="composer" | ||
|
||
sudo useradd ${username} -u 2000 -G docker -s /bin/bash | ||
|
||
conf_dir="conf" | ||
|
||
cat << EOF > /etc/systemd/system/composer.service | ||
[Unit] | ||
Description=Composer Service | ||
Requires=docker.service network-online.target | ||
After=docker.service network-online.target | ||
[Service] | ||
User=composer | ||
Environment="HOME=/home/composer/${conf_dir}" | ||
ExecStart=/usr/bin/docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "/home/composer/.docker:/root/.docker" -v "/home/composer:/home/composer" -w="/home/composer/${conf_dir}" docker/compose up -d | ||
ExecStop=/usr/bin/docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "/home/composer/.docker:/root/.docker" -v "/home/composer:/home/composer" -w="/home/composer/${conf_dir}" docker/compose rm -f | ||
Restart=on-failure | ||
RestartSec=10 | ||
[Install] | ||
WantedBy=multi-user.target | ||
EOF | ||
|
||
sudo chmod 644 /etc/systemd/system/composer.service | ||
sudo chown -R ${username}:${username} /home/${username} | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable --now --no-block composer.service | ||
sudo systemctl start composer.service | ||
|
||
|
||
# The application log before datadog-agent is started is not sent to datadog-logging. | ||
# So send it again. | ||
sleep 30 | ||
|
||
ids=(`docker ps -f name=${conf_dir}_ -q |xargs`) | ||
for id in "${ids[@]}" | ||
do | ||
echo "===========" | ||
echo "id: $id" | ||
log_file="$id.log" | ||
docker logs $id > /tmp/${log_file} | ||
docker cp /tmp/${log_file} $id:/tmp/${log_file} | ||
docker exec $id /bin/sh -c "cat /tmp/${log_file} >> /proc/1/fd/1" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters