Skip to content

Commit

Permalink
Merge pull request #1 from wreiske/master
Browse files Browse the repository at this point in the history
  • Loading branch information
filipenevola authored Aug 7, 2020
2 parents c82e7d1 + c24f2ec commit a11b375
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 43 deletions.
3 changes: 0 additions & 3 deletions .dockerignore

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# action.yml
name: Build Meteor Mongo from SRC

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/[email protected]
- name: Run builder
run: ./run-builder.sh
- name: Upload the artifacts
uses: skx/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: '*.tgz'
7 changes: 0 additions & 7 deletions Dockerfile

This file was deleted.

18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
# MongoDB Builder for Linux
# MongoDB Builder for Meteor Mongo using GitHub Actions

This Docker image builds MongoDB for Linux from source without OpenSSL and cURL, similar to the generic Linux packages that are [not provided anymore since MongoDB 4.2](https://www.mongodb.com/blog/post/a-proposal-to-endoflife-our-generic-linux-tar-packages).
![Build Meteor Mongo from SRC](https://github.com/meteor/mongodb-builder/workflows/Build%20Meteor%20Mongo%20from%20SRC/badge.svg)

## Building the Image
This repository automatically builds MongoDB for Linux from source without OpenSSL and cURL, similar to the generic Linux packages that are [not provided anymore since MongoDB 4.2](https://www.mongodb.com/blog/post/a-proposal-to-endoflife-our-generic-linux-tar-packages), using GitHub Actions.

```sh
docker build -t mongodb-builder .
```
## Updating Mongo and triggering a build

## Usage

The `run-builder.sh` script downloads the MongoDB source, builds `mongod` and `mongo`, and creates an archive (`mongodb-linux-x86_64-*.tgz`):

```sh
./run-builder.sh
```
Edit the `MONGODB_VERSION` variable in run-builder.sh and tag a new release. The build will trigger automatically on new releases and upload the final .tgz.
16 changes: 0 additions & 16 deletions build.sh

This file was deleted.

24 changes: 20 additions & 4 deletions run-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ TARGET="mongodb-linux-x86_64-${MONGODB_VERSION}"
BIN="$TARGET/bin"

[ ! -d $SRC ] && curl "https://fastdl.mongodb.org/src/$SRC.tar.gz" | tar -xz
docker run --rm -it -v $(pwd)/$SRC:/mongodb mongodb-builder
mkdir -p $BIN
mv "$SRC/mongo" "$SRC/mongod" $BIN
tar -czf "$TARGET.tgz" $TARGET

cd "$SRC"
pip3 install scons
pip3 install -r etc/pip/compile-requirements.txt

./buildscripts/scons.py \
mongod mongo \
--ssl=off \
--enable-free-mon=off \
LINKFLAGS='-static-libstdc++' \
CC=gcc-8 \
CXX=g++-8

strip mongo mongod

mkdir -p ../$BIN
mv "mongo" "mongod" ../$BIN
cd ../
tar -czf "$TARGET.tgz" $BIN

0 comments on commit a11b375

Please sign in to comment.