From 7b7d70668130330660364d2088ee7ca02da21537 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Sat, 20 Nov 2021 22:08:05 +0000 Subject: [PATCH] Move to GitLab --- .../.github}/workflows/build.yml | 0 .../.github}/workflows/issues.yml | 0 .../renovate.json | 0 .gitlab-ci.yml | 63 +++++++++++++++++++ README.md | 3 + 5 files changed, 66 insertions(+) rename {.github => .github-archive/.github}/workflows/build.yml (100%) rename {.github => .github-archive/.github}/workflows/issues.yml (100%) rename renovate.json => .github-archive/renovate.json (100%) create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/build.yml b/.github-archive/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml rename to .github-archive/.github/workflows/build.yml diff --git a/.github/workflows/issues.yml b/.github-archive/.github/workflows/issues.yml similarity index 100% rename from .github/workflows/issues.yml rename to .github-archive/.github/workflows/issues.yml diff --git a/renovate.json b/.github-archive/renovate.json similarity index 100% rename from renovate.json rename to .github-archive/renovate.json diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..80b8f46 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,63 @@ +stages: + - build-docker + - build-binary + - upload + - release + +build-docker: + stage: build-docker + only: + - tags + image: docker:19.03.12 + services: + - docker:19.03.12-dind + variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG + script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - docker build -t $CI_REGISTRY_IMAGE:latest -t $IMAGE_TAG . + - docker build -t $IMAGE_TAG -t $CI_REGISTRY_IMAGE:latest . + - docker push $IMAGE_TAG + - docker push $CI_REGISTRY_IMAGE:latest + +build-binary: + stage: build-binary + image: golang:1.17.3 + before_script: + - cd $GOPATH/src + - mkdir -p gitlab.com/$CI_PROJECT_NAMESPACE + - cd gitlab.com/$CI_PROJECT_NAMESPACE + - ln -s $CI_PROJECT_DIR + - cd $CI_PROJECT_NAME + script: + - CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -o iPilot-${CI_COMMIT_TAG}-darwin-amd64 + - CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin go build -o iPilot-${CI_COMMIT_TAG}-darwin-arm64 + - CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o iPilot-${CI_COMMIT_TAG}-linux-amd64 + - CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o iPilot-${CI_COMMIT_TAG}-win-amd64.exe + - CGO_ENABLED=0 GOARCH=386 GOOS=windows go build -o iPilot-${CI_COMMIT_TAG}-win-x86.exe + +upload: + stage: upload + image: curlimages/curl:latest + rules: + - if: $CI_COMMIT_TAG + script: + - curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-darwin-amd64 ${PACKAGE_REGISTRY_URL} + - curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-darwin-arm64 ${PACKAGE_REGISTRY_URL} + - curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-linux-amd64 ${PACKAGE_REGISTRY_URL} + - curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-win-amd64.exe ${PACKAGE_REGISTRY_URL} + - curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file iPilot-${CI_COMMIT_TAG}-win-x86.exe ${PACKAGE_REGISTRY_URL} + +release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:v0.4.0 + rules: + - if: $CI_COMMIT_TAG + script: + - | + release-cli create --name "$CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \ + --assets-link "{\"name\":\"iPilot-${CI_COMMIT_TAG}-darwin-amd64\",\"url\":\"iPilot-${CI_COMMIT_TAG}-darwin-amd64\"}" \ + --assets-link "{\"name\":\"iPilot-${CI_COMMIT_TAG}-darwin-arm64\",\"url\":\"iPilot-${CI_COMMIT_TAG}-darwin-arm64\"}" \ + --assets-link "{\"name\":\"iPilot-${CI_COMMIT_TAG}-linux-amd64\",\"url\":\"iPilot-${CI_COMMIT_TAG}-linux-amd64\"}" \ + --assets-link "{\"name\":\"iPilot-${CI_COMMIT_TAG}-win-amd64.exe\",\"url\":\"iPilot-${CI_COMMIT_TAG}-win-amd64.exe\"}" \ + --assets-link "{\"name\":\"iPilot-${CI_COMMIT_TAG}-win-x86.exe\",\"url\":\"iPilot-${CI_COMMIT_TAG}-win-x86.exe\"}" diff --git a/README.md b/README.md index 12fcb3f..872c8b0 100644 --- a/README.md +++ b/README.md @@ -16,5 +16,8 @@ Here are some ways that you can run the script: | `./iPilot -i google.com` | Run against the domain name `google.com` | | `./iPilot -i google.com -p` | Run against the domain name `google.com` and lists BGP prefixes | +## Support +For support please open an issue on [GitLab](https://gitlab.com/luketainton/iPilot) or email [ipilot@help.tainton.uk](mailto:ipilot@help.tainton.uk). + ## Credits This script runs thanks to the APIs provided by [IP-API](http://ip-api.com) and [HackerTarget](https://hackertarget.com/as-ip-lookup).