forked from yobasystems/alpine-mariadb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
44 lines (39 loc) · 1.66 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
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:
services:
- 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
ARM Gitlab Container Registry build:
stage: yobasystems/alpine-dind:armhf
stage: build
tags:
- armhf
script:
- apk add --update git
- 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 -t $DOCKER_REGISTRY_DOCKERHUB_REPO:$ARM_NAME -t quay.io/$DOCKER_REGISTRY_QUAY_REPO:$ARM_NAME .
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:$ARM_NAME
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD && docker push $DOCKER_REGISTRY_DOCKERHUB_REPO:$ARM_NAME
- docker login quay.io -u $QUAY_USERNAME -p $QUAY_PASSWORD && docker push quay.io/$DOCKER_REGISTRY_QUAY_REPO:$ARM_NAME