Skip to content

Commit 19a90e7

Browse files
author
Irfan Habib
authored
Merge pull request #14 from cloudfoundry-incubator/alpha-releases-pipeline
Alpha releases pipeline
2 parents 7990be7 + 467b073 commit 19a90e7

File tree

4 files changed

+91
-9
lines changed

4 files changed

+91
-9
lines changed

deploy/ci/console-dev-releases.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ resources:
5555
source:
5656
bucket: concourse-stratos-ui
5757
endpoint: {{minio-server-endpoint}}
58-
regexp: temp-artifacts/console-v2-(?P<version>.*).tgz
58+
regexp: temp-artifacts/console-v2-alpha-(?P<version>.*).tgz
5959
access_key_id: {{minio-access-key}}
6060
secret_access_key: {{minio-secret-access-key}}
6161
region_name: eu-central-1
@@ -67,10 +67,6 @@ jobs:
6767
- do:
6868
- task: generate-tag
6969
file: stratos/deploy/ci/tasks/dev-releases/generate-tag-files.yml
70-
params:
71-
DOCKER_USERNAME: ((docker-username))
72-
DOCKER_PASSWORD: ((docker-password))
73-
BASE_IMAGE: opensuse
7470
- put: image-tag
7571
params:
7672
file: image-tag/v2-alpha-tag
@@ -117,13 +113,15 @@ jobs:
117113
- task: build
118114
privileged: true
119115
timeout: 30m
120-
file: stratos/deploy/ci/tasks/release/create-chart.yml
116+
file: stratos/deploy/ci/tasks/dev-releases/create-chart.yml
121117
params:
122118
GIT_USER: ((concourse-user))
123119
GIT_EMAIL: ((concourse-email))
124120
GITHUB_ORG: ((github-organization))
125121
GITHUB_REPO: ((github-repository))
126122
GIT_PRIVATE_KEY: ((github-private-key))
123+
DOCKER_ORG: ((artifact-docker-organization))
124+
DOCKER_REGISTRY: ((artifact-docker-registry))
127125
- put: helm-chart-tarball
128126
params:
129127
file: helm-chart/*.tgz
@@ -139,7 +137,7 @@ jobs:
139137
- task: build
140138
privileged: true
141139
timeout: 30m
142-
file: stratos/deploy/ci/tasks/release/update-gh-release.yml
140+
file: stratos/deploy/ci/tasks/dev-releases/update-gh-release.yml
143141
params:
144142
GITHUB_TOKEN: ((github-access-token))
145143
CHANDLER_GITHUB_API_TOKEN: ((github-access-token))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
platform: linux
3+
inputs:
4+
- name: stratos
5+
- name: image-tag
6+
outputs:
7+
- name: helm-chart
8+
image_resource:
9+
type: docker-image
10+
source:
11+
# Generated using Dockerfile.stratos-helm
12+
repository: splatform/ci-stratos-helm
13+
tag: "latest"
14+
15+
run:
16+
path: sh
17+
args:
18+
- -exc
19+
- |
20+
# Expect this command to fail since k8s isn't available but it will initialise helm locally
21+
helm init || true
22+
ROOT_DIR=$PWD
23+
STRATOS=${ROOT_DIR}/stratos
24+
IMAGE_TAG=$(cat image-tag/v2-alpha-tag)
25+
cd ${STRATOS}/deploy/kubernetes/
26+
GIT_TAG="2.0.0-alpha-${IMAGE_TAG}"
27+
sed -i -e 's/consoleVersion: latest/consoleVersion: '"${GIT_TAG}"'/g' console/values.yaml
28+
sed -i -e 's/organization: splatform/organization: '"${DOCKER_ORG}"'/g' console/values.yaml
29+
sed -i -e 's/hostname: docker.io/hostname: '"${DOCKER_REGISTRY}"'/g' console/values.yaml
30+
31+
sed -i -e 's/version: 0.1.0/version: '"${GIT_TAG}"'/g' console/Chart.yaml
32+
33+
# Generate Helm package
34+
helm package console
35+
cp console*.tgz ${ROOT_DIR}/helm-chart/console-helm-chart-${GIT_TAG}.tgz
36+
cd ${ROOT_DIR}/helm-chart/
37+
if [ -f ${STRATOS}/dev/index.yaml ]; then
38+
cp ${STRATOS}/dev/index.yaml ${ROOT_DIR}/helm-chart/
39+
MERGE_INDEX="--merge index.yaml"
40+
fi
41+
42+
# Update Helm Repository
43+
helm repo index ./ ${MERGE_INDEX} --url https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/${GIT_TAG}/
44+
cp index.yaml ${STRATOS}/
45+
cd ${STRATOS}
46+
git config --global user.name ${GIT_USER}
47+
git config --global user.email ${GIT_EMAIL}
48+
49+
mkdir -p /root/.ssh/
50+
echo "${GIT_PRIVATE_KEY}" > /root/.ssh/id_rsa
51+
chmod 600 /root/.ssh/id_rsa
52+
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
53+
# Commit Helm Repository change
54+
git add dev/index.yaml
55+
git commit -m "Helm repository updated for tag: ${GIT_TAG}"
56+
git config --global push.default simple
57+
git push origin HEAD:master

deploy/ci/tasks/dev-releases/generate-tag-files.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ outputs:
77
image_resource:
88
type: docker-image
99
source:
10-
repository: ci-registry.capbristol.com:5000/stratos-concourse
10+
repository: splatform/ci-stratos-concourse
1111
tag: "latest"
12-
insecure_registries: [ "ci-registry.capbristol.com:5000" ]
1312

1413
run:
1514
path: bash
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
platform: linux
3+
inputs:
4+
- name: stratos-ui
5+
- name: helm-chart-tarball
6+
image_resource:
7+
type: docker-image
8+
source:
9+
repository: splatform/ci-stratos-github-release
10+
tag: "latest"
11+
12+
run:
13+
path: sh
14+
args:
15+
- -exc
16+
- |
17+
# Create Github release
18+
ROOT_DIR=${PWD}
19+
cd ${ROOT_DIR}/stratos-ui
20+
GIT_TAG="$(git describe $(git rev-list --tags --max-count=1))"
21+
github-release release --tag ${GIT_TAG}
22+
cd ${ROOT_DIR}/helm-chart-tarball
23+
CHART_PACKAGE=$(ls *.tgz)
24+
# Upload Helm chart to release
25+
github-release upload -t ${GIT_TAG} --file ${CHART_PACKAGE} --name "console-helm-chart-${GIT_TAG}.tgz"
26+
# Sync changelog
27+
cd ${ROOT_DIR}/stratos-ui
28+
chandler push ${GIT_TAG}

0 commit comments

Comments
 (0)