Skip to content

Commit

Permalink
Merge pull request #8 from gounthar/updatecli
Browse files Browse the repository at this point in the history
Updatecli
  • Loading branch information
gounthar authored Nov 25, 2023
2 parents b358621 + 0d586cf commit afe652d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 42 deletions.
79 changes: 39 additions & 40 deletions build-docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,131 +4,130 @@ services:
build: dockerfiles/sidekick/.
stdin_open: true
tty: true
entrypoint: sh -c "/usr/local/bin/keygen.sh /ssh-dir" # Runs the keygen.sh script and specifies the output directory
entrypoint: sh -c "/usr/local/bin/keygen.sh /ssh-dir" # Runs the keygen.sh script and specifies the output directory
volumes:
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /ssh-dir path inside the container
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /ssh-dir path inside the container
healthcheck:
test: [ "CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1" ] # Checks if the conductor_ok file exists in the /ssh-dir path
test: ["CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1"]
# Checks if the conductor_ok file exists in the /ssh-dir path
interval: 5s
timeout: 10s
retries: 5

jenkins_controller:
build: dockerfiles/.
restart: on-failure
ports:
- "8080:8080"
volumes:
- jenkins_home:/var/jenkins_home # Mounts the jenkins_home volume to the /var/jenkins_home path inside the container
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /app path inside the container
- jenkins_home:/var/jenkins_home # Mounts the jenkins_home volume to the /var/jenkins_home path inside the container
- agent-ssh-dir:/ssh-dir # Mounts the agent-ssh-dir volume to the /app path inside the container
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
healthcheck:
test: [ "CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1" ] # Checks if the conductor_ok file exists in the /ssh-dir path
test: ["CMD-SHELL", "[ -f /ssh-dir/conductor_ok ] || exit 1"]
# Checks if the conductor_ok file exists in the /ssh-dir path
interval: 5s
timeout: 10s
retries: 5

default_agent:
image: jenkins/ssh-agent:5.5.0-jdk17
image: jenkins/ssh-agent:5.20.0
container_name: desktop-jenkins_agent-1
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
test: ["CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1"]
# Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only

- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
maven:
build: dockerfiles/maven/.
container_name: desktop-jenkins_agent-1
profiles:
- maven
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
test: ["CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1"]
# Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only

- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
python:
build: dockerfiles/python/.
container_name: desktop-jenkins_agent-1
profiles:
- python
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
condition: service_started
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
test: ["CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1"]
# Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only

- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
node:
build: dockerfiles/node/.
environment:
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
container_name: desktop-jenkins_agent-1
profiles:
- node
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
condition: service_started
ports:
- "3000:3000"
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
test: ["CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1"]
# Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only

- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
multi:
build: dockerfiles/multi/.
environment:
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
- GITPOD_WORKSPACE_URL=${GITPOD_WORKSPACE_URL}
container_name: desktop-jenkins_agent-1
profiles:
- multi
depends_on:
sidekick_service:
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
condition: service_completed_successfully # Depends on the successful completion of the sidekick_service
jenkins_controller:
condition: service_started
condition: service_started
ports:
- "3000:3000"
- "5000:5000"
healthcheck:
test: [ "CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1" ] # Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
test: ["CMD-SHELL", "[ -f /home/jenkins/.ssh/authorized_keys ] || exit 1"]
# Checks if the authorized_keys file exists in the /home/jenkins/.ssh path
interval: 5s
timeout: 10s
retries: 5
volumes:
- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only


- agent-ssh-dir:/home/jenkins/.ssh:ro # Mounts the agent-ssh-dir volume to the /home/jenkins/.ssh path inside the container as read-only
volumes:
jenkins_home:
jenkins_home: null
agent-ssh-dir:
name: agent-ssh-dir # Creates a named volume called agent-ssh-dir
name: agent-ssh-dir # Creates a named volume called agent-ssh-dir
2 changes: 1 addition & 1 deletion dockerfiles/node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM jenkins/ssh-agent:5.20.0 as ssh-agent
ARG NODE_MAJOR=18
ARG NODE_MAJOR=20

# ca-certificates because curl will need it later on for the node installation
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl gnupg && \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ RUN echo "PATH=${PATH}" >> /etc/environment

# Set the ownership of the Jenkins agent home directory to the Jenkins user.
# This ensures that the Jenkins user has the necessary permissions to access its home directory.
RUN chown -R jenkins:jenkins "${JENKINS_AGENT_HOME}"
RUN chown -R jenkins:jenkins "${JENKINS_AGENT_HOME}"

0 comments on commit afe652d

Please sign in to comment.