generated from ibm-developer-skills-network/aolwx-devops-capstone-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker commands.txt
48 lines (35 loc) · 1.41 KB
/
docker commands.txt
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
docker run --name accounts-cont --rm \
-p 8080:8080 \
--link postgresql \
-e DATABASE_URI=postgresql://postgres:postgres@postgresql:5432/postgres \
accounts
this doesnot create a deployment (--dry-run=client) and instead redirects to yaml file
oc create deployment accounts \
--image=us.icr.io/$SN_ICR_NAMESPACE/accounts:1 \
--replicas=3 \
--dry-run=client -o yaml > deploy/deployment.yaml
oc describe secret postgresql
oc create -f deploy/deployment.yaml
oc expose deploy accounts \
--type=ClusterIP \
--port=8080 \
--dry-run=client -o yaml > deploy/service.yaml
oc create route edge accounts --service=accounts -> expose your service using an OpenShift route
oc get routes
oc create -f tekton/pvc.yaml
oc apply -f tekton/tasks.yaml
oc apply -f tekton/pipeline.yaml
tkn hub install task git-clone
# to start a piplinerun
tkn pipeline start cd-pipeline \
-p repo-url="https://github.com/$GITHUB_ACCOUNT/devops-capstone-project.git" \
-p branch=main \
-p build-image=image-registry.openshift-image-registry.svc:5000/$SN_ICR_NAMESPACE/accounts:1 \
-w name=pipeline-workspace,claimName=pipelinerun-pvc \
-s pipeline \
--showlog
# to list pipelines
tkn pipelinerun ls
tkn pr logs --last #shows logs for the lastest run, if --last flag is not especified the name of the run must be passed
tkn hub install task flake8
tkn clustertask ls # to check tekton hub tasks installed at cluster level