Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile revel project without revel command-cli #1065

Closed
mageddo opened this issue Jun 8, 2016 · 17 comments
Closed

Compile revel project without revel command-cli #1065

mageddo opened this issue Jun 8, 2016 · 17 comments
Labels
type-support not actionable, recommend StackOverflow

Comments

@mageddo
Copy link

mageddo commented Jun 8, 2016

Is possible build and package revel project only with the go command?

@jeevatkm jeevatkm added type-support not actionable, recommend StackOverflow question labels Jun 8, 2016
@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 8, 2016

No, please use revel build or revel package.

@mageddo
Copy link
Author

mageddo commented Jun 9, 2016

@jeevatkm Ok, the problem is that this build generate some files that are not compiled, is there anyway of compile everything inside the binary file?

@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 9, 2016

I couldn't understand.

build generate some files that are not compiled

Can you please explain in detail, what is the issue you're facing?

@mageddo
Copy link
Author

mageddo commented Jun 9, 2016

Of course, for example the chat

When I run

$ revel build github.com/revel/samples/chat /tmp/chat-build prod

It generates the folow tree. This way my source code is exposed to the final user, I want that all files be compiled to the binary and no one source file be exposed, do you understand?

.
├── chat
├── run.bat
├── run.sh
└── src
    └── github.com
        └── revel
            ├── modules
            │   ├── static
            │   │   └── app
            │   │       └── controllers
            │   │           └── static.go
            │   └── testrunner
            │       ├── app
            │       │   ├── controllers
            │       │   │   └── testrunner.go
            │       │   ├── plugin.go
            │       │   └── views
            │       │       └── TestRunner
            │       │           ├── FailureDetail.html
            │       │           ├── Index.html
            │       │           └── SuiteResult.html
            │       ├── conf
            │       │   └── routes
            │       └── public
            │           ├── css
            │           │   ├── bootstrap.min.css
            │           │   └── github.css
            │           ├── images
            │           │   └── favicon.png
            │           └── js
            │               ├── bootstrap.min.js
            │               ├── highlight.pack.js
            │               └── jquery-1.9.1.min.js
            ├── revel
            │   ├── conf
            │   │   └── mime-types.conf
            │   └── templates
            │       └── errors
            │           ├── 403.html
            │           ├── 403.json
            │           ├── 403.txt
            │           ├── 403.xml
            │           ├── 404-dev.html
            │           ├── 404.html
            │           ├── 404.json
            │           ├── 404.txt
            │           ├── 404.xml
            │           ├── 405.html
            │           ├── 405.json
            │           ├── 405.txt
            │           ├── 405.xml
            │           ├── 500-dev.html
            │           ├── 500.html
            │           ├── 500.json
            │           ├── 500.txt
            │           └── 500.xml
            └── samples
                └── chat
                    ├── app
                    │   ├── chatroom
                    │   │   └── chatroom.go
                    │   ├── controllers
                    │   │   ├── app.go
                    │   │   ├── longpolling.go
                    │   │   ├── refresh.go
                    │   │   └── websocket.go
                    │   ├── routes
                    │   │   └── routes.go
                    │   ├── tmp
                    │   │   └── main.go
                    │   └── views
                    │       ├── Application
                    │       │   └── Index.html
                    │       ├── footer.html
                    │       ├── header.html
                    │       ├── LongPolling
                    │       │   └── Room.html
                    │       ├── Refresh
                    │       │   └── Room.html
                    │       └── WebSocket
                    │           └── Room.html
                    ├── conf
                    │   ├── app.conf
                    │   └── routes
                    ├── public
                    │   ├── images
                    │   │   └── favicon.png
                    │   ├── javascripts
                    │   │   ├── jquery-1.5.min.js
                    │   │   ├── jquery.scrollTo-min.js
                    │   │   └── templating.js
                    │   └── stylesheets
                    │       └── main.css
                    └── tests
                        └── apptest.go

@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 9, 2016

okay, I get it. So you want to exclude the src from archive correct?

@mageddo
Copy link
Author

mageddo commented Jun 9, 2016

yes.. but I can't because it causes error for today

@mageddo
Copy link
Author

mageddo commented Jun 9, 2016

The static files like .css, .html and .json can be on the src directory, not matter, the problem are only with the .go files, I can not leave they there

@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 9, 2016

I understand. Actually, exclude feature is currently not exists.

Can you please create an issue here with feature description for revel package command?

@mageddo
Copy link
Author

mageddo commented Jun 9, 2016

Of course @jeevatkm, thanks

@ptman
Copy link
Contributor

ptman commented Jun 9, 2016

In the meantime, I do something like this to filter the files I don't want out from my archives:

gunzip < project.tar.gz | tar --wildcards --delete '*.go' src/$package/tests src/$package/doc | gzip > project-small.tar.gz

@jeevatkm
Copy link
Contributor

jeevatkm commented Jun 9, 2016

@mageddo please create an issue at revel/cmd with detailed description for package command.

I'm closing this one.

@mageddo
Copy link
Author

mageddo commented Jun 10, 2016

@jeevatkm I've created the issue

@mageddo
Copy link
Author

mageddo commented Jun 10, 2016

Many thanks @ptman, so are the .go files not needed on this folder? They are generated only by convection?

@ptman
Copy link
Contributor

ptman commented Jun 10, 2016

@mageddo well, we've had a production service running for almost a year running in a docker container without those .go files so I'm fairly confident that it works. They are just used when compiling the binary. I assume the archive contains the files because all of app/ is just copied there.

@mageddo
Copy link
Author

mageddo commented Jun 10, 2016

@ptman Good, your command will be useful while the feature request is not developed.

@brendensoares
Copy link
Member

brendensoares commented Jul 29, 2016

Just a note, you can delete most of what is included in archives (as alluded to here). The only files that are needed are used at runtime (go source files are not used at runtime.

@mageddo
Copy link
Author

mageddo commented Jul 29, 2016

@brendensoares Good pointer. Later I understood it, at principle I think that the are used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-support not actionable, recommend StackOverflow
Projects
None yet
Development

No branches or pull requests

4 participants