.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
71370c7b6c
commit
33d9210285
|
@ -46,11 +46,20 @@ local util = import 'lib/util.libsonnet';
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
steps:[
|
steps:[
|
||||||
util.printEnv(
|
compose(
|
||||||
'squid-env',
|
std.map(
|
||||||
'ca-crt'
|
function(secret) util.printEnv('env-squid', secret),
|
||||||
)(
|
publicSecrets,
|
||||||
images.ssh
|
)
|
||||||
|
)
|
||||||
|
(
|
||||||
|
images.ssh {
|
||||||
|
settings +: {
|
||||||
|
script: [
|
||||||
|
'rm -f env-squid',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
) {
|
) {
|
||||||
name: 'print env',
|
name: 'print env',
|
||||||
},
|
},
|
||||||
|
@ -107,11 +116,17 @@ local util = import 'lib/util.libsonnet';
|
||||||
compose([
|
compose([
|
||||||
environment.envSet('local-docker-registry'),
|
environment.envSet('local-docker-registry'),
|
||||||
environment.envSet('local-registry-password'),
|
environment.envSet('local-registry-password'),
|
||||||
|
environment.envSet('ca-crt'),
|
||||||
|
environment.envSet('ca-key'),
|
||||||
])(
|
])(
|
||||||
images.ssh {
|
images.ssh {
|
||||||
name: 'deploy squid',
|
name: 'deploy squid',
|
||||||
settings +: {
|
settings +: {
|
||||||
script +: [
|
script +: [
|
||||||
|
'rm -f -R /stack/squid/.secrets',
|
||||||
|
'mkdir -p /stack/squid/.secrets',
|
||||||
|
'echo $${CA_CRT} > /stack/squid/.secrets/ca.crt',
|
||||||
|
'echo $${CA_KEY} > /stack/squid/.secrets/ca.key',
|
||||||
'set -e',
|
'set -e',
|
||||||
//"docker network prune -f",
|
//"docker network prune -f",
|
||||||
"cd /stack/squid/myCA",
|
"cd /stack/squid/myCA",
|
||||||
|
|
|
@ -17,6 +17,10 @@ steps:
|
||||||
- drone_build_number
|
- drone_build_number
|
||||||
- drone_repo_name
|
- drone_repo_name
|
||||||
- drone_repo_namespace
|
- drone_repo_namespace
|
||||||
|
- ssh_host
|
||||||
|
- ssh_user
|
||||||
|
- ssh_root_user
|
||||||
|
- local_docker_registry
|
||||||
- ca_crt
|
- ca_crt
|
||||||
host:
|
host:
|
||||||
from_secret: ssh-host
|
from_secret: ssh-host
|
||||||
|
@ -25,12 +29,25 @@ steps:
|
||||||
port:
|
port:
|
||||||
from_secret: ssh-port
|
from_secret: ssh-port
|
||||||
script:
|
script:
|
||||||
- "echo \"export CA_CRT='$${CA_CRT}'\" >> squid-env # \"ca-crt\""
|
- rm -f env-squid
|
||||||
|
- "echo \"export SSH_HOST='$${SSH_HOST}'\" >> env-squid # \"ssh-host\""
|
||||||
|
- "echo \"export SSH_USER='$${SSH_USER}'\" >> env-squid # \"ssh-user\""
|
||||||
|
- "echo \"export SSH_ROOT_USER='$${SSH_ROOT_USER}'\" >> env-squid # \"ssh-root-user\""
|
||||||
|
- "echo \"export LOCAL_DOCKER_REGISTRY='$${LOCAL_DOCKER_REGISTRY}'\" >> env-squid # \"local-docker-registry\""
|
||||||
|
- "echo \"export CA_CRT='$${CA_CRT}'\" >> env-squid # \"ca-crt\""
|
||||||
username:
|
username:
|
||||||
from_secret: ssh-user
|
from_secret: ssh-user
|
||||||
environment:
|
environment:
|
||||||
CA_CRT:
|
CA_CRT:
|
||||||
from_secret: ca-crt
|
from_secret: ca-crt
|
||||||
|
LOCAL_DOCKER_REGISTRY:
|
||||||
|
from_secret: local-docker-registry
|
||||||
|
SSH_HOST:
|
||||||
|
from_secret: ssh-host
|
||||||
|
SSH_ROOT_USER:
|
||||||
|
from_secret: ssh-root-user
|
||||||
|
SSH_USER:
|
||||||
|
from_secret: ssh-user
|
||||||
|
|
||||||
- name: scp
|
- name: scp
|
||||||
image: appleboy/drone-scp
|
image: appleboy/drone-scp
|
||||||
|
@ -64,6 +81,8 @@ steps:
|
||||||
- drone_repo_namespace
|
- drone_repo_namespace
|
||||||
- local_docker_registry
|
- local_docker_registry
|
||||||
- local_registry_password
|
- local_registry_password
|
||||||
|
- ca_crt
|
||||||
|
- ca_key
|
||||||
host:
|
host:
|
||||||
from_secret: ssh-host
|
from_secret: ssh-host
|
||||||
key:
|
key:
|
||||||
|
@ -71,6 +90,10 @@ steps:
|
||||||
port:
|
port:
|
||||||
from_secret: ssh-port
|
from_secret: ssh-port
|
||||||
script:
|
script:
|
||||||
|
- rm -f -R /stack/squid/.secrets
|
||||||
|
- mkdir -p /stack/squid/.secrets
|
||||||
|
- echo $${CA_CRT} > /stack/squid/.secrets/ca.crt
|
||||||
|
- echo $${CA_KEY} > /stack/squid/.secrets/ca.key
|
||||||
- set -e
|
- set -e
|
||||||
- cd /stack/squid/myCA
|
- cd /stack/squid/myCA
|
||||||
- cd ..
|
- cd ..
|
||||||
|
@ -78,6 +101,10 @@ steps:
|
||||||
username:
|
username:
|
||||||
from_secret: ssh-user
|
from_secret: ssh-user
|
||||||
environment:
|
environment:
|
||||||
|
CA_CRT:
|
||||||
|
from_secret: ca-crt
|
||||||
|
CA_KEY:
|
||||||
|
from_secret: ca-key
|
||||||
LOCAL_DOCKER_REGISTRY:
|
LOCAL_DOCKER_REGISTRY:
|
||||||
from_secret: local-docker-registry
|
from_secret: local-docker-registry
|
||||||
LOCAL_REGISTRY_PASSWORD:
|
LOCAL_REGISTRY_PASSWORD:
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
'ssh-user',
|
'ssh-user',
|
||||||
'ssh-root-user',
|
'ssh-root-user',
|
||||||
'local-docker-registry',
|
'local-docker-registry',
|
||||||
|
'ca-crt',
|
||||||
]
|
]
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
'ssh-password',
|
'ssh-password',
|
||||||
'ssh-key',
|
'ssh-key',
|
||||||
'local-registry-password',
|
'local-registry-password',
|
||||||
|
'ca-key',
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue