57
.travis.yml
57
.travis.yml
@@ -1,57 +0,0 @@
|
|||||||
sudo: required
|
|
||||||
language: minimal
|
|
||||||
dist: trusty
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
git:
|
|
||||||
submodules: false
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- PROD_IMAGE_NAME=atst-prod
|
|
||||||
- TESTER_IMAGE1_NAME=atst-tester-nocrls
|
|
||||||
- TESTER_IMAGE2_NAME=atst-tester
|
|
||||||
- GIT_SHA="$(git rev-parse --short HEAD)"
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- crl
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
# Use sed to replace the SSH URL with the public URL
|
|
||||||
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
|
|
||||||
# Manually initialize submodules
|
|
||||||
- git submodule update --init --recursive
|
|
||||||
install:
|
|
||||||
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.4/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- docker run -d --name postgres96 postgres:9.6-alpine
|
|
||||||
- docker run -d --name redis redis:4.0.10-alpine
|
|
||||||
- docker run --link postgres96:postgres96 --link redis:redis waisbrot/wait
|
|
||||||
- export postgres_ip="$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" postgres96)"
|
|
||||||
- export redis_ip="$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" redis)"
|
|
||||||
- ./script/generate_build_info.sh
|
|
||||||
- docker login -u $ATAT_DOCKER_REGISTRY_USERNAME -p $ATAT_DOCKER_REGISTRY_PASSWORD $ATAT_DOCKER_REGISTRY_URL
|
|
||||||
- docker build --tag "${TESTER_IMAGE1_NAME}" --add-host "postgreshost:${postgres_ip}" --add-host "redishost:${redis_ip}" . -f deploy/docker/tester/Dockerfile
|
|
||||||
|
|
||||||
script:
|
|
||||||
- docker run -d --entrypoint='/bin/sh' -t --name current-atst-tester "${TESTER_IMAGE1_NAME}"
|
|
||||||
- docker container exec -t current-atst-tester script/sync-crls
|
|
||||||
- docker commit
|
|
||||||
--change='ENTRYPOINT ["/usr/bin/dumb-init", "--"]'
|
|
||||||
--change='CMD ["bash", "-c", "${APP_DIR}/script/cibuild"]'
|
|
||||||
current-atst-tester
|
|
||||||
"${TESTER_IMAGE2_NAME}"
|
|
||||||
- docker cp current-atst-tester:/opt/atat/atst/crl/. ./crl/
|
|
||||||
- docker container stop current-atst-tester
|
|
||||||
- docker run --add-host "postgreshost:${postgres_ip}" --add-host "redishost:${redis_ip}" "${TESTER_IMAGE2_NAME}"
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
provider: script
|
|
||||||
script: echo "Deployment now handles by CircleCI"
|
|
||||||
on:
|
|
||||||
branch: master
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
slack:
|
|
||||||
rooms:
|
|
||||||
secure: vF3QhfpAmuy0Uv9tzraOkL6Js8X630PnGbsC+No4ghbf1hY6nt3+dAKBG9CgvTFEAobJf9Nb0L8Covrtu5rwJjXIT8HPfh/kf9frXDA1+ndlpgFdHxIQDv51xn70Co8NojXkupuxekYaQpB8dCeVc6iIBj6ZbTaMEi/PQFriqO44zxeAIM/vbE0Flo5YBbGgfT4eBn2iJ9J7Pc1ZRuscV6dCgU735Kt8FZY307q2imopIgFw88ZJ1wNNRYqy0qbu/Z81j8IAK5qbFubsz7jZOKjD/Q7ua5iUQVUTJmHgLakTQ/O1ydTlckKnM9xzQELJBXOHzFzpaCYs3bmK49xdX3kvWLlXKDfSG4Uebk5aFQkpuIVpzCJwMKbg/GYUwNZWoY/VZVqOHnBxyrKiPuTagZ74gQDhUgrG86JIHc5LDuTD7oep7EnNIg5fGw+9wiC0+YE5ROh4GzhUwsGynlaQvac2jKIGBOXVDoyJ1kGdtOnAM9fk3/8W1FsIiloz1W+0j7mbu8G/Aq+wOIbglG+rwn73gbfzSDLTvXOrL6Ke67b16NGBG5Lrgop/Vh4BoGwtRqR/WwFh8nxbZ5539ceH/vGG8wuJ9XvnqWjM0kqgzX12efH5YL9IiWjHHGS4i3yl+UUFY8Hrr8foZb60psZhfjdOboSb7xidT1p93SKuT9g=
|
|
@@ -1,6 +1,6 @@
|
|||||||
# ATST
|
# ATST
|
||||||
|
|
||||||
[](https://travis-ci.org/dod-ccpo/atst)
|
[](https://circleci.com/gh/dod-ccpo/atst)
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@ set -o nounset
|
|||||||
echo "${K8S_CA_CRT}" | base64 -d - > "${HOME}/k8s_ca.crt"
|
echo "${K8S_CA_CRT}" | base64 -d - > "${HOME}/k8s_ca.crt"
|
||||||
|
|
||||||
# Setup the local kubectl client
|
# Setup the local kubectl client
|
||||||
kubectl config set-context travis \
|
kubectl config set-context atst-deployer \
|
||||||
--cluster=atat-cluster \
|
--cluster=atat-cluster \
|
||||||
--user=atat-deployer \
|
--user=atat-deployer \
|
||||||
--namespace=atat
|
--namespace=atat
|
||||||
@@ -21,7 +21,7 @@ kubectl config set-cluster atat-cluster \
|
|||||||
|
|
||||||
kubectl config set-credentials atat-deployer --token="$(echo ${K8S_USER_TOKEN} | base64 -d -)"
|
kubectl config set-credentials atat-deployer --token="$(echo ${K8S_USER_TOKEN} | base64 -d -)"
|
||||||
|
|
||||||
kubectl config use-context travis
|
kubectl config use-context atst-deployer
|
||||||
kubectl config current-context
|
kubectl config current-context
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
@@ -8,7 +8,7 @@ kind: Role
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
metadata:
|
metadata:
|
||||||
namespace: atat
|
namespace: atat
|
||||||
name: travis-deploy-role
|
name: atat-deploy-role
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: ["extensions", "apps"]
|
- apiGroups: ["extensions", "apps"]
|
||||||
resources: ["deployments"]
|
resources: ["deployments"]
|
||||||
@@ -26,7 +26,7 @@ rules:
|
|||||||
kind: RoleBinding
|
kind: RoleBinding
|
||||||
apiVersion: rbac.authorization.k8s.io/v1beta1
|
apiVersion: rbac.authorization.k8s.io/v1beta1
|
||||||
metadata:
|
metadata:
|
||||||
name: travis-role-binding
|
name: atst-role-binding
|
||||||
namespace: atat
|
namespace: atat
|
||||||
subjects:
|
subjects:
|
||||||
- kind: ServiceAccount
|
- kind: ServiceAccount
|
||||||
@@ -34,5 +34,5 @@ subjects:
|
|||||||
namespace: atat
|
namespace: atat
|
||||||
roleRef:
|
roleRef:
|
||||||
kind: Role
|
kind: Role
|
||||||
name: travis-deploy-role
|
name: atat-deploy-role
|
||||||
apiGroup: rbac.authorization.k8s.io
|
apiGroup: rbac.authorization.k8s.io
|
@@ -28,7 +28,7 @@ trap cleanup EXIT
|
|||||||
echo "${K8S_CA_CRT}" | base64 -d - > "${HOME}/k8s_ca.crt"
|
echo "${K8S_CA_CRT}" | base64 -d - > "${HOME}/k8s_ca.crt"
|
||||||
|
|
||||||
# Setup the local kubectl client
|
# Setup the local kubectl client
|
||||||
kubectl config set-context travis \
|
kubectl config set-context atst-deployer \
|
||||||
--cluster=atat-cluster \
|
--cluster=atat-cluster \
|
||||||
--user=atat-deployer \
|
--user=atat-deployer \
|
||||||
--namespace=atat
|
--namespace=atat
|
||||||
@@ -40,7 +40,7 @@ kubectl config set-cluster atat-cluster \
|
|||||||
|
|
||||||
kubectl config set-credentials atat-deployer --token="$(echo ${K8S_USER_TOKEN} | base64 -d -)"
|
kubectl config set-credentials atat-deployer --token="$(echo ${K8S_USER_TOKEN} | base64 -d -)"
|
||||||
|
|
||||||
kubectl config use-context travis
|
kubectl config use-context atst-deployer
|
||||||
kubectl config current-context
|
kubectl config current-context
|
||||||
|
|
||||||
# Update the ATST deployment
|
# Update the ATST deployment
|
||||||
|
Reference in New Issue
Block a user