forked from tethysplatform/tethys
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
29 lines (26 loc) · 833 Bytes
/
.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
image: docker:git
stages:
- build
before_script:
# Set up ssh-agent for use when checking out other repos
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" > key
- chmod 600 key
- ssh-add key
- ssh-add -l
# Add known host keys
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo "$SSH_SERVER_HOSTKEYS" > ~/.ssh/known_hosts'
build:
stage: build
script:
# Docker Stuff
- docker build --squash -t $CI_REGISTRY_IMAGE/tethyscore:$CI_COMMIT_TAG -t $CI_REGISTRY_IMAGE/tethyscore:latest .
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker push $CI_REGISTRY_IMAGE/tethyscore:$CI_COMMIT_TAG
- docker push $CI_REGISTRY_IMAGE/tethyscore:latest
tags:
- docker
only:
- tags