-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of gitlab.ricebook.net:platform/core
- Loading branch information
Showing
5 changed files
with
67 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,50 +5,31 @@ Core | |
We use v0.23.4 because v0.24 sucks | ||
|
||
```shell | ||
$ wget https://github.com/libgit2/libgit2/archive/v0.23.4.zip | ||
$ unzip v0.23.4.zip | ||
cp devtools/libgit2.rb.patch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula | ||
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula | ||
git apply libgit2.rb.patch && git add libgit2.rb && git commit -m "patch libgit2 version for eru-core" && rm libgit2.rb.patch | ||
cd - | ||
``` | ||
Install dependencies: `libssh2`, `http-parser`, `cmake`, `libcurl`. | ||
|
||
```shell | ||
On Mac OSX: | ||
$ brew install libssh2 http-parser cmake libcurl | ||
|
||
On CentOS: | ||
$ yum install libssh2-devel http-parser cmake libcurl-devel | ||
``` | ||
Then install libgit2. | ||
|
||
```shell | ||
$ cmake . -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DUSE_SSH=YES | ||
$ make && make install | ||
``` | ||
Note on Mac OSX may need to set CFLAGS="-std=c99". | ||
Now libgit2 is installed under `/usr/local/lib` as default. We still need to set pkg-config and link dynamic libraries. | ||
## setup dev environment | ||
|
||
```shell | ||
On Mac OSX: | ||
$ cd /usr/local/lib/pkgconfig | ||
$ ln -s /path/to/libgit2/pkgconfig/libgit2.pc libgit2.pc | ||
$ cd /usr/local/lib | ||
$ ln -s /path/to/libgit2/libgit2.23.dylib libgit2.23.dylib | ||
|
||
On CentOS: | ||
$ cd /usr/lib64/pkgconfig/ | ||
$ ln -s /usr/local/lib/pkgconfig/libgit2.pc libgit2.pc | ||
$ cd /usr/lib64 | ||
$ ln -s /usr/local/lib/libgit2.so.23 libgit2.so.23 | ||
git config --global url."[email protected]:".insteadOf "https://gitlab.ricebook.net/" | ||
go get gitlab.ricebook.net/platform/core.git | ||
mv $GOPATH/src/gitlab.ricebook.net/platform/core.git $GOPATH/src/gitlab.ricebook.net/platform/core | ||
cd $GOPATH/src/gitlab.ricebook.net/platform/core | ||
make deps | ||
make build | ||
``` | ||
|
||
## setup dev environment | ||
## Upgrade core on test/production server | ||
|
||
```shell | ||
$ git config --global url."[email protected]:".insteadOf "https://gitlab.ricebook.net/" | ||
$ go get gitlab.ricebook.net/platform/core.git | ||
$ mv $GOPATH/src/gitlab.ricebook.net/platform/core.git $GOPATH/src/gitlab.ricebook.net/platform/core | ||
$ cd $GOPATH/src/gitlab.ricebook.net/platform/core && go install | ||
$ ln -s $GOPATH/src/gitlab.ricebook.net/platform/core $MY_WORK_SPACE/eru-core2 | ||
$ make deps | ||
make build | ||
# test server | ||
devtools/upgrade-eru-core.sh test eru-core | ||
# prod server | ||
devtools/upgrade-eru-core.sh | ||
``` | ||
|
||
### GRPC | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
diff --git a/Formula/libgit2.rb b/Formula/libgit2.rb | ||
index b91f4ff..45205f1 100644 | ||
--- a/Formula/libgit2.rb | ||
+++ b/Formula/libgit2.rb | ||
@@ -1,8 +1,8 @@ | ||
class Libgit2 < Formula | ||
desc "C library of Git core methods that is re-entrant and linkable" | ||
homepage "https://libgit2.github.com/" | ||
- url "https://github.com/libgit2/libgit2/archive/v0.24.2.tar.gz" | ||
- sha256 "00f0a7403143fba69601accc80cacf49becc568b890ba232f300c1b2a37475e6" | ||
+ url "https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz" | ||
+ sha256 "c7f5e2d7381dbc4d7e878013d14f9993ae8a41bd23f032718e39ffba57894029" | ||
head "https://github.com/libgit2/libgit2.git" | ||
|
||
bottle do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
ssh [email protected] -t 'sudo yum --enablerepo=ricebook clean metadata' | ||
ssh [email protected] -t 'sudo yum reinstall -y eru-core' | ||
ssh [email protected] -t 'sudo systemctl daemon-reload' | ||
ssh [email protected] -t 'sudo systemctl restart eru-core.service' | ||
ssh [email protected] -t 'sudo git --work-tree=/opt/citadel --git-dir=/opt/citadel/.git pull' | ||
ssh [email protected] -t 'sudo systemctl restart citadel' | ||
if [ $1 == "test" ]; then | ||
rsync -a /Users/timfeirg/gocode/src/gitlab.ricebook.net/platform/core sa-ricebook:~ | ||
ssh sa-ricebook -t 'sudo rm -rf /root/.go/src/gitlab.ricebook.net/platform/core' | ||
ssh sa-ricebook -t 'sudo mv ~/core /root/.go/src/gitlab.ricebook.net/platform/core' | ||
# ssh zzz1 -t 'sudo mv eru-core /usr/bin/eru-core' | ||
# ssh zzz1 -t 'sudo systemctl restart eru-core.service' | ||
else | ||
ssh [email protected] -t 'sudo yum --enablerepo=ricebook clean metadata' | ||
ssh [email protected] -t 'sudo yum reinstall -y eru-core' | ||
ssh [email protected] -t 'sudo systemctl daemon-reload' | ||
ssh [email protected] -t 'sudo systemctl restart eru-core.service' | ||
ssh [email protected] -t 'sudo git --work-tree=/opt/citadel --git-dir=/opt/citadel/.git pull' | ||
ssh [email protected] -t 'sudo systemctl restart citadel' | ||
fi |