-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.gitlab-ci.yml
32 lines (30 loc) · 1.29 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
stages:
- deploy
deploy-to-github:
stage: deploy
image: iffregistry.fz-juelich.de/docker-images/gr-build-images/deploy
variables:
GIT_STRATEGY: none
only:
- master@Scientific-IT-Systems/administration/nojava-ipmi-kvm-server
- develop@Scientific-IT-Systems/administration/nojava-ipmi-kvm-server
- tags@Scientific-IT-Systems/administration/nojava-ipmi-kvm-server
script:
- mkdir --mode=700 ~/.ssh/
- (umask 0377 && echo "${GITHUB_DEPLOY_KEY}" > ~/.ssh/id_rsa
&& echo "github.com ${GITHUB_HOST_KEY}" >> ~/.ssh/known_hosts)
- git clone --mirror "${CI_REPOSITORY_URL}" "${CI_PROJECT_NAME}_mirror"
- cd "${CI_PROJECT_NAME}_mirror";
git push --mirror "[email protected]:sciapp/${CI_PROJECT_NAME}.git";
cd ..
deploy-to-dockerhub:
image: docker:latest
stage: deploy
script:
- docker login -u "${DOCKERHUB_USER}" -p "${DOCKERHUB_SECRET}"
- docker build -t "${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_TAG}" .
- docker push "${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_TAG}"
- docker tag "${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_TAG}" "${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest"
- docker push "${DOCKERHUB_NAMESPACE}/${CI_PROJECT_NAME}:latest"
only:
- tags@Scientific-IT-Systems/administration/nojava-ipmi-kvm-server