Skip to content

Instantly share code, notes, and snippets.

View HokieGeek's full-sized avatar

Andrés Pérez HokieGeek

View GitHub Profile
package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
package main
import (
"fmt"
"os"
"strings"
"git.sr.ht/~hokiegeek/htmlscrape"
)
@HokieGeek
HokieGeek / nexus-helm.Dockerfile
Last active January 13, 2020 19:44
Build an instance of Nexus 3 with helm support
FROM maven:3-jdk-8 AS helmkar
ADD https://github.com/sonatype-nexus-community/nexus-repository-helm/archive/master.zip nexus-repository-helm.zip
RUN unzip nexus-repository-helm.zip && cd nexus-repository-helm-master && mvn -PbuildKar clean install
FROM sonatype/nexus3
COPY --from=helmkar nexus-repository-helm-master/target/*.kar $NEXUS_HOME/deploy
@HokieGeek
HokieGeek / downloadNexusIqPdfs.go
Last active January 10, 2020 18:56
Simple app that downloads all of the PDFs in Nexus IQ
package main
import (
"flag"
"fmt"
"io"
"net/http"
"os"
nexusiq "github.com/sonatype-nexus-community/gonexus/iq"
#!/bin/sh
sudo curl -L "https://github.com/overhangio/tutor/releases/download/v3.9.0/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor && \
sudo chmod 0755 /usr/local/bin/tutor && \
tutor local quickstart && \
sudo yum -y install mariadb-devel
#!/bin/sh
sudo yum install -y docker && sudo usermod -a -G docker ec2-user && sudo systemctl enable docker && sudo systemctl restart docker
@HokieGeek
HokieGeek / downloadUrls.go
Created October 8, 2019 14:09
Example of getting download URLs of all components in a given repo in Nexus Repository
package main
import (
"fmt"
"os"
"strings"
"github.com/sonatype-nexus-community/gonexus/rm"
)
@HokieGeek
HokieGeek / lc_ant.xml
Created September 30, 2019 15:00
Ant task to run Nexus Lifecycle
<property name="nexus-lifecycle-cli"
location="/path/to/nexus-iq-cli.jar"/>
<target name="lifecycle_evaluation">
<exec executable="${nexus-lifecycle-cli}">
<arg value="-s"/>
<arg value="http://IQSERVER_HOST:IQSERVER_PORT"/>
<arg value="-a"/>
<arg value="USERNAME:PASSWORD"/>
<arg value="-t"/>
<arg value="STAGE"/>
ARG IQ_VERSION=1.71.0-01
FROM openjdk:8u212-jdk-windowsservercore
RUN mkdir -p C:\\scan
VOLUME C:\\scan
ADD https://download.sonatype.com/clm/scanner/nexus-iq-cli-${IQ_VERSION}.jar C:\\app\\nexus-iq-cli.jar
FROM ubuntu:bionic
RUN echo 'deb http://admin:admin123@localhost:8081/repository/ubuntu-updates bionic-updates main' > /etc/apt/sources.list && \
echo 'deb http://admin:admin123@localhost:8081/repository/ubuntu bionic main' >> /etc/apt/sources.list
RUN apt-get update && apt-get -y dist-upgrade