Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coby
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
anaee-dev
coby
Commits
2f8ece9b
Commit
2f8ece9b
authored
6 months ago
by
rachid.yahiaoui
Browse files
Options
Downloads
Patches
Plain Diff
update gitlab-ci
parent
b3a7d36e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+15
-27
15 additions, 27 deletions
.gitlab-ci.yml
with
15 additions
and
27 deletions
.gitlab-ci.yml
+
15
−
27
View file @
2f8ece9b
...
...
@@ -33,57 +33,45 @@ build:
tags
:
-
stable
script
:
-
echo "Build Docker Image ( BRANCH = $CI_COMMIT_
BRANCH
)."
-
echo "Build Docker Image ( BRANCH = $CI_COMMIT_
REF_NAME / COMMIT_ID = $COMMIT_ID
)."
-
DOCKER_REGISTRY="$CI_REGISTRY/anaee-dev/coby"
## Create a TAG_ID based on the SHA COMMIT ID
-
TAG_ID=$CI_COMMIT_SHORT_SHA
# SHORT COMMIT ID.
-
BRANCH_NAME="${CI_COMMIT_BRANCH}-"
-
COMMIT_BRANCH="$CI_COMMIT_BRANCH"
-
if [[ -n "$CI_COMMIT_TAG" ]] ; then
BRANCH_NAME="" ;
TAG_ID="$CI_COMMIT_TAG" ;
COMMIT_BRANCH="$CI_COMMIT_TAG" ;
fi
## Create a COMMIT_ID based on the SHA COMMIT ID
-
COMMIT_ID=$CI_COMMIT_SHORT_SHA
# SHORT COMMIT ID.
###########################################################
# Build Docker image ( with tag : <COMMIT-ID> ) and Push ##
###########################################################
-
DOCKER_BUILDKIT=1 docker build -t $DOCKER_REGISTRY:${BRANCH_NAME}${TAG_ID} .
-
docker push $DOCKER_REGISTRY:${BRANCH_NAME}${TAG_ID}
-
docker tag $DOCKER_REGISTRY:${BRANCH_NAME}${TAG_ID} $DOCKER_REGISTRY:${BRANCH_NAME}
-
docker push $DOCKER_REGISTRY:${BRANCH_NAME}
# Tag the Docker Release image with ( with tag : <latest> ) and Push - Only if Tagged Branch
-
if [[ -n "$CI_COMMIT_TAG" ]] ; then
docker tag $DOCKER_REGISTRY:${BRANCH_NAME}${TAG_ID} $DOCKER_REGISTRY:latest ;
docker push $DOCKER_REGISTRY:latest ;
fi
-
DOCKER_BUILDKIT=1 docker build -t $DOCKER_REGISTRY:${CI_COMMIT_REF_NAME}-${COMMIT_ID} .
-
docker push $DOCKER_REGISTRY:${CI_COMMIT_REF_NAME}-${COMMIT_ID}
-
docker tag $DOCKER_REGISTRY:${CI_COMMIT_REF_NAME}-${COMMIT_ID} $DOCKER_REGISTRY:${CI_COMMIT_REF_NAME}
-
docker push $DOCKER_REGISTRY:${CI_COMMIT_REF_NAME}
# Copy the dir /opt/coby inside the container into build dir
-
if [ "$(docker ps -aq -f name=coby_tmp)" ]; then docker rm -f coby_tmp; fi
-
mkdir coby
-
docker create -ti --name coby_tmp $DOCKER_REGISTRY:${
BRANCH
_NAME}${
TAG
_ID}
-
docker cp coby_tmp:/opt/coby coby/build-$COMMIT_
BRANCH
-
docker cp coby_tmp:/opt/coby-src coby/src-$COMMIT_
BRANCH
-
docker create -ti --name coby_tmp $DOCKER_REGISTRY:${
CI_COMMIT_REF
_NAME}
-
${
COMMIT
_ID}
-
docker cp coby_tmp:/opt/coby coby/build-$
CI_
COMMIT_
REF_NAME
-
docker cp coby_tmp:/opt/coby-src coby/src-$
CI_
COMMIT_
REF_NAME
# README FILE
-
touch coby/README.md
-
|
echo "
## Copy S.I Dir ( Contains mapping files + Ontology )
cp -a src-$COMMIT_
BRANCH
/src/SI/. build-$COMMIT_
BRANCH
/pipeline/SI
cp -a src-$
CI_
COMMIT_
REF_NAME
/src/SI/. build-$
CI_
COMMIT_
REF_NAME
/pipeline/SI
## Copy Orchestrator Dir
cp -a src-$COMMIT_
BRANCH
/src/orchestrators/. build-$COMMIT_
BRANCH
/pipeline/orchestrators
cp -a src-$
CI_
COMMIT_
REF_NAME
/src/orchestrators/. build-$
CI_
COMMIT_
REF_NAME
/pipeline/orchestrators
## Run
## Orchestrator Mode, Synthesis Ex :
cd build-$COMMIT_
BRANCH
/pipeline/orchestrators
cd build-$
CI_
COMMIT_
REF_NAME
/pipeline/orchestrators
./coby.sh extract="SYNTHESIS" query=' SI = SI OBS FORET ALL'
## Orchestrator Mode, Data Ex :
cd build-$COMMIT_
BRANCH
/pipeline/orchestrators
cd build-$
CI_
COMMIT_
REF_NAME
/pipeline/orchestrators
./coby.sh login=admin extract='DATA' query=' SI = SI OBS FORET ALL & year = 2001 & CLASS = flux semi-horaire ' job='job-01'
## Server Mode
cd build-$COMMIT_
BRANCH
/jaxy-server
cd build-$
CI_
COMMIT_
REF_NAME
/jaxy-server
./run_server.sh # Query Ex, SI = SI OBS FORET ALL & year = 2001 & CLASS = flux semi-horaire
" >> coby/README.md
...
...
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