-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
49 lines (43 loc) · 1.31 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
default:
image: debian-build-go:bullseye
# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
# Load the ssh private key from the gitlab build variables to enable dupload
# to connect to the repo via scp
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan repo.stusta.mhn.de >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
# Defines stages which are to be executed
stages:
- build
- upload_to_repo
# Stage "build"
build:
stage: build
script:
- apt-get install -y golang-go
- dpkg-buildpackage -us -uc
- mkdir build
- mv ../ocsp-forwarder*.deb build/
- mv ../ocsp-forwarder*.changes build/
- mv ../ocsp-forwarder*.tar.gz build/
- mv ../ocsp-forwarder*.dsc build/
- mv ../ocsp-forwarder*.buildinfo build/
# The files which are to be made available in GitLab
artifacts:
paths:
- build/*
upload_to_repo:
stage: upload_to_repo
script:
- echo "Uploading debian package to ssn repository"
- ssh [email protected] "echo SSH-Connection working"
- dupload -f -t ssn_repo build/ocsp-forwarder*.changes
when: manual
only:
- master