adamwalach / openvpn-web-ui

Web interface (with golang backend) for monitoring and administration of OpenVPN server
MIT License
673 stars 274 forks source link

Purpose of build/pack.sh #37

Open bnhf opened 2 years ago

bnhf commented 2 years ago

Can anyone enlighten me on what the build/pack.sh script does? I'm including it below:

#!/bin/bash

set -e

time docker run \
    -v "$PWD/../":/go/src/github.com/bnhf/openvpn-tap-external-web-ui \
    --rm \
    -w /usr/src/myapp \
    tyzbit/beego:1.9.4 \
    sh -c "cd /go/src/github.com/bnhf/openvpn-tap-external-web-ui/ && bee version && bee pack -exr='^vendor|^data.db|^build|^README.md|^docs'"
cd github.com

Thanks!

bnhf commented 2 years ago

Can anyone enlighten me on what the build/pack.sh script does? I'm including it below:

#!/bin/bash

set -e

time docker run \
    -v "$PWD/../":/go/src/github.com/bnhf/openvpn-tap-external-web-ui \
    --rm \
    -w /usr/src/myapp \
    tyzbit/beego:1.9.4 \
    sh -c "cd /go/src/github.com/bnhf/openvpn-tap-external-web-ui/ && bee version && bee pack -exr='^vendor|^data.db|^build|^README.md|^docs'"
cd github.com

Thanks!

Answering my own question here, as I corresponded with @tyzbit who's version of this repository I forked. The pack.sh script is intended to create the tar.gz archive used in the Docker build. It makes sense that this is the purpose, as I had to figure out what was needed, in addition to the executable created by "bee run", by looking in @tyzbit's container.

The script is doing this using a Beego Docker container with the 1.9.4 version of Beego. This may not be necessary however, as the web-ui appears to be working fine with my manual build of the archive, and it appears to also work to run just this portion of the script:

bee pack -exr='^vendor|^data.db|^build|^README.md|^docs'

from the parent directory of the repository as it exists on your local machine, e.g. openvpn-web-ui. If you want to create the archive manually, I listed the files I believe are necessary in the README.md of my fork of this project.