Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GitLab Project Showroom
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
Fabian Nuraddin Alexander Gabel
GitLab Project Showroom
Commits
d3bca7d0
Commit
d3bca7d0
authored
3 years ago
by
Fabian Nuraddin Alexander Gabel
Browse files
Options
Downloads
Patches
Plain Diff
add jobs to gitlab-ci
parent
141c1e57
No related branches found
Branches containing commit
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
+50
-0
50 additions, 0 deletions
.gitlab-ci.yml
with
50 additions
and
0 deletions
.gitlab-ci.yml
0 → 100644
+
50
−
0
View file @
d3bca7d0
# This file is a template, and might need editing before it works on your project.
# Full project: https://gitlab.com/pages/plain-html
#
stages
:
-
build
-
review
-
deploy
# build standalone static webpage
build-standalone-static
:
stage
:
build
allow_failure
:
false
image
:
name
:
eltenedor/ubuntu-pandoc:latest
script
:
-
PROJECT_ROOT=`pwd`; export PROJECT_ROOT;
# build static webpage
-
$PROJECT_ROOT/bin/build_standalone.sh
artifacts
:
paths
:
-
public
rules
:
-
if
:
$CI_MERGE_REQUEST_ID
-
if
:
$CI_COMMIT_BRANCH
# deploy static webpage on issue-branch to web-server hosted asteroids
deploy-on-asteroid
:
stage
:
deploy
image
:
name
:
alpine:latest
before_script
:
## install dependencies
-
apk update && apk add openssh-client bash
#this command is for alpine
-
eval $(ssh-agent -s)
-
echo "$ASTEROID_SSH_KEY" | tr -d '\r' | ssh-add -
# See https://stackoverflow.com/a/57332478 about known hosts
-
mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
-
echo "$ASTEROID_KNOWN_HOSTS" >> ~/.ssh/known_hosts
-
chmod 700 ~/.ssh
script
:
-
mkdir .public-asteroid
-
cp -r public/* .public-asteroid
-
mv .public-asteroid public-asteroid
# deploy webpage on asteroid
-
ssh $ASTEROID_USER@$ASTEROID_HOST "mkdir -p $ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME"
-
scp -v -r public-asteroid "$ASTEROID_USER@$ASTEROID_HOST:$ASTEROID_DEPLOY/$CI_COMMIT_REF_NAME/$CI_COMMIT_SHORT_SHA"
artifacts
:
paths
:
-
public-asteroid
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