Skip to content

Commit ed7cf1a

Browse files
Hector AzpuruaHector Azpurua
authored andcommitted
fix typos, adding basic ci/cd config
1 parent fe16331 commit ed7cf1a

7 files changed

Lines changed: 93 additions & 8 deletions

File tree

.github/workflows/build-amd64.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: CI/CD with Docker Compose Linux Host
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Docker Buildx
16+
uses: docker/setup-buildx-action@v3
17+
18+
- name: Install Docker Compose
19+
uses: docker/setup-buildx-action@v3 # This action also sets up Compose
20+
with:
21+
install-compose: true
22+
23+
- name: Build and start Docker Compose services
24+
run: docker compose -f compose_linux_host.yaml up --build
25+
26+
- name: Wait for services to be healthy (optional, but recommended)
27+
# You can use a dedicated action or a script to wait for health checks
28+
# Example using a simple sleep (adjust as needed for your application)
29+
run: sleep 120
30+
31+
- name: Test noVNC is up
32+
run: |
33+
SERVICE_URL="http://localhost:3080"
34+
EXPECTED_RESPONSE="200"
35+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" $SERVICE_URL)
36+
if [ "$RESPONSE" == "$EXPECTED_RESPONSE" ]; then
37+
echo "Test Passed: Service returned expected response."
38+
echo "Expected: $EXPECTED_RESPONSE"
39+
echo "Actual: $RESPONSE"
40+
exit 0
41+
else
42+
echo "Test Failed: Service response did not match expected response."
43+
echo "Expected: $EXPECTED_RESPONSE"
44+
echo "Actual: $RESPONSE"
45+
exit 1
46+
fi
47+
48+
- name: Test code-server is up
49+
run: |
50+
SERVICE_URL="http://localhost:3081"
51+
EXPECTED_RESPONSE="200"
52+
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" $SERVICE_URL)
53+
if [ "$RESPONSE" == "$EXPECTED_RESPONSE" ]; then
54+
echo "Test Passed: Service returned expected response."
55+
echo "Expected: $EXPECTED_RESPONSE"
56+
echo "Actual: $RESPONSE"
57+
exit 0
58+
else
59+
echo "Test Failed: Service response did not match expected response."
60+
echo "Expected: $EXPECTED_RESPONSE"
61+
echo "Actual: $RESPONSE"
62+
exit 1
63+
fi
64+
- name: Test sshd is up
65+
run: |
66+
EXPECTED_RESPONSE="1"
67+
RESPONSE=$(netstat -an | grep 0.0.0.0:3022 | grep tcp | grep LISTEN | wc -l)
68+
if [ "$RESPONSE" == "$EXPECTED_RESPONSE" ]; then
69+
echo "Test Passed: Service returned expected response."
70+
echo "Expected: $EXPECTED_RESPONSE"
71+
echo "Actual: $RESPONSE"
72+
exit 0
73+
else
74+
echo "Test Failed: Service response did not match expected response."
75+
echo "Expected: $EXPECTED_RESPONSE"
76+
echo "Actual: $RESPONSE"
77+
exit 1
78+
fi
79+
80+
- name: Check running containers (optional for debugging)
81+
run: docker ps -a
82+
83+
- name: Stop and remove containers
84+
run: docker compose -f compose_linux_host.yaml down

.github/workflows/build-arm64.yaml

Whitespace-only changes.

docker/Dockerfile.amd64

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
FROM osrf/ros:noetic-desktop-full AS amd64_build_state
44

5-
INCLUDE+ Dockerfile.root.common
5+
INCLUDE+ docker/Dockerfile.root.common
66

77
# vscode server
88
RUN curl -fOL https://github.com/coder/code-server/releases/download/v4.104.2/code-server_4.104.2_amd64.deb && \
99
dpkg -i code-server_4.104.2_amd64.deb && \
1010
rm code-server_4.104.2_amd64.deb
1111

12-
INCLUDE+ Dockerfile.user.common
12+
INCLUDE+ docker/Dockerfile.user.common
13+
INCLUDE+ docker/Dockerfile.user.common

docker/Dockerfile.arm64

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM arm64v8/ros:noetic-perception-focal AS arm64_build_state
44

5-
INCLUDE+ Dockerfile.root.common
5+
INCLUDE+ docker/Dockerfile.root.common
66

77
# vscode server
88
RUN curl -fOL https://github.com/coder/code-server/releases/download/v4.104.2/code-server_4.104.2_arm64.deb && \
@@ -13,4 +13,5 @@ RUN curl -fOL https://github.com/coder/code-server/releases/download/v4.104.2/c
1313
RUN wget http://ports.ubuntu.com/pool/main/libf/libffi/libffi8_3.4.2-4_arm64.deb -P /tmp && \
1414
dpkg -i /tmp/libffi8_3.4.2-4_arm64.deb;
1515

16-
INCLUDE+ Dockerfile.user.common
16+
INCLUDE+ docker/Dockerfile.user.common
17+
INCLUDE+ docker/Dockerfile.entrypoint.common
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ENTRYPOINT [ "docker/entrypoint.sh" ]
2+
CMD [ "sudo", "-E", "/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

docker/Dockerfile.user.common

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@ RUN echo "export PS1='[docker]\[\e[38;5;216m\]\u\[\e[38;5;160m\]@\[\e[38;5;202m\
1010
RUN mkdir -p /home/ubuntu/ros_ws/src
1111
RUN chown -R ubuntu:ubuntu /home/ubuntu/
1212

13-
# RUN rosdep update
14-
15-
ENTRYPOINT [ "/entrypoint.sh" ]
16-
CMD [ "sudo", "-E", "/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
13+
# RUN rosdep update
File renamed without changes.

0 commit comments

Comments
 (0)