-
Notifications
You must be signed in to change notification settings - Fork 3
/
wercker.yml
62 lines (56 loc) · 2.14 KB
/
wercker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
no-response-timeout: 15
box: combient/java-mvn
build:
steps:
- script:
name: Maven build - MBean Sample application
code: mvn clean package
build-domain-in-home-image:
box:
id: alpine
cmd: /bin/sh
docker: true
steps:
- script:
name: Install curl and docker
code: apk --no-cache add curl docker
- script:
name: Build docker image
code: |
docker login $REGION.ocir.io -u $TENANCY/$OCI_REGISTRY_USERNAME -p $OCI_REGISTRY_PASSWORD
if docker pull $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:latest; then
docker build --file Dockerfile.update \
--build-arg SOURCEIMAGE=$REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:latest \
--force-rm=true \
-t $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:$WERCKER_GIT_COMMIT \
-t $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:latest .
else
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
docker build --file Dockerfile.create \
--force-rm=true \
-t $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:$WERCKER_GIT_COMMIT \
-t $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:latest .
fi
- script:
name: Push the image to a repository
code: |
docker login $REGION.ocir.io -u $TENANCY/$OCI_REGISTRY_USERNAME -p $OCI_REGISTRY_PASSWORD
docker push $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:$WERCKER_GIT_COMMIT
docker push $REGION.ocir.io/$TENANCY/$WERCKER_APPLICATION_NAME:latest
deploy-to-cluster:
box:
id: alpine
cmd: /bin/sh
steps:
- bash-template
- script:
name: "Visualise Kubernetes config"
working-dir: /pipeline/source
code: cat domainKube.yaml
- kubectl:
name: deploy to kubernetes
server: $KUBERNETES_MASTER
token: $KUBERNETES_AUTH_TOKEN
insecure-skip-tls-verify: true
working-dir: /pipeline/source
command: apply -f domainKube.yaml