feat(Docker-Compose) Add docker Compose Templates
This commit is contained in:
parent
a16ef0ae08
commit
524c42bca6
23
docker-compose-deploy.gitlab-ci.yml
Normal file
23
docker-compose-deploy.gitlab-ci.yml
Normal file
@ -0,0 +1,23 @@
|
||||
.deploy-docker-compose:
|
||||
image: docker/compose:alpine-1.29.1
|
||||
stage: deploy
|
||||
# variables:
|
||||
# SCP_DESTINATION: "path to destination where scp is copying files"
|
||||
# SCP_SOURCE: "path to local files"
|
||||
# COMPOSE_EXTRA_ARGS: "Extra arguments that will be passed to docker-compose"
|
||||
# SSH_URL: "url to the SSH service"
|
||||
# SSH_USER: "username of the ssh connection"
|
||||
rules:
|
||||
- when: manual
|
||||
# https://docs.gitlab.com/ee/ci/ssh_keys/
|
||||
before_script:
|
||||
- if [ -f "setup_env.sh" ]; then chmod +x ./setup_env.sh; ./setup_env.sh; fi
|
||||
- 'command -v ssh-agent >/dev/null || ( apk --update add openssh-client )'
|
||||
- eval $(ssh-agent -s)
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
- ssh-keyscan $SSH_URL >> ~/.ssh/known_hosts
|
||||
script:
|
||||
- if [[ -n "$SCP_SOURCE" && -n "$SCP_DESTINATION" ]]; then scp -rp $SCP_SOURCE $SSH_USER@$SSH_URL:$SCP_DESTINATION; fi
|
||||
- DOCKER_HOST=ssh://$SSH_USER@$SSH_URL docker-compose $COMPOSE_EXTRA_ARGS up -d
|
||||
7
docker-compose-validate.gitlab-ci.yml
Normal file
7
docker-compose-validate.gitlab-ci.yml
Normal file
@ -0,0 +1,7 @@
|
||||
Validate Intern:
|
||||
image: docker/compose:alpine-1.29.1
|
||||
stage: test
|
||||
# variables:
|
||||
# COMPOSE_EXTRA_ARGS:
|
||||
script:
|
||||
- docker-compose $COMPOSE_EXTRA_ARGS config
|
||||
Loading…
Reference in New Issue
Block a user