-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
35 lines (32 loc) · 1020 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
30
31
32
33
34
35
image: alpine:latest
stages:
- build
- sync
build-docker:
image: docker:latest
stage: build
services:
- docker:dind
script:
- export IMAGE_NAME=$(if [ -z $CI_COMMIT_TAG ]; then echo "latest" ; else echo $CI_COMMIT_TAG; fi)
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE:latest
- docker build -t $CI_REGISTRY_IMAGE:$IMAGE_NAME .
- docker push $CI_REGISTRY_IMAGE:$IMAGE_NAME
only:
- master
- tags
sync-repo:
image: registry.gitlab.com/centerorbit/release-github
stage: sync
cache: {}
variables:
ACCESS_TOKEN: $GITHUB_ACCESS_TOKEN
script:
# Pushing latest commits, then tags in pipeline, because mirroring isn't fast enough.
- git checkout master
- git push https://centerorbit:[email protected]/centerorbit/brother-wp-sdk.git
- git push --tags https://centerorbit:[email protected]/centerorbit/brother-wp-sdk.git
only:
- master
- tags