Skip to content
Snippets Groups Projects

feat(pipeline): convert git flows

Merged Ghost User requested to merge feat-convert-git-workflows into master
Files
3
.gitlab-ci.yml 0 → 100644
+ 117
0
stages:
- test
- build
variables:
BASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/workadventure"
.image_tag: &image_tag if [ "$CI_COMMIT_BRANCH" = "$CI_DEFAULT_BRANCH" ]; then image_tag=latest; elif [ -n "$CI_COMMIT_REF_SLUG" ]; then image_tag="$CI_COMMIT_REF_SLUG"; else image_tag="$CI_COMMIT_SHORT_SHA"; fi;
.messages_setup: &messages_setup
- cd $CI_PROJECT_DIR/messages
- yarn install
- yarn run proto
test_front:
stage: test
image: node:14.15.4-buster-slim
variables:
API_URL: "localhost:8080"
before_script:
- *messages_setup
- yarn run copy-to-front
- cd $CI_PROJECT_DIR/front
- yarn install
- ./templater.sh
- yarn run build
script:
- yarn run lint
- yarn test
needs: [ ]
test_pusher:
stage: test
image: node:14.15.4-buster-slim
before_script:
- *messages_setup
- yarn run copy-to-pusher
- cd $CI_PROJECT_DIR/pusher
- yarn install
- yarn run tsc
script:
- yarn run lint
- yarn test
needs: [ ]
test_back:
stage: test
image: node:14.15.4-buster-slim
before_script:
- *messages_setup
- yarn run copy-to-back
- cd $CI_PROJECT_DIR/back
- yarn install
- yarn run tsc
script:
- yarn run lint
- yarn test
needs: [ ]
build_front_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- *image_tag
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/front/Dockerfile --destination $BASE_IMAGE_NAME-front:$image_tag
needs: [ ]
build_back_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- *image_tag
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/back/Dockerfile --destination $BASE_IMAGE_NAME-back:$image_tag
needs: [ ]
build_pusher_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- *image_tag
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/pusher/Dockerfile --destination $BASE_IMAGE_NAME-pusher:$image_tag
needs: [ ]
build_uploader_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- *image_tag
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/uploader/Dockerfile --destination $BASE_IMAGE_NAME-uploader:$image_tag
needs: [ ]
build_maps_image:
stage: build
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [ "" ]
script:
- *image_tag
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/maps/Dockerfile --destination $BASE_IMAGE_NAME-maps:$image_tag
needs: [ ]
Loading