- Metabase OS X App
- Prereqs
- Fetch and initialize git submodule
- Install libcurl (needed by WWW::Curl::Simple (I think))
- The new version of LLVM is snippy so have CPAN pass compiler flags to fix errors
- (Make sure this file exists first. If you didn't upgrade Perl in the step above,
- it might be in a different location; perhaps called "Config.pm".
- You may need to run "cpan" (no arguments) to generate an appropriate initial config.
- As above, you can go with the defaults).
- Install Perl modules used by ./bin/osx-setup and ./bin/osx-release
- You may have to run this as sudo if you didn't upgrade perl as described in step above
- Fix script not using updated version of Perl (this is fixed in master as of August 4th 2016)
- Copy JRE and uberjar
Metabase OS X App
Prereqs
-
Install XCode.
-
Run
./bin/build
to build the latest version of the uberjar. -
Update Perl. I'm not sure these steps are actually needed, so feel free to try skipping it and come back to it if it fails:
# Upgrade Perl
brew install perl
# Add new version of perl to your $PATH
# (replace "5.24.0_1" below with whatever version you installed)
echo 'export PATH="/usr/local/Cellar/perl/5.24.0_1/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
# Double-check that we're using the newer version of CPAN
# (If this is your first time running CPAN, use the default config settings when prompted)
cpan --version # You should see a line like "running under Perl version 5.24.0."
-
Next, you'll need to run the following commands before building the app:
Fetch and initialize git submodule
git submodule update --init
Install libcurl (needed by WWW::Curl::Simple (I think))
brew install curl && brew link curl --force
The new version of LLVM is snippy so have CPAN pass compiler flags to fix errors
(Make sure this file exists first. If you didn't upgrade Perl in the step above,
it might be in a different location; perhaps called "Config.pm".
You may need to run "cpan" (no arguments) to generate an appropriate initial config.
As above, you can go with the defaults).
sed -i '' -e "s/'make_arg' => q[]/'make_arg' => q[CCFLAGS="-Wno-return-type"]/" ~/.cpan/CPAN/MyConfig.pm
Install Perl modules used by ./bin/osx-setup and ./bin/osx-release
You may have to run this as sudo if you didn't upgrade perl as described in step above
cpan install File::Copy::Recursive JSON Readonly String::Util Text::Caml WWW::Curl::Simple
Fix script not using updated version of Perl (this is fixed in master as of August 4th 2016)
sed -i '' -e 's!usr/bin/perl!usr/bin/env perl!' ./bin/osx-setup
Copy JRE and uberjar
./bin/osx-setup
`./bin/osx-setup` will build run commands to build the uberjar for you if needed.
Run `./bin/osx-setup` again at any time in the future to copy the latest version of the uberjar into the project.
## Releasing
A handy Perl script called `./bin/osx-release` takes care of all of the details for you. Before you run it for the first time, you'll need to set up a few additional things:
```bash
# Install aws command-line client (if needed)
brew install awscli
# Configure AWS Credentials
# You'll need credentials that give you permission to write the metabase-osx-releases S3 bucket.
# You just need the access key ID and secret key; use the defaults for locale and other options.
aws configure --profile metabase
# Copy & Edit Config file
cp bin/config.json.template bin/config.json
emacs bin/config.json
# Obtain a copy of the private key used for signing the app (ask Cam)
# and put a copy of it at ./dsa_priv.pem
cp /path/to/private/key.pem OSX/dsa_priv.pem
# Fix script not using updated version of Perl (this is fixed in master as of August 4th 2016)
sed -i '' -e 's!usr/bin/perl!usr/bin/env perl!' ./bin/osx-release
You'll probably also want an Apple Developer ID Application Certificate in your computer's keychain (ask Cam).
After that, you are good to go:
# Bundle entire app, and upload to s3
./bin/osx-release