mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
commit
9b33e46ddb
49
.gitlab-ci.yml
Normal file
49
.gitlab-ci.yml
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
image: docker:stable
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker:stable-dind
|
||||||
|
|
||||||
|
workflow:
|
||||||
|
rules:
|
||||||
|
- if: $CI_MERGE_REQUEST_ID
|
||||||
|
- if: $CI_COMMIT_BRANCH
|
||||||
|
|
||||||
|
build-and-test:
|
||||||
|
script:
|
||||||
|
- >
|
||||||
|
if [ -n "$CI_MERGE_REQUEST_ID" ]; then
|
||||||
|
MR_ARGS="--build-arg REPO_URL=$CI_MERGE_REQUEST_SOURCE_PROJECT_URL" ;
|
||||||
|
MR_ARGS="$MR_ARGS --build-arg REPO_BRANCH=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" ;
|
||||||
|
export MR_ARGS ;
|
||||||
|
fi
|
||||||
|
- mkdir Dockercontext
|
||||||
|
- >
|
||||||
|
docker build -t retroshare:testing $MR_ARGS
|
||||||
|
--file $CI_PROJECT_DIR/build_scripts/GitlabCI/gitlabCI.Dockerfile
|
||||||
|
Dockercontext
|
||||||
|
- >
|
||||||
|
docker run --name retroshare --detach --tty retroshare:testing
|
||||||
|
retroshare-service --jsonApiPort 9092
|
||||||
|
- apk add jq
|
||||||
|
- >
|
||||||
|
docker exec retroshare
|
||||||
|
curl --verbose http://127.0.0.1:9092/rsJsonApi/version | jq
|
||||||
|
- >
|
||||||
|
docker exec retroshare
|
||||||
|
curl --verbose http://127.0.0.1:9092/rsLoginHelper/getLocations | jq
|
||||||
|
- >
|
||||||
|
docker exec retroshare
|
||||||
|
curl --verbose --data
|
||||||
|
'{ "location":{ "mLocationName":"Test 1", "mPgpName":"Test2" },
|
||||||
|
"password":"Test 3", "caller_data":"Test 5" }'
|
||||||
|
http://127.0.0.1:9092/rsLoginHelper/createLocation | jq
|
||||||
|
- >
|
||||||
|
docker exec retroshare
|
||||||
|
curl --verbose http://127.0.0.1:9092/rsLoginHelper/getLocations | jq
|
||||||
|
- >
|
||||||
|
docker exec retroshare
|
||||||
|
curl --verbose http://127.0.0.1:9092/rsLoginHelper/isLoggedIn | jq
|
||||||
|
- >
|
||||||
|
docker exec retroshare
|
||||||
|
curl --verbose http://127.0.0.1:9092/rsMsgs/getChatLobbyList | jq
|
||||||
|
- docker container stop retroshare
|
@ -9,6 +9,7 @@ RetroShare provides file sharing, chat, messages, forums, channels and more.
|
|||||||
|
|
||||||
.Build Status
|
.Build Status
|
||||||
|===============================================================================
|
|===============================================================================
|
||||||
|
|GNU/Linux (via Gitlab CI) | image:https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/RetroShare/-/commits/master",title="pipeline status"]
|
||||||
|GNU/Linux, macOS, (via Travis CI) | image:https://travis-ci.org/RetroShare/RetroShare.svg?branch=master[link="https://travis-ci.org/RetroShare/RetroShare"]
|
|GNU/Linux, macOS, (via Travis CI) | image:https://travis-ci.org/RetroShare/RetroShare.svg?branch=master[link="https://travis-ci.org/RetroShare/RetroShare"]
|
||||||
|Windows (via AppVeyor) | image:https://ci.appveyor.com/api/projects/status/github/RetroShare/RetroShare?svg=true[link="https://ci.appveyor.com/project/RetroShare58622/retroshare"]
|
|Windows (via AppVeyor) | image:https://ci.appveyor.com/api/projects/status/github/RetroShare/RetroShare?svg=true[link="https://ci.appveyor.com/project/RetroShare58622/retroshare"]
|
||||||
|===============================================================================
|
|===============================================================================
|
||||||
|
43
build_scripts/GitlabCI/base.Dockerfile
Normal file
43
build_scripts/GitlabCI/base.Dockerfile
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
## Add +--build-arg FRESHCLONE=$(date +%s)+ to docker build commandline to
|
||||||
|
## force cloning a new
|
||||||
|
|
||||||
|
## To prepare an image suitable as base for Gitlab CI use
|
||||||
|
# docker build -t "${CI_REGISTRY_IMAGE}:base" --build-arg KEEP_SOURCE=true --build-arg REPO_DEPTH="" -f base.Dockerfile .
|
||||||
|
|
||||||
|
## Now you need to tag it so you can later push it
|
||||||
|
# docker tag ${ID_OF_THE_CREATED_IMAGE} registry.gitlab.com/retroshare/${CI_REGISTRY_IMAGE}:base
|
||||||
|
|
||||||
|
## To push it to gitlab CI registry you need first to login and the to push
|
||||||
|
# docker login registry.gitlab.com
|
||||||
|
# docker push registry.gitlab.com/retroshare/${CI_REGISTRY_IMAGE}:base
|
||||||
|
|
||||||
|
|
||||||
|
## To run the container
|
||||||
|
# docker run -it -p 127.0.0.1:9092:9092 "${CI_REGISTRY_IMAGE}:base" retroshare-service --jsonApiPort 9092 --jsonApiBindAddress 0.0.0.0
|
||||||
|
|
||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
ARG CACHEBUST=0
|
||||||
|
RUN \
|
||||||
|
apt-get update -y && apt-get upgrade -y && \
|
||||||
|
apt-get install -y build-essential libssl-dev libbz2-dev libsqlite3-dev \
|
||||||
|
libsqlcipher-dev libupnp-dev pkg-config libz-dev \
|
||||||
|
qt5-default libxapian-dev qttools5-dev doxygen rapidjson-dev \
|
||||||
|
git cmake curl
|
||||||
|
|
||||||
|
ARG FRESHCLONE=0
|
||||||
|
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
|
||||||
|
ARG REPO_BRANCH=master
|
||||||
|
ARG REPO_DEPTH="--depth 2000"
|
||||||
|
ARG KEEP_SOURCE=false
|
||||||
|
RUN apt-get update -y && apt-get upgrade -y
|
||||||
|
RUN git clone $REPO_DEPTH $REPO_URL -b $REPO_BRANCH && cd RetroShare && \
|
||||||
|
git fetch --tags && cd ..
|
||||||
|
RUN \
|
||||||
|
mkdir RetroShare-build && cd RetroShare-build && \
|
||||||
|
qmake ../RetroShare \
|
||||||
|
CONFIG+=no_retroshare_plugins CONFIG+=ipv6 \
|
||||||
|
CONFIG+=retroshare_service CONFIG+=no_retroshare_gui \
|
||||||
|
CONFIG+=rs_jsonapi CONFIG+=rs_deep_search && \
|
||||||
|
(make -j$(nproc) || make -j$(nproc) || make) && make install && \
|
||||||
|
cd .. && rm -rf RetroShare-build && ($KEEP_SOURCE || rm -rf RetroShare)
|
17
build_scripts/GitlabCI/gitlabCI.Dockerfile
Normal file
17
build_scripts/GitlabCI/gitlabCI.Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
FROM registry.gitlab.com/retroshare/retroshare:base
|
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get upgrade -y
|
||||||
|
|
||||||
|
ARG REPO_URL=https://gitlab.com/RetroShare/RetroShare.git
|
||||||
|
ARG REPO_BRANCH=master
|
||||||
|
RUN \
|
||||||
|
cd RetroShare && git remote add testing $REPO_URL && \
|
||||||
|
git fetch --tags testing $REPO_BRANCH && \
|
||||||
|
git reset --hard testing/$REPO_BRANCH
|
||||||
|
RUN \
|
||||||
|
mkdir RetroShare-build && cd RetroShare-build && \
|
||||||
|
qmake ../RetroShare CONFIG+=no_retroshare_gui \
|
||||||
|
CONFIG+=retroshare_service \
|
||||||
|
CONFIG+=rs_jsonapi CONFIG+=rs_deep_search && \
|
||||||
|
(make -j$(nproc) || make -j$(nproc) || make) && make install && \
|
||||||
|
cd .. && rm -rf RetroShare-build
|
@ -313,7 +313,8 @@ extern RsAccounts* rsAccounts;
|
|||||||
class RsLoginHelper
|
class RsLoginHelper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RsLoginHelper() {}
|
RsLoginHelper() = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Normal way to attempt login
|
* @brief Normal way to attempt login
|
||||||
* @jsonapi{development,manualwrapper}
|
* @jsonapi{development,manualwrapper}
|
||||||
|
Loading…
Reference in New Issue
Block a user