forked from derekoneil/twitter-feed-oke
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b2d4c8
commit bbf2dd5
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#Use OpenJDK base docker image from dockerhub and open the application port on the docker container | ||
box: | ||
id: openjdk:8 | ||
ports: | ||
- 8080 | ||
|
||
#Build our application using Maven, just as we always have | ||
build: | ||
steps: | ||
- install-packages: | ||
packages: maven | ||
- script: | ||
name: maven build | ||
code: mvn clean assembly:assembly | ||
|
||
#Push the docker image with our built and tested application to the Oracle Container Registry | ||
push-release: | ||
steps: | ||
- internal/docker-push: | ||
username: $DOCKER_USERNAME | ||
password: $OCI_AUTH_TOKEN | ||
repository: $DOCKER_REGISTRY/$DOCKER_REPO | ||
registry: https://$DOCKER_REGISTRY/v2 | ||
tag: $WERCKER_GIT_BRANCH-$WERCKER_GIT_COMMIT | ||
working-dir: /pipeline/source | ||
ports: 8080 | ||
cmd: sh target/bin/start | ||
|
||
#Deploy our container from the Oracle Container Registry to the Oracle Container Engine (Kubernetes) | ||
deploy-to-cluster: | ||
box: | ||
id: alpine | ||
cmd: /bin/sh | ||
|
||
steps: | ||
|
||
- bash-template | ||
|
||
- kubectl: | ||
name: delete secret | ||
server: $KUBERNETES_MASTER | ||
token: $KUBERNETES_AUTH_TOKEN | ||
insecure-skip-tls-verify: true | ||
command: delete secret wercker; echo delete registry secret | ||
|
||
- kubectl: | ||
name: create secret | ||
server: $KUBERNETES_MASTER | ||
token: $KUBERNETES_AUTH_TOKEN | ||
insecure-skip-tls-verify: true | ||
command: create secret docker-registry wercker --docker-server=$DOCKER_REGISTRY [email protected] --docker-username=$DOCKER_USERNAME --docker-password='$OCI_AUTH_TOKEN'; echo create registry secret | ||
|
||
- script: | ||
name: "Visualise Kubernetes config" | ||
code: cat kubernetes.yml | ||
|
||
- kubectl: | ||
name: deploy to kubernetes | ||
server: $KUBERNETES_MASTER | ||
token: $KUBERNETES_AUTH_TOKEN | ||
insecure-skip-tls-verify: true | ||
command: apply -f kubernetes.yml |