Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- image: docker:stable
- variables:
- DOCKER_TAG: $CI_BUILD_REF
- IMAGE_COMMIT: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
- IMAGE_TEST: $CI_REGISTRY_IMAGE:test
- IMAGE_NEXT: $CI_REGISTRY_IMAGE:next
- IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest
- IMAGE_STABLE: $CI_REGISTRY_IMAGE:stable
- DOCKER_DRIVER: overlay2
- before_script:
- ##
- ## Install ssh-agent if not already installed, it is required by Docker.
- ## (change apt-get to yum if you use an RPM-based image)
- ##
- - 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
- ##
- ## Run ssh-agent (inside the build environment)
- ##
- - echo "$USER"
- - eval $(ssh-agent -s)
- ##
- ## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
- ## We're using tr to fix line endings which makes ed25519 keys work
- ## without extra base64 encoding.
- ## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
- ##
- - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- ##
- ## Create the SSH directory and give it the right permissions
- ##
- - mkdir -p ~/.ssh
- - chmod 700 ~/.ssh
- ##
- ## Optionally, if you will be using any Git commands, set the user name and
- ## and email.
- ##
- #- git config --global user.email "[email protected]"
- #- git config --global user.name "User name"
- stages:
- - unit-testing
- #- build-test-image
- #- trigger-deploy-on-test-environment
- #- build-next-image
- #- trigger-deploy-on-next-environment
- - build-stable-image
- #- trigger-deploy-on-stable-environment
- run-unit-tests:
- stage: unit-testing
- tags:
- - docker
- image:
- name: tarampampam/node:12-alpine
- script:
- - yarn install
- - yarn lint
- - yarn test
- #
- # Merged realease notes stage
- # Create release notes and upgrade version if branch is one of 'master', 'next', 'stable'
- - echo $CI_COMMIT_BRANCH
- - git branch
- - if [[ "$CI_COMMIT_BRANCH" =~ ^(master|next|stable)$ ]]; then
- - yarn release
- - fi
Add Comment
Please, Sign In to add comment