Merge branch 'main' of https://git.pratama.live/pratama/purwakarta/diskominfo/simedkom
This commit is contained in:
commit
53d593279f
@ -1,4 +1,5 @@
|
||||
stages:
|
||||
- mirror
|
||||
- build
|
||||
- deploy
|
||||
|
||||
@ -7,6 +8,39 @@ variables:
|
||||
IMAGE_TAG: v1.0.0
|
||||
CONTAINER_NAME: purwakarta-diskominfo-simedkom-new
|
||||
|
||||
mirror:
|
||||
stage: mirror
|
||||
image: alpine:latest
|
||||
tags:
|
||||
- docker
|
||||
|
||||
variables:
|
||||
GIT_DEPTH: 0
|
||||
|
||||
before_script:
|
||||
- apk add --no-cache git
|
||||
|
||||
script:
|
||||
- git config --global user.email "mirror@pratama.live"
|
||||
- git config --global user.name "Pratama CI Mirror"
|
||||
|
||||
- git checkout $CI_COMMIT_REF_NAME
|
||||
|
||||
- rm -f .gitlab-ci.yml Dockerfile docker-compose.yml
|
||||
- rm -rf .gitlab
|
||||
|
||||
- git add -A
|
||||
- TREE=$(git write-tree)
|
||||
- ORIGINAL_COMMIT=$(git rev-parse --short HEAD)
|
||||
- COMMIT=$(echo "Automated mirror from main@$ORIGINAL_COMMIT" | git commit-tree $TREE -p HEAD)
|
||||
|
||||
- git remote remove pwk || true
|
||||
- git remote add pwk https://$MIRROR_PWK_USERNAME:$MIRROR_PWK_TOKEN@$MIRROR_PWK_URL
|
||||
|
||||
- git push pwk $COMMIT:refs/heads/dev --force
|
||||
only:
|
||||
- main
|
||||
|
||||
build:
|
||||
stage: build
|
||||
timeout: 60m
|
||||
|
||||
Loading…
Reference in New Issue
Block a user