Skip to content

nevincoco1/snyk-onboard

 
 

Repository files navigation

Snyk Onboarding

This project aims to ease the burden of importing the many goof demo applications used to evaluate the different language support of Snyk into the different SCMs supported. Additionally, it can be used to keep your local goof environments, and their respective upstream repositories, up to date with the primary repos maintained by Snyk. This project stops short of actually onboarding each application into Snyk itself which must still be performed in the Snyk application.

For each repository listed in repolist.txt, this application does the following:

  1. Clone the repository to a local directory
  2. Add git remotes for each of the supported Git services
  3. Create a remote project repository in each of the supported Git services
  4. Push the local repository to each of the supported Git services

For Azure DevOps, the application also creates a Project to group all repos in a given Organization called Snyk.

If the application has already been run and/or some or all of the repositories in repolist.txt already exist, the application will perform the following steps for these items:

  1. Pull down and merge any upstream changes
  2. Push new changes to each of the supported Git services

Supported Git Services

  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps

Goof Applications

To see a current list of the upstream goof applications to be cloned, review the repolist.txt file in the project root. Additional repositories can be added to this list as long as they are publicly accessible.

Requirements

Docker or Golang: the application can run standalone or in the included container scope. See instructions further below for information on how to run in either case.

Getting Started

This application can be run via Docker and the included Dockerfile or by compiling the application and running it directly. It is recommended to use Docker for portability, but the application is able to determine its scope automatically.

Both steps start with cloning or downloading this repository.

Docker

Build the docker container. Be mindful to include the period at the end, it tells Docker what the current context of this build is.

docker build -t snyk-onboard .

Run the Docker container. Specify the host directory where you want the goof repos to be cloned to:

docker run -it --rm --user $(id -u):$(id -g) -v /tmp/repos:/repos snyk-onboard

In this example above, all the repositories will be downloaded to /tmp/repos. You could also use any other path or even variables or subshells to be more dynamic such as ~/Desktop/Snyk or $(PWD)/repos. You might have to manually create the folder first or else you might see permission problems from Docker.

Golang

If you have Golang installed, you can run the application natively. Ensure you are running a newer versions of Golang that is using Go Modules by default (1.13 and up.)

go get
go build -o snyk-onboard
./snyk-onboard

Running the application standalone will create a directory wherever you run it called repos that will contain all the downloaded goof repositories.

Configuration

When the application launches for the first time, you will be prompted to enter configuration values to be used for the creation process of the remote repos. Before you run the application, it is recommended you prepare the following information before running the app:

These tokens will be saved for future use in the repos folder in a file called .config.yaml. This file can be removed to run through setup again or edited directly to alter values.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.2%
  • Dockerfile 0.8%