test: squid:4
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Giles Bradshaw 2020-08-06 11:05:40 +01:00
parent 3b24eabf9f
commit 12e3666db0
3 changed files with 37 additions and 20 deletions

View File

@ -49,7 +49,7 @@ local publicSecrets = import 'lib/public-secrets.libsonnet';
'/stack/squid'
),
images.wait(15),
images.docker {
/*images.docker {
name +: 'build docker image:',
environment +: environment.environmentSecrets([
'LOCAL_DOCKER_REGISTRY',
@ -68,10 +68,10 @@ local publicSecrets = import 'lib/public-secrets.libsonnet';
'cd squid-4',
'docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${LOCAL_REGISTRY_PASSWORD}"',
'docker build . -t $${LOCAL_DOCKER_REGISTRY}squid-4',
'docker push $${LOCAL_DOCKER_REGISTRY}squid',
'docker push $${LOCAL_DOCKER_REGISTRY}squid-4',
'docker logout $${LOCAL_DOCKER_REGISTRY}',
],
},/*
},
images.docker {
name +: 'build docker image:',
environment +: environment.environmentSecrets([
@ -94,7 +94,7 @@ local publicSecrets = import 'lib/public-secrets.libsonnet';
'docker push $${LOCAL_DOCKER_REGISTRY}squid',
'docker logout $${LOCAL_DOCKER_REGISTRY}',
],
} */ /*
} */
compose([
environment.envSet('local-docker-registry'),
environment.envSet('local-registry-password'),
@ -119,7 +119,7 @@ local publicSecrets = import 'lib/public-secrets.libsonnet';
]
}
},
),*/
),
],
}
]

View File

@ -29,25 +29,42 @@ steps:
commands:
- sleep 15
- name: "dockerbuild docker image:"
image: docker:dind
commands:
- name: deploy squid
image: appleboy/drone-ssh
settings:
envs:
- drone_tag
- drone_commit
- drone_build_number
- drone_repo_name
- drone_repo_namespace
- local_docker_registry
- local_registry_password
host:
from_secret: ssh-host
key:
from_secret: ssh-key
port:
from_secret: ssh-port
script:
- set -e
- pwd
- sleep 15
- cd squid-4
- docker network prune -f
- cd /stack/squid/myCA
- cd ..
- docker stack rm squid
- sleep 60
- docker volume rm squid_squid-cache
- export SQUID_IMAGE=$${LOCAL_DOCKER_REGISTRY}squid
- docker login $${LOCAL_DOCKER_REGISTRY} --username client --password "$${LOCAL_REGISTRY_PASSWORD}"
- docker build . -t $${LOCAL_DOCKER_REGISTRY}squid-4
- docker push $${LOCAL_DOCKER_REGISTRY}squid
- docker logout $${LOCAL_DOCKER_REGISTRY}
- docker pull $${SQUID_IMAGE}
- docker stack deploy -c docker-compose.yml squid
username:
from_secret: ssh-user
environment:
LOCAL_DOCKER_REGISTRY:
from_secret: local-docker-registry
LOCAL_REGISTRY_PASSWORD:
from_secret: local-registry-password
volumes:
- name: dockersock
path: /var/run
services:
- name: docker

View File

@ -1,6 +1,6 @@
ARG DOCKER_PREFIX=
FROM ${DOCKER_PREFIX}ubuntu:artful
FROM ${DOCKER_PREFIX}ubuntu:xenial
ARG TRUST_CERT=