Skip to content

Commit

Permalink
Fix uploading container archive to S3 + minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed Oct 9, 2019
1 parent 68a43c5 commit d3013a8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/part-06/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ statefulset.apps/github-controller-manager created
Install Tekton with Dashboard and Webhooks:

```bash
kubectl apply --filename https://storage.googleapis.com/tekton-releases/latest/release.yaml
kubectl apply --filename https://github.com/tektoncd/pipeline/releases/download/v0.7.0/release.yaml
kubectl apply --filename https://github.com/tektoncd/dashboard/releases/download/v0.2.0/release.yaml
kubectl apply -n tekton-pipelines --filename https://github.com/tektoncd/dashboard/releases/download/v0.2.0/webhooks-extension_release.yaml
```
Expand Down
42 changes: 22 additions & 20 deletions docs/part-07/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ Create secret for Harbor registry to let Tekton pipeline to upload the container
image:

```bash
kubectl create secret docker-registry ${CONTAINER_REGISTRY_SERVER_MODIFIED}-docker-config --docker-server="${CONTAINER_REGISTRY_SERVER}" --docker-username="${CONTAINER_REGISTRY_USERNAME}" --docker-password="${CONTAINER_REGISTRY_PASSWORD}"
kubectl create secret docker-registry ${CONTAINER_REGISTRY_SERVER_MODIFIED}-docker-config \
--docker-server="${CONTAINER_REGISTRY_SERVER}" \
--docker-username="${CONTAINER_REGISTRY_USERNAME}" \
--docker-password="${CONTAINER_REGISTRY_PASSWORD}"
```

Output:
Expand Down Expand Up @@ -119,6 +122,7 @@ spec:
- /kaniko/executor
args:
- --dockerfile=\$(inputs.params.pathToDockerFile)
- --destination=\$(outputs.resources.builtImage.url)
- --context=\$(inputs.params.pathToContext)
- --single-snapshot
- --tarPath=/shared-storage/${USER}-app-build.tar
Expand All @@ -128,27 +132,9 @@ spec:
mountPath: /builder/home/.docker/
- name: shared-storage
mountPath: /shared-storage
- name: build-and-push
image: gcr.io/kaniko-project/executor
env:
- name: "DOCKER_CONFIG"
value: "/builder/home/.docker/"
command:
- /kaniko/executor
args:
- --dockerfile=\$(inputs.params.pathToDockerFile)
- --destination=\$(outputs.resources.builtImage.url)
- --context=\$(inputs.params.pathToContext)
- --single-snapshot
- --skip-tls-verify
volumeMounts:
- name: docker-config
mountPath: /builder/home/.docker/
- name: shared-storage
mountPath: /shared-storage
- name: upload-container-content-s3
image: atlassian/pipelines-awscli
command: ["sh", "-c", "aws s3 cp /shared-storage/${USER}-app-build.tar s3://${USER}-kops-k8s/"]
command: ["sh", "-x", "-c", "ls -la /shared-storage/ ; aws s3 cp /shared-storage/${USER}-app-build.tar s3://${USER}-kops-k8s/"]
env:
- name: AWS_DEFAULT_REGION
value: "eu-central-1"
Expand All @@ -165,6 +151,22 @@ spec:
volumeMounts:
- name: shared-storage
mountPath: /shared-storage
- name: build-and-push
image: gcr.io/kaniko-project/executor
env:
- name: "DOCKER_CONFIG"
value: "/builder/home/.docker/"
command:
- /kaniko/executor
args:
- --dockerfile=\$(inputs.params.pathToDockerFile)
- --destination=\$(outputs.resources.builtImage.url)
- --context=\$(inputs.params.pathToContext)
- --single-snapshot
- --skip-tls-verify
volumeMounts:
- name: docker-config
mountPath: /builder/home/.docker/
---
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
Expand Down
2 changes: 1 addition & 1 deletion run-k8s-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ DEMO_PROMPT="${GREEN}➜ ${CYAN}$ "

[ ! -d .git ] && git clone --quiet https://github.com/ruzickap/k8s-knative-gitlab-harbor && cd k8s-knative-gitlab-harbor

sed docs/part-0{1..7}/README.md \
sed docs/part-0{1..8}/README.md \
-e '/^## Configure AWS/,/^Create policy allowing the cert-manager to change Route 53 settings./d' \
| \
sed -n '/^```bash.*/,/^```$/p' \
Expand Down

0 comments on commit d3013a8

Please sign in to comment.