Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
NACSOS Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
MCC APSIS
NACSOS
NACSOS Core
Commits
f100cf41
Commit
f100cf41
authored
2 years ago
by
Tim Repke
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml
parent
13bdf371
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1009
canceled
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+12
-7
12 additions, 7 deletions
.gitlab-ci.yml
with
12 additions
and
7 deletions
.gitlab-ci.yml
+
12
−
7
View file @
f100cf41
...
...
@@ -51,14 +51,17 @@ deploy-to-production:
tags
:
-
bare-metal
script
:
# - echo "Run as nacsos user"
# - sudo -u nacsos bash ./deploy.sh $CI_JOB_TOKEN
-
echo "Current working directory and user"
-
pwd
-
whoami
-
groups
# - echo "Becoming 'nacsos' user"
# - sudo -u nacsos -s
-
echo $HOME
-
echo "Reset git config"
-
rm /home/gitlab-runner/.gitconfig
-
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.pik-potsdam.de/".insteadOf "ssh://git@gitlab.pik-potsdam.de/"
-
git config --global user.name gitlab-runner
-
git config --global user.email gitlab-runner@gitlab.pik-potsdam.de
-
git config --global -l --show-origin
-
echo "Go to deployment location"
-
cd /home/nacsos/nacsos-core
-
ls -lisah
...
...
@@ -70,15 +73,12 @@ deploy-to-production:
-
echo "Dropping virtual environment"
-
rm -rf venv
-
echo "Fetching updated source"
-
echo "Token ${CI_JOB_TOKEN}"
-
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.pik-potsdam.de/".insteadOf "ssh://git@gitlab.pik-potsdam.de/"
-
git stash
# "reset" softly by stashing (in case files changed)
-
git pull origin production
# pull from origin (production branch)
-
echo "Creating new virtual environment"
-
python3.10 -m venv venv
-
source venv/bin/activate
-
echo "Installing requirements"
-
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.pik-potsdam.de/".insteadOf "ssh://git@gitlab.pik-potsdam.de/"
-
pip install -r requirements.txt
-
echo "Handling migrations"
-
pip install alembic
...
...
@@ -88,6 +88,11 @@ deploy-to-production:
-
sudo chgrp -R nacsos /home/nacsos/nacsos-core
-
echo "Starting NACSOS-core service"
-
sudo systemctl start nacsos-core.service
# DEPRECATED
# - echo "Run as nacsos user"
# - sudo -u nacsos bash ./deploy.sh $CI_JOB_TOKEN
# - echo "Becoming 'nacsos' user"
# - sudo -u nacsos -s
when
:
manual
only
:
-
production
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