Skip to content

Commit 3225073

Browse files
authored
Merge pull request #17 from Clever/test-gh-release
Test gh release
2 parents 15992b2 + fc814d4 commit 3225073

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,12 @@ Runs [report-card](https://github.com/clever/report-card).
5050
```
5151
$ ./circleci/report-card [DOCKER_USER] [DOCKER_PASS] [DOCKER_EMAIL] [GITHUB_TOKEN]
5252
```
53+
54+
### Mongo install (version 2.4 only)
55+
56+
Installs Mongo version 2.4, rather than the default version in CircleCI.
57+
At time of writing, `v3.0.7` was default version in [Ubuntu 14.04 (Trusty) image](https://circleci.com/docs/build-image-trusty/#mongodb).
58+
59+
```
60+
$ ./circleci/mongo-install-2.4
61+
```

circle.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
test:
2+
override:
3+
# do a github release to this repo, using the commit SHA
4+
- mkdir artifacts
5+
- echo "foo" > artifacts/foo.txt
6+
- echo "${CIRCLE_SHA1:0:7}" > VERSION
7+
- ./circleci/mongo-install-2.4
8+
- ./circleci/github-release $GH_RELEASE_TOKEN artifacts/

circleci/github-release

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ echo "Downloading github-release tool"
2828
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
2929
tar jxf /tmp/github-release.tar.bz2 -C /tmp/ && sudo mv /tmp/bin/linux/amd64/github-release /usr/local/bin/github-release
3030

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

circleci/mongo-install-2.4

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
# Installs Mongo 2.4, rather than the default version in CircleCI.
4+
#
5+
# Usage:
6+
#
7+
# mongo-install-2.4
8+
9+
set -e
10+
11+
echo "Stopping and removing currently installed Mongodb..."
12+
# the service running Mongo 3.x is `mongod` vs `mongodb` in 2.4
13+
sudo service mongod stop
14+
sudo apt-get purge mongodb-org*
15+
16+
echo "Attempting to download Mongo version 2.4.14 ..."
17+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
18+
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
19+
sudo apt-get update
20+
sudo apt-get install -y mongodb-10gen=2.4.14
21+
22+
echo "Restarting new version of Mongodb..."
23+
sudo service mongodb restart
24+
mongo --version
25+
26+
echo "Mongo 2.4.14 installed successfully"

0 commit comments

Comments
 (0)