-
Notifications
You must be signed in to change notification settings - Fork 12
54 lines (47 loc) · 2.16 KB
/
deploy-netcandystore.yml
File metadata and controls
54 lines (47 loc) · 2.16 KB
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
name: deploy-netcandystore
on:
workflow_dispatch:
inputs:
region:
description: 'AWS Region'
required: true
s3_storage:
description: 'AWS S3 storage bucket name'
required: true
clusterConfigName:
description: 'Folder name of cluster config in S3 to pull down for auth. Example: ocp-[run_number]'
required: true
jobs:
deploy-netcandystore-containers:
runs-on: macos-latest
env:
temp_dir: "temp-${{ github.run_number }}"
steps:
- name: "Checkout ${{ github.ref }}"
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Install OpenShift CLI
uses: redhat-actions/oc-installer@v1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: "${{ github.event.inputs.region }}"
- name: Get cluster metadata files from S3
shell: bash
run: |
mkdir -p ./${{ env.temp_dir }}
echo "Downloading ${{ github.event.inputs.clusterConfigName }} metadata files from S3..."
aws s3 sync s3://${{ github.event.inputs.s3_storage }}/${{ github.event.inputs.clusterConfigName }} ./${{ env.temp_dir }} --region ${{ github.event.inputs.region }}
- name: Helm install netcandystore
shell: bash
run: |
export KUBECONFIG=$(pwd)/${{ env.temp_dir }}/auth/kubeconfig
oc login -u ${{ secrets.OC_USER }} -p ${{ secrets.OC_PASSWORD }}
echo "fetch netcandystore from people.redhat.com"
helm fetch http://people.redhat.com/chernand/netcandystore-1.0.1.tgz
export WSSHKEY=$(oc get secret cloud-private-key -n openshift-windows-machine-config-operator -o jsonpath='{.data.private-key\.pem}')
export WNODE=$(oc get nodes -l kubernetes.io/os=windows -o jsonpath='{.items[0].metadata.name}')
helm install ncs --namespace netcandystore --create-namespace --timeout=1200s ./netcandystore-1.0.1.tgz --set ssh.hostkey=${WSSHKEY} --set ssh.hostname=${WNODE}