diff --git a/Dockerfile b/Dockerfile index e69de29..d211e44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM jenkins/inbound-agent + +USER root + +RUN apt-get update ;\ + apt-get -y install lsb-release procps wget sudo git apt-transport-https ca-certificates curl gnupg2 software-properties-common + +RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg ;\ + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list ;\ + apt-get update ;\ + apt-get -y install docker-ce docker-ce-cli docker-ce-rootless-extras docker-buildx-plugin + +RUN sudo curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh ;\ + sudo bash nodesource_setup.sh ;\ + apt-get -y install nodejs \ No newline at end of file diff --git a/publish.sh b/publish.sh new file mode 100644 index 0000000..90f1eab --- /dev/null +++ b/publish.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +name="cicd/jenkins-nodejs-agent" +tag="1.0.0" +harborurl="harbor-wtkp3fsbv6.vertexa.devbay.tech" +user="'robot$jenkins'" +password="'ZrzsVIAeueW1p0alpAnPfM5CDtaRVVKz'" +echo "-------------------------------------------" +echo "login" +docker login $harborurl -u $user -p $password +echo "-------------------------------------------" +echo "build" +docker build -t $name:$tag . +echo "-------------------------------------------" +echo "tag" +echo "-------------------------------------------" +docker tag $name:$tag $harborurl/$name:$tag +echo "-------------------------------------------" +echo "push" +echo "-------------------------------------------" +docker push $harborurl/$name:$tag