Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ jobs:

strategy:
matrix:
runner: [1,2,3,4,5]
runner: [1,2,3]
steps:
- uses: actions/checkout@v4

- name: Debug
run: |
echo "Who am I: $(whoami)"
echo "Hostname: $(hostname -f)"
echo "Environment:"
env
echo "Who am I: $(whoami)@$(hostname -f)"
echo "Where am I: $(pwd)"
echo "Env:"
env | grep GITHUB

- name: Help
run: |
Expand All @@ -49,12 +49,19 @@ jobs:
--name=${RUNNER_CONFIG_NAME} \
--config-sh-options=--ephemeral

- name: Run again
run: |
./github-runner-installer \
--run \
--name=${RUNNER_CONFIG_NAME} \
--config-sh-options=--ephemeral

run:
name: Run Tasks
runs-on: "jonpugh@github-runner.${{ github.run_id }}"
strategy:
matrix:
runner: [1,2,3,4,5]
runner: [1,2,3,4,5,6]
steps:
- uses: actions/checkout@v4

Expand All @@ -64,3 +71,7 @@ jobs:
echo "Hostname: $(hostname -f)"
echo "Environment:"
env

- name: A second task
run: |
echo "Confirmed."
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ RUN chown runner:runner . -R
# GitHub Runner code.
# Install runner to a path that won't ever be in a volume.
ENV RUNNER_PATH /usr/share/github-runner
# We are installing as root then switching back because we need to use the install-dependencies script.
RUN ./github-runner-installer --no-run --no-config --runner-path=${RUNNER_PATH}
RUN ${RUNNER_PATH}/bin/installdependencies.sh
RUN chown runner:runner ${RUNNER_PATH} -R

# Install Dependencies
RUN curl https://raw.githubusercontent.com/actions/runner/refs/tags/v2.326.0/src/Misc/layoutbin/installdependencies.sh -o install-dependencies \
&& bash install-dependencies

# Run github-runner-installer script.
#RUN ./github-runner-installer --no-run --no-config --runner-path=${RUNNER_PATH}

# Change runner ownership & Switch user.
# RUN chown runner:runner ${RUNNER_PATH} -R
USER runner
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- ./:/github-runner-installer
environment:
GITHUB_TOKEN: ${GITHUB_TOKEN}
GITHUB_REPOSITORY: jonpugh/github-runner
GITHUB_REPOSITORY: operations-project/github-runner-installer
RUNNER_CONFIG_LABELS: ${RUNNER_CONFIG_LABELS:-runner@localhost}
entrypoint: ./docker-entrypoint
command: ./github-runner-installer
Expand Down
12 changes: 1 addition & 11 deletions github-runner-installer
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ verify() {
# Defaults. If ENV vars exist, use them. If not, use these values.
RUNNER_PATH=${RUNNER_PATH:-"runner"}
RUNNER_CONFIG_NAME=${RUNNER_CONFIG_NAME:-$(whoami)@$(hostname -f)}
RUNNER_CONFIG_LABELS=${RUNNER_CONFIG_LABELS:-"jonpugh/github-runner-installer"}
RUNNER_CONFIG_LABELS=${RUNNER_CONFIG_LABELS:-"operations-project/github-runner-installer"}
RUNNER_CONFIG_OPTIONS=${RUNNER_CONFIG_OPTIONS:-""}

# Whether to run the runner
Expand Down Expand Up @@ -278,17 +278,7 @@ download() {
configure() {
line
say Configuring GitHub runner...
say Removing existing runner...

# Remove
# @TODO: If runner has a job, wait for it to complete.
cd $RUNNER_FOLDER
echo ./config.sh remove --token ${RUNNER_CONFIG_TOKEN}
./config.sh remove --token ${RUNNER_CONFIG_TOKEN} || say "config remove didn't work."

rm -rf .credentials .runner
line
say Configuring new runner...

# Configure
CMD="./config.sh \
Expand Down