-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jpradoar/hosted-runner
Hosted runner
- Loading branch information
Showing
8 changed files
with
118 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
################################## | ||
# | ||
# IMPORTANT: | ||
# THIS WORKFLOW REQUIRE YOU RUN | ||
# A RUNNER CONTAINER IN YOUR LAPTOP | ||
# FOR MORE INFORMATION SEE: | ||
# | ||
# ..c2w/GitHostedRunner/README.md | ||
# | ||
################################## | ||
--- | ||
name: CI-hosted-runner | ||
on: | ||
push: | ||
branches: | ||
- hosted-runner | ||
|
||
env: | ||
DATA: '/dev/null' | ||
|
||
jobs: | ||
CI-runner-on-my-laptop: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
|
||
- name: Show versions | ||
run: | | ||
echo "hello world" | ||
echo "bye bye world" | ||
echo ${{ env.DATA }} > /tmp/test.txt |
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 |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
**/demo-inventory.ini | ||
temp/ | ||
tmp/ | ||
security.md |
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
FROM ubuntu:22.04 | ||
|
||
WORKDIR /actions-runner | ||
|
||
|
||
ENV RUNNER_NAME="eda-hosted-runner" | ||
ENV RUNNER_WORK_DIRECTORY="_work" | ||
ENV GITHUB_REPOSITORY_URL="https://github.com/jpradoar/event-driven-architecture" | ||
ENV RUNNER_TOKEN="" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl jq sudo tar git && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
curl -o actions-runner-linux-x64-2.320.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.320.0/actions-runner-linux-x64-2.320.0.tar.gz && \ | ||
tar xzf ./actions-runner-linux-x64-2.320.0.tar.gz && \ | ||
rm -rf actions-runner-linux-x64-2.320.0.tar.gz && \ | ||
apt-get clean && \ | ||
useradd -m github-runner && \ | ||
mkdir -p /actions-runner && \ | ||
chown -R github-runner:github-runner /actions-runner && \ | ||
echo "github-runner ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
USER github-runner | ||
|
||
RUN sudo ./bin/installdependencies.sh && chmod +x ./config.sh ./run.sh | ||
|
||
CMD ./config.sh --url $GITHUB_REPOSITORY_URL --token $RUNNER_TOKEN --name $RUNNER_NAME --work $RUNNER_WORK_DIRECTORY --unattended --replace && ./run.sh |
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,20 @@ | ||
# Github self-hosted runner in docker container | ||
|
||
|
||
### Build | ||
docker build -t eda-hosted-runner . | ||
|
||
|
||
### Run hosted runner | ||
docker run \ | ||
--rm \ | ||
-itd \ | ||
--name eda-hosted-runner \ | ||
--hostname eda-hosted-runner \ | ||
-e RUNNER_TOKEN=YOUR_GITHUB_RUNNER_TOKEN_HERE \ | ||
-e GITHUB_REPOSITORY_URL=https://github.com/jpradoar/event-driven-architecture \ | ||
eda-hosted-runner:latest | ||
|
||
|
||
### Using docker-compsoe | ||
docker-compose up -d |
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,9 @@ | ||
version: '3.8' | ||
services: | ||
github-runner: | ||
image: eda-hosted-runner:latest | ||
environment: | ||
- RUNNER_TOKEN=YOUR_GITHUB_RUNNER_TOKEN_HERE | ||
- GITHUB_REPOSITORY_URL=https://github.com/jpradoar/event-driven-architecture | ||
stdin_open: true | ||
tty: true |
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,27 @@ | ||
FROM ubuntu:22.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
curl \ | ||
wget \ | ||
vim \ | ||
netcat-traditional \ | ||
ansible \ | ||
unzip \ | ||
bash \ | ||
git \ | ||
openssh-client \ | ||
jq && \ | ||
wget -q https://releases.hashicorp.com/terraform/1.9.5/terraform_1.9.5_linux_386.zip && \ | ||
unzip -qq terraform_1.9.5_linux_386.zip && \ | ||
mv terraform /usr/local/bin/terraform && \ | ||
chmod +x /usr/local/bin/terraform && \ | ||
rm LICENSE.txt terraform_1.9.5_linux_386.zip && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
|
||
|
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