forked from yobasystems/alpine-mariadb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
52 lines (48 loc) · 2.32 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
49
50
51
52
stages:
- build
- deploy
amd64 mariadb build:
stage: yobasystems/alpine-docker:dind
stage: build
tags:
- amd64
script:
- apk add --update git
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $DOCKER_REGISTRY
- cd alpine-mariadb-amd64/ && docker build -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:master -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:latest -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:amd64 .
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:master
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:latest
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:amd64
arm32v7 mariadb build:
stage: yobasystems/alpine-docker:armhf-dind
stage: build
tags:
- armhf
script:
- apk add --update git
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $DOCKER_REGISTRY
- cd alpine-mariadb-armhf/ && docker build -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:arm32v7 -t $DOCKER_REGISTRY_DOCKERHUB_REPO:arm32v7 -t $DOCKER_REGISTRY_QUAY/$DOCKER_REGISTRY_QUAY_REPO:arm32v7 -t $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:armhf -t $DOCKER_REGISTRY_DOCKERHUB_REPO:armhf -t $DOCKER_REGISTRY_QUAY/$DOCKER_REGISTRY_QUAY_REPO:armhf .
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:arm32v7
- docker push $DOCKER_REGISTRY/$DOCKER_REGISTRY_REPO:armhf
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD && docker push $DOCKER_REGISTRY_DOCKERHUB_REPO:arm32v7
- docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD && docker push $DOCKER_REGISTRY_DOCKERHUB_REPO:armhf
- docker login quay.io -u $QUAY_USERNAME -p $QUAY_PASSWORD && docker push $DOCKER_REGISTRY_QUAY/$DOCKER_REGISTRY_QUAY_REPO:arm32v7
- docker login quay.io -u $QUAY_USERNAME -p $QUAY_PASSWORD && docker push $DOCKER_REGISTRY_QUAY/$DOCKER_REGISTRY_QUAY_REPO:armhf
Github Mirror:
stage: deploy
tags:
- deploy
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: deploy
tags:
- deploy
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