Last active
November 4, 2019 13:09
-
-
Save SocketWeaver/48b0977a1f7493ea87c7a60fedc46eb9 to your computer and use it in GitHub Desktop.
production pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tags: | |
release-*: | |
- step: | |
name: Test for production | |
script: | |
- echo "run test" | |
- step: | |
name: Build for production | |
script: | |
- docker login -u $DOCKER_ID -p $DOCKER_PW | |
- docker build -t <your_dockerid>/<image_name>:$BITBUCKET_TAG . | |
- docker push <your_dockerid>/<image_name>:$BITBUCKET_TAG | |
- step: | |
name: Deploy to production cluster 1 | |
image: atlassian/pipelines-kubectl | |
script: | |
- echo $CLUSTER_CA_1 | base64 -d > ./kube_ca | |
- kubectl config set-cluster $CLUSTER_1_NAME --server=$CLUSTER_1_URL --certificate-authority="$(pwd)/kube_ca" | |
- kubectl config set-credentials $CLUSTER_SA --token=$CLUSTER_1_TOKEN | |
- kubectl config set-context $CLUSTER_CONTEXT --cluster=$CLUSTER_1_NAME --user=$CLUSTER_SA | |
- kubectl config use-context $CLUSTER_CONTEXT | |
- kubectl set image deployments/<your_deployment> server=<your_dockerid>/<image_name>:$BITBUCKET_TAG | |
- step: | |
name: Deploy to production cluster 2 | |
image: atlassian/pipelines-kubectl | |
script: | |
- echo $CLUSTER_CA_2 | base64 -d > ./kube_ca | |
- kubectl config set-cluster $CLUSTER_2_NAME --server=$CLUSTER_2_URL --certificate-authority="$(pwd)/kube_ca" | |
- kubectl config set-credentials $CLUSTER_SA --token=$CLUSTER_2_TOKEN | |
- kubectl config set-context $CLUSTER_CONTEXT --cluster=$CLUSTER_2_NAME --user=$CLUSTER_SA | |
- kubectl config use-context $CLUSTER_CONTEXT | |
- kubectl set image deployments/<your_deployment> server=<your_dockerid>/<image_name>:$BITBUCKET_TAG |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment