Giter VIP home page Giter VIP logo

builder's People

Contributors

armondhonore avatar castillojuan1000 avatar donald-langston avatar ilarocca avatar jakestreet avatar justinsgardner avatar katieharris2397 avatar laurybenoit avatar nickyg56 avatar sasdeployer avatar stephanelpaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

builder's Issues

Builder Gui

Need a cross platform application GUI for builder - using something like NodeGui or Electron (I am open to options here)

I would like for this data to be displayed of basic html css and javascript => clientside meaning it doesn't need a web server running to display the content.

It should have a few of each project and be able to run a build and display all of the build metadata

builder init command location

The current builder init command clones a repo and then sticks it in a hidden directory.

This needs to change so that a builder init git_repo_url works similar to a git clone and create a folder name that matches the git project in the current directory.

We can add a param called builder init -h or --hidden. to keep it in a hidden folder. (IE this flag should use the current code in place)

New command builder push [url]

this should post a json or possibly a yaml file with all relevant build info to a specified url.

In the setting we need to enable a flag auto-push. This flag would automatically push build metadata after every build attempt.

once this is configured it should be enabled by default to true. However once it has manually been set to false it will manually need to be set back to true.

Update builder push command

Update builder push command to do the following:

  • --save flag should update the builder.yaml file with the url provided
  • --remove flag should remove the url from the builder.yaml file

builder.yaml conventions

What data is required in the builder.yaml file? How should this data be organized?

Some things we will definitely have:

exec name: the tool building the code (ex: npm, maven)

exec path: path on the user/agents machine to the exec

version: version of exec to use for the build

Builder should follow a strict folder structure when running local builds

The parent folder will be the project name. The parent folder will have a hidden, read-only folder that contains the source code of the project, a workspace folder that contains a copy of the source code along with any files/folders generated during the build process, and a (possibly hidden) log folder for all builds within the project.

Store default parameters in builder.yaml

Build a builder default feature that will allow storage of parameters in builder.yaml so we don't have to pass them to command line. If parameters are passed to command line, overwrite their values in builder.yaml file

Add section for these parameters in builder.yaml

Builder 'cp' Command not work in Windows

When we try to build a project it's not build the project as files are not copied from the .hidden directory to the workspace directory.

There are cp command is used for copy project files in utils/copyDir.go file but it's not working on the Windows platform.

https://github.com/AuditDeploy/Builder/blob/main/utils/copyDir.go#L17

Suggestion:

We can use https://github.com/otiai10/copy which provides functionality to copy files recursively independent of the platform.

Or We can use the below function which works fine on my Windows machine but not sure about other platforms. We have to test code on other platforms.

func CopyDirectory(scrDir, dest string) error {
	entries, err := ioutil.ReadDir(scrDir)
	if err != nil {
		return err
	}
	for _, entry := range entries {
		sourcePath := filepath.Join(scrDir, entry.Name())
		destPath := filepath.Join(dest, entry.Name())

		fileInfo, err := os.Stat(sourcePath)
		if err != nil {
			return err
		}

		// stat, ok := fileInfo.Sys().(*sys.Stat_t)
		// if !ok {
		// 	return fmt.Errorf("failed to get raw syscall.Stat_t data for '%s'", sourcePath)
		// }

		switch fileInfo.Mode() & os.ModeType {
		case os.ModeDir:
			if err := CreateIfNotExists(destPath, 0755); err != nil {
				return err
			}
			if err := CopyDirectory(sourcePath, destPath); err != nil {
				return err
			}
		case os.ModeSymlink:
			if err := CopySymLink(sourcePath, destPath); err != nil {
				return err
			}
		default:
			if err := Copy(sourcePath, destPath); err != nil {
				return err
			}
		}

		// if err := os.Lchown(destPath, int(stat.Uid), int(stat.Gid)); err != nil {
		// 	return err
		// }

		isSymlink := entry.Mode()&os.ModeSymlink != 0
		if !isSymlink {
			if err := os.Chmod(destPath, entry.Mode()); err != nil {
				return err
			}
		}
	}
	return nil
}

func Copy(srcFile, dstFile string) error {
	out, err := os.Create(dstFile)
	if err != nil {
		return err
	}

	defer out.Close()

	in, err := os.Open(srcFile)
	if err != nil {
		return err
	}
	defer in.Close()
	_, err = io.Copy(out, in)
	if err != nil {
		return err
	}

	return nil
}

func Exists(filePath string) bool {
	if _, err := os.Stat(filePath); os.IsNotExist(err) {
		return false
	}

	return true
}

func CreateIfNotExists(dir string, perm os.FileMode) error {
	if Exists(dir) {
		return nil
	}

	if err := os.MkdirAll(dir, perm); err != nil {
		return fmt.Errorf("failed to create directory: '%s', error: '%s'", dir, err.Error())
	}

	return nil
}

func CopySymLink(source, dest string) error {
	link, err := os.Readlink(source)
	if err != nil {
		return err
	}
	return os.Symlink(link, dest)
}

And do the below changes in the copyDir() function.

func CopyDir() {

	//copies contents of .hidden to workspace
	hiddenDir := os.Getenv("BUILDER_HIDDEN_DIR")
	workspaceDir := os.Getenv("BUILDER_WORKSPACE_DIR")
	err := CopyDirectory(hiddenDir, workspaceDir)
	if err != nil {
		log.Println("Error in copy hidden directory.")
		log.Println(err)

	}
}

Thanks

Default build and overrides

  1. If user does not provide any build specifications in builder.yaml Builder should use the default "assumed language" build command
  2. If a buildcmd is provided Builder should use it as the build command
  3. If a buildfile is provided without a buildcmd Builder should use the build file with the default build command
  4. If a buildfile and a buildcmd is provided Builder should use the build command given
  5. If a buildtool (where user is specifying make, gradle, maven, etc.) is provided, Builder should use the build steps defined for the specified tool (i.e. if "maven" or "mvn" is provided as the build tool, Builder should run the command mvn clean install)

Design plugin interface

This interface will allow for third party CLI and applications/SDK to integrate directly into Builder to remove the need to pipe or add Builder to custom scripts.

Failed to build node project on windows.

I've downloaded builder tools from your website and tried to build node project.
But it failed.

C:\Users\Administrator\Documents\builder-windows>builder.exe init https://github.com/johnpapa/node-hello
panic: assignment to entry in nil map

goroutine 1 [running]:
Builder/utils.StoreBuildMetadataLocally()
        Builder/utils/metadata.go:273 +0xfd
Builder/cmd.Init()
        Builder/cmd/init.go:42 +0x131
main.main()
        Builder/main.go:21 +0x5e

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.