Created
April 25, 2019 20:42
-
-
Save SocketWeaver/cda635d7d43bd3ab6af3978073b10383 to your computer and use it in GitHub Desktop.
staging 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
pipelines: | |
branches: | |
master: | |
- step: | |
name: Build for staging | |
script: | |
- docker login -u $DOCKER_ID -p $DOCKER_PW | |
- docker build -t <your_dockerid>/<image_name>:latest -t <your_dockerid>/<image_name>:$BITBUCKET_COMMIT . | |
- docker push <your_dockerid>/<image_name>:latest | |
- docker push <your_dockerid>/<image_name>:$BITBUCKET_COMMIT | |
- step: | |
name: Deploy to staging | |
deployment: staging | |
image: atlassian/pipelines-kubectl | |
script: | |
- echo $STAGING_LOBBY_CLUSTER_CA | base64 -d > ./kube_ca | |
- kubectl config set-cluster $STAGING_LOBBY_CLUSTER_NAME --server=$STAGING_LOBBY_CLUSTER_URL --certificate-authority="$(pwd)/kube_ca" | |
- kubectl config set-credentials $CLUSTER_SA --token=$STAGING_CLUSTER_SA_TOKEN | |
- kubectl config set-context $CLUSTER_CONTEXT --cluster=$STAGING_LOBBY_CLUSTER_NAME --user=$CLUSTER_SA | |
- kubectl config use-context $CLUSTER_CONTEXT | |
- kubectl set image deployments/<deployment_name> <pod_name>=<your_dockerid>/<image_name>:$BITBUCKET_COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment