Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspace
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gaia-X
Trust Services API
workspace
Commits
4ef7db90
Commit
4ef7db90
authored
3 years ago
by
Yordan Kinkov
Browse files
Options
Downloads
Plain Diff
Merge branch '4-add-setup-script' into 'main'
Resolve "Setup script" Closes
#4
See merge request
!2
parents
ffe88ddc
567ccb01
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Resolve "Setup script"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+21
-1
21 additions, 1 deletion
README.md
setup.sh
+68
-0
68 additions, 0 deletions
setup.sh
with
89 additions
and
1 deletion
README.md
+
21
−
1
View file @
4ef7db90
...
...
@@ -14,7 +14,27 @@ with environment variables which will be injected in its container.
## Setup Workspace
TODO
*
create directory:
```
mkdir -p $GOPATH/src/code.vereign.com/gaiax/tsa/
```
*
move in the previously created directory:
```
cd $GOPATH/src/code.vereign.com/gaiax/tsa/
```
*
clone the repository:
```
git clone git@code.vereign.com:gaiax/tsa/workspace.git
```
*
run the setup.sh script:
```
./setup.sh
```
*
set the services you would like to use in the docker-compose.yml file, defaults is
**infohub**
*
run docker compose:
```
docker-compose up
```
## 3rd Party Services
...
...
This diff is collapsed.
Click to expand it.
setup.sh
0 → 100755
+
68
−
0
View file @
4ef7db90
#! /bin/bash
# ------------
# IMPORTANT!
#
# This script uses an environment variable named 'email' to properly
# configure git repos upon checkout. If you don't have it set in your
# environment, the email of the git repos will be set to an empty value.
# For best experience, set the variable in your .bashrc, .zshrc, etc.
#
# export email="lyuben.penkovski@vereign.com"
# ------------
# pull the master branch of a given git repository.
# User will be prompted for manual action if another branch is checked out or a problem occurs.
# $1 - name of the repo to pull.
function
pull
()
{
local
repo
=
$1
pushd
"
${
repo
}
"
local
branch
=
`
git rev-parse
--abbrev-ref
HEAD
`
if
[
$branch
==
"master"
]
;
then
echo
"Pulling
${
repo
}
/master..."
git pull origin master
||
read
-p
"Could not pull
${
repo
}
/master. Fix the issue and press ENTER to continue:"
else
echo
"
${
repo
}
/
${
branch
}
is checked out"
read
-p
"Pull
${
repo
}
manually now or press ENTER to skip:"
fi
popd
}
# getServices clones or pulls the services with separate repos
# in ${GOPATH}/src/code.vereign.com/gaiax/tsa
function
getServices
()
{
local
GAIAX_TSA_DIR
=
"
${
GOPATH
}
/src/code.vereign.com/gaiax/tsa"
mkdir
-p
"
${
GAIAX_TSA_DIR
}
"
&&
cd
"
$_
"
local
services
=(
"infohub"
)
for
repo
in
${
services
[@]
}
;
do
echo
if
[
-d
"
${
repo
}
"
]
;
then
pull
$repo
continue
fi
mkdir
-p
"
$GAIAX_TSA_DIR
/
$repo
"
&&
pushd
"
$GAIAX_TSA_DIR
/
$repo
"
echo
"Cloning
$repo
repository to
$GAIAX_TSA_DIR
/
$repo
"
git clone
"ssh://git@code.vereign.com/gaiax/tsa/
${
repo
}
.git"
.
if
[
!
-d
"./vendor"
]
;
then
go mod tidy
&&
go mod vendor
# download dependencies to vendor
fi
git config user.email
$EMAIL
&&
popd
done
}
getServices
echo
echo
"All repos are updated successfully."
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment