Skip to content

Commit

Permalink
Merge pull request #17 from Clever/test-gh-release
Browse files Browse the repository at this point in the history
Test gh release
  • Loading branch information
nathanleiby authored Jan 26, 2017
2 parents 15992b2 + fc814d4 commit 3225073
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,12 @@ Runs [report-card](https://github.com/clever/report-card).
```
$ ./circleci/report-card [DOCKER_USER] [DOCKER_PASS] [DOCKER_EMAIL] [GITHUB_TOKEN]
```

### Mongo install (version 2.4 only)

Installs Mongo version 2.4, rather than the default version in CircleCI.
At time of writing, `v3.0.7` was default version in [Ubuntu 14.04 (Trusty) image](https://circleci.com/docs/build-image-trusty/#mongodb).

```
$ ./circleci/mongo-install-2.4
```
8 changes: 8 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test:
override:
# do a github release to this repo, using the commit SHA
- mkdir artifacts
- echo "foo" > artifacts/foo.txt
- echo "${CIRCLE_SHA1:0:7}" > VERSION
- ./circleci/mongo-install-2.4
- ./circleci/github-release $GH_RELEASE_TOKEN artifacts/
1 change: 1 addition & 0 deletions circleci/github-release
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ echo "Downloading github-release tool"
curl -sSL -o /tmp/github-release.tar.bz2 https://github.com/aktau/github-release/releases/download/v0.5.2/linux-amd64-github-release.tar.bz2
tar jxf /tmp/github-release.tar.bz2 -C /tmp/ && sudo mv /tmp/bin/linux/amd64/github-release /usr/local/bin/github-release

echo "Publishing github-release"
TAG=$(head -n 1 VERSION)
DESCRIPTION=$(tail -n +2 VERSION)

Expand Down
26 changes: 26 additions & 0 deletions circleci/mongo-install-2.4
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Installs Mongo 2.4, rather than the default version in CircleCI.
#
# Usage:
#
# mongo-install-2.4

set -e

echo "Stopping and removing currently installed Mongodb..."
# the service running Mongo 3.x is `mongod` vs `mongodb` in 2.4
sudo service mongod stop
sudo apt-get purge mongodb-org*

echo "Attempting to download Mongo version 2.4.14 ..."
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install -y mongodb-10gen=2.4.14

echo "Restarting new version of Mongodb..."
sudo service mongodb restart
mongo --version

echo "Mongo 2.4.14 installed successfully"

0 comments on commit 3225073

Please sign in to comment.