diff --git a/ci/.gitignore b/ci/.gitignore new file mode 100644 index 00000000..eee2fe74 --- /dev/null +++ b/ci/.gitignore @@ -0,0 +1 @@ +jenkins/ \ No newline at end of file diff --git a/ci/casc/jenkins.yaml b/ci/casc/jenkins.yaml index 3f6669c8..7a26a1c6 100644 --- a/ci/casc/jenkins.yaml +++ b/ci/casc/jenkins.yaml @@ -2,12 +2,14 @@ credentials: system: domainCredentials: - credentials: - - usernamePassword: - description: "vagrant" - id: "vagrant" - password: "vagrant" + - basicSSHUserPrivateKey: + id: "ssh_id" + privateKeySource: + directEntry: + privateKey: "${readFile:/tmp/id_ed25519}" scope: GLOBAL - username: "vagrant" + username: "root" + jenkins: labelAtoms: - name: "build" @@ -17,8 +19,8 @@ jenkins: labelString: "build" launcher: ssh: - credentialsId: "vagrant" - host: "172.17.0.1" + credentialsId: "ssh_id" + host: "builder" port: 22 sshHostKeyVerificationStrategy: "nonVerifyingKeyVerificationStrategy" name: "build" diff --git a/ci/docker-compose.yml b/ci/docker-compose.yml index 844eea2c..367e61c4 100644 --- a/ci/docker-compose.yml +++ b/ci/docker-compose.yml @@ -9,10 +9,11 @@ services: - 8080:8080 container_name: jenkins volumes: - - ~/jenkins:/var/jenkins_home - - /var/run/docker.sock:/var/run/docker.sock - - /usr/local/bin/docker:/usr/local/bin/docker - - /home/vagrant/project/ci/casc:/var/casc/ + - ./jenkins:/var/jenkins_home + # - /var/run/docker.sock:/var/run/docker.sock + # - /usr/local/bin/docker:/usr/local/bin/docker + - ./casc:/var/casc/ + - ./id_ed25519:/tmp/id_ed25519 environment: JAVA_OPTS: -Djenkins.install.runSetupWizard=false JENKINS_OPTS: --argumentsRealm.roles.user=admin --argumentsRealm.passwd.admin=admin --argumentsRealm.roles.admin=admin # bad idea, this is to ease up the setup @@ -23,12 +24,20 @@ services: ports: - "3000:3000" volumes: - - ~/grafana:/var/lib/grafana/ + - ./grafana:/var/lib/grafana/ restart: unless-stopped influxdb: image: influxdb:1.8.10 ports: - "8086:8086" volumes: - - ~/influxdb:/var/lib/influxdb/ - restart: always \ No newline at end of file + - ./influxdb:/var/lib/influxdb/ + restart: always + + builder: + build: + context: . + dockerfile: ./go-docker + restart: unless-stopped + ports: + - "9000:22" diff --git a/ci/go-docker b/ci/go-docker new file mode 100644 index 00000000..14243d37 --- /dev/null +++ b/ci/go-docker @@ -0,0 +1,15 @@ +FROM golang:1.20 + +USER root + +RUN apt-get update +RUN apt-get install -y openssh-server default-jre +RUN apt-get clean +RUN service ssh start + +COPY ./id_ed25519.pub /root/.ssh/ +RUN cp /root/.ssh/id_ed25519.pub /root/.ssh/authorized_keys + +EXPOSE 22 + +ENTRYPOINT ["/usr/sbin/sshd", "-D"] \ No newline at end of file diff --git a/ci/id_ed25519 b/ci/id_ed25519 new file mode 100644 index 00000000..6b6116a5 --- /dev/null +++ b/ci/id_ed25519 @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACAjFPPtqRP/wrxiEBQCIlWICWqmV9JeBirun6ufjX0WxQAAAJhlV1SZZVdU +mQAAAAtzc2gtZWQyNTUxOQAAACAjFPPtqRP/wrxiEBQCIlWICWqmV9JeBirun6ufjX0WxQ +AAAEDMajuuf3mGTbhwZ+tGmVea4r1f6YAZOF2XL08OBG5RaSMU8+2pE//CvGIQFAIiVYgJ +aqZX0l4GKu6fq5+NfRbFAAAADm5pa2xhc2hAZmVkb3JhAQIDBAUGBw== +-----END OPENSSH PRIVATE KEY----- diff --git a/ci/id_ed25519.pub b/ci/id_ed25519.pub new file mode 100644 index 00000000..20a34f87 --- /dev/null +++ b/ci/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICMU8+2pE//CvGIQFAIiVYgJaqZX0l4GKu6fq5+NfRbF