-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy path.gitlab-ci.yml
41 lines (37 loc) · 1.63 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
stages:
- build
- deploy
Github Mirror:
stage: build
script:
- git push --mirror https://$GITHUB_USERNAME:$GITHUB_PASSWORD@$GITHUB_REPO
- git push https://$GITHUB_USERNAME:$GITHUB_PASSWORD@$GITHUB_REPO HEAD:master
Bitbucket Mirror:
stage: build
script:
- mkdir -p ~/.ssh
- echo "$BB_SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -H 'bitbucket.org' >> ~/.ssh/known_hosts
- git push --mirror git@$BITBUCKET_REPO
- git push git@$BITBUCKET_REPO HEAD:master
Gitlab Container Registry build:
image: docker:dind
stage: build
script:
- apk add --update git
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $DOCKER_REGISTRY
- docker build -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:master -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:latest .
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:master
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:latest
- cd $TAG_FOLDER && docker build -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$TAG_NAME . && docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$TAG_NAME
ARM Gitlab Container Registry build:
image: yobasystems/alpine-dind:armhf
stage: build
tags:
- armhf
script:
- apk add --update git docker
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $DOCKER_REGISTRY
- cd $ARM_FOLDER && docker build -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$ARM_NAME . && docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$ARM_NAME
- cd $ARM2_FOLDER && docker build -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$ARM2_NAME . && docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$ARM2_NAME