-
Notifications
You must be signed in to change notification settings - Fork 2
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
4 changed files
with
89 additions
and
0 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,39 @@ | ||
name: Jenkins slave Docker Image Build | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: greymass/jenkins-slave | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: latest | ||
|
||
- name: Log in to the Container registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./jenkins-slave/ | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} |
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 @@ | ||
jenkins ALL=(ALL) NOPASSWD: ALL |
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,48 @@ | ||
FROM jenkins/inbound-agent | ||
|
||
USER root | ||
RUN apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y --no-install-recommends \ | ||
locales \ | ||
sudo \ | ||
vim \ | ||
curl \ | ||
telnet \ | ||
git \ | ||
tmux \ | ||
gcc \ | ||
gnupg \ | ||
python3 \ | ||
python3-pip \ | ||
python3-wheel \ | ||
ansible \ | ||
tox \ | ||
ca-certificates \ | ||
apt-transport-https \ | ||
software-properties-common \ | ||
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ | ||
&& curl -sSL https://download.docker.com/linux/debian/gpg -o /tmp/docker.gpg \ | ||
&& apt-key add /tmp/docker.gpg \ | ||
&& rm /tmp/docker.gpg \ | ||
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ | ||
&& curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key -o /tmp/node.gpg \ | ||
&& apt-key add /tmp/node.gpg \ | ||
&& rm /tmp/node.gpg \ | ||
&& echo "deb https://deb.nodesource.com/node_16.x $(lsb_release -cs) main" > /etc/apt/sources.list.d/nodesource.list \ | ||
&& echo "deb-src https://deb.nodesource.com/node_16.x $(lsb_release -cs) main" >> /etc/apt/sources.list.d/nodesource.list \ | ||
&& apt-get update \ | ||
&& apt-cache policy docker-ce \ | ||
&& apt-get install -y --no-install-recommends docker-ce nodejs \ | ||
&& update-alternatives --remove python /usr/bin/python2 \ | ||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \ | ||
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN usermod -aG docker jenkins | ||
|
||
RUN pip install --no-cache-dir pbr devpi-client | ||
|
||
COPY 010_jenkins-nopasswd /etc/sudoers.d/ | ||
|
||
USER jenkins |
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 @@ | ||
customized jenkins slave container |