Fixes to pipeline
This commit is contained in:
@@ -13,4 +13,6 @@ RUN apt-get update && apt-get install -y \
|
||||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
||||
&& apt-get install -y nodejs
|
||||
|
||||
RUN npm install -g vsce
|
||||
|
||||
CMD /bin/bash
|
||||
|
||||
@@ -26,31 +26,31 @@ resources:
|
||||
uri: git@github.com:spring-projects/sts4.git
|
||||
branch: {{branch}}
|
||||
private_key: {{rsa_id}}
|
||||
- name: s3-boot-properties-vsix
|
||||
- name: s3-boot-properties-vsix-snapshot
|
||||
type: s3
|
||||
source:
|
||||
bucket: {{s3_bucket}}
|
||||
access_key_id: {{s3_accesskey}}
|
||||
secret_access_key: {{s3_secretkey}}
|
||||
region_name: {{s3_region}}
|
||||
regexp: sts4/vscode-extensions/vscode-boot-properties-(.*).vsix
|
||||
- name: s3-concourse-vsix
|
||||
regexp: sts4/vscode-extensions/snapshots/vscode-boot-properties-(.*).vsix
|
||||
- name: s3-concourse-vsix-snapshot
|
||||
type: s3
|
||||
source:
|
||||
bucket: {{s3_bucket}}
|
||||
access_key_id: {{s3_accesskey}}
|
||||
secret_access_key: {{s3_secretkey}}
|
||||
region_name: {{s3_region}}
|
||||
regexp: sts4/vscode-extensions/vscode-concourse-(.*).vsix
|
||||
- name: s3-manifest-yaml-vsix
|
||||
regexp: sts4/vscode-extensions/snapshots/vscode-concourse-(.*).vsix
|
||||
- name: s3-manifest-yaml-vsix-snapshot
|
||||
type: s3
|
||||
source:
|
||||
bucket: {{s3_bucket}}
|
||||
access_key_id: {{s3_accesskey}}
|
||||
secret_access_key: {{s3_secretkey}}
|
||||
region_name: {{s3_region}}
|
||||
regexp: sts4/vscode-extensions/vscode-manifest-yaml-(.*).vsix
|
||||
- name: website
|
||||
regexp: sts4/vscode-extensions/snapshots/vscode-manifest-yaml-(.*).vsix
|
||||
- name: snapshot-website
|
||||
type: s3-multi
|
||||
source:
|
||||
bucket: {{s3_prod_bucket}}
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
build: docker-git/concourse/docker
|
||||
get_params:
|
||||
skip_download: true
|
||||
- name: build-vsix
|
||||
- name: build-vsix-snapshots
|
||||
plan:
|
||||
- get: sts4
|
||||
trigger: true
|
||||
@@ -91,15 +91,15 @@ jobs:
|
||||
file: sts4/concourse/tasks/build-vscode-extensions.yml
|
||||
on_success:
|
||||
aggregate:
|
||||
- put: s3-manifest-yaml-vsix
|
||||
- put: s3-manifest-yaml-vsix-snapshot
|
||||
params:
|
||||
file: vsix-files/vscode-manifest-yaml-*.vsix
|
||||
acl: public-read
|
||||
- put: s3-boot-properties-vsix
|
||||
- put: s3-boot-properties-vsix-snapshot
|
||||
params:
|
||||
file: vsix-files/vscode-boot-properties-*.vsix
|
||||
acl: public-read
|
||||
- put: s3-concourse-vsix
|
||||
- put: s3-concourse-vsix-snapshot
|
||||
params:
|
||||
file: vsix-files/vscode-concourse-*.vsix
|
||||
acl: public-read
|
||||
@@ -109,35 +109,56 @@ jobs:
|
||||
channel: "@kdvolder"
|
||||
text: |
|
||||
Concourse ${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME}/${BUILD_NAME} has failed!
|
||||
- name: build-website
|
||||
- name: build-snapshot-website
|
||||
plan:
|
||||
- aggregate:
|
||||
- get: sts4
|
||||
passed:
|
||||
- build-vsix
|
||||
- get: s3-manifest-yaml-vsix
|
||||
- build-vsix-snapshots
|
||||
- get: s3-manifest-yaml-vsix-snapshot
|
||||
passed:
|
||||
- build-vsix
|
||||
- build-vsix-snapshots
|
||||
trigger: true
|
||||
- get: s3-boot-properties-vsix
|
||||
- get: s3-boot-properties-vsix-snapshot
|
||||
passed:
|
||||
- build-vsix
|
||||
- build-vsix-snapshots
|
||||
trigger: true
|
||||
- get: s3-concourse-vsix
|
||||
- get: s3-concourse-vsix-snapshot
|
||||
passed:
|
||||
- build-vsix
|
||||
- build-vsix-snapshots
|
||||
trigger: true
|
||||
- task: build-website
|
||||
file: sts4/concourse/tasks/build-website.yml
|
||||
- put: website
|
||||
- put: snapshot-website
|
||||
params:
|
||||
path: website
|
||||
# - name: publish-vscode-manifest-yaml
|
||||
# plan:
|
||||
# - aggregate:
|
||||
# - get: sts4
|
||||
# # passed:
|
||||
# # - build-vsix
|
||||
# - get: s3-manifest-yaml-vsix-snapshot
|
||||
# passed:
|
||||
# - build-vsix-snapshots
|
||||
# - task: vsce-publish-manifest-yaml
|
||||
# file: sts4/concourse/tasks/vsce-publish.yml
|
||||
# input_mapping:
|
||||
# vsix-resource: s3-manifest-yaml-vsix-snapshot
|
||||
# params:
|
||||
# extension_id: vscode-manifest-yaml
|
||||
# vsce_publisher: {{vsce_publisher}}
|
||||
# vsce_token: {{vsce_token}}
|
||||
# - put: sts4
|
||||
# params:
|
||||
# repository: sts4-out
|
||||
|
||||
####################################
|
||||
groups:
|
||||
- name: main
|
||||
jobs:
|
||||
- build-vsix
|
||||
- build-website
|
||||
- name: docker
|
||||
jobs:
|
||||
- build-docker-image
|
||||
# groups:
|
||||
# - name: main
|
||||
# jobs:
|
||||
# - build-vsix
|
||||
# - build-snapshot-website
|
||||
# - name: docker
|
||||
# jobs:
|
||||
# - build-docker-image
|
||||
|
||||
99
concourse/release-pipeline.yml
Normal file
99
concourse/release-pipeline.yml
Normal file
@@ -0,0 +1,99 @@
|
||||
resource_types:
|
||||
- name: slack-notification
|
||||
type: docker-image
|
||||
source:
|
||||
repository: cfcommunity/slack-notification-resource
|
||||
tag: latest
|
||||
###################################################
|
||||
resources:
|
||||
- name: sts4
|
||||
type: git
|
||||
source:
|
||||
uri: git@github.com:spring-projects/sts4.git
|
||||
branch: {{branch}}
|
||||
private_key: {{rsa_id}}
|
||||
tag_filter: vscode-manifest-yaml-*-RC*
|
||||
- name: s3-vscode-manifest-yaml-vsix
|
||||
type: s3
|
||||
source:
|
||||
bucket: {{s3_bucket}}
|
||||
access_key_id: {{s3_accesskey}}
|
||||
secret_access_key: {{s3_secretkey}}
|
||||
region_name: {{s3_region}}
|
||||
regexp: sts4/vscode-extensions/releases/vscode-manifest-yaml-(.*).vsix
|
||||
- name: slack-notification
|
||||
type: slack-notification
|
||||
source:
|
||||
url: https://hooks.slack.com/services/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
|
||||
######################################################
|
||||
jobs:
|
||||
- name: build-vscode-manifest-yaml-release
|
||||
plan:
|
||||
- get: sts4
|
||||
trigger: true
|
||||
- task: build-vsix
|
||||
file: sts4/concourse/tasks/build-vsix.yml
|
||||
params:
|
||||
extension_id: vscode-manifest-yaml
|
||||
dist_type: release
|
||||
on_failure:
|
||||
put: slack-notification
|
||||
params:
|
||||
channel: "@kdvolder"
|
||||
text: |
|
||||
Concourse ${BUILD_PIPELINE_NAME}/${BUILD_NAME}/${BUILD_JOB_NAME} has failed!
|
||||
- put: s3-vscode-manifest-yaml-vsix
|
||||
params:
|
||||
file: out/*.vsix
|
||||
acl: public-read
|
||||
- name: publish-vscode-manifest-yaml-release
|
||||
plan:
|
||||
- do:
|
||||
- get: sts4
|
||||
passed:
|
||||
- build-vscode-manifest-yaml-release
|
||||
- get: s3-vscode-manifest-yaml-vsix
|
||||
passed:
|
||||
- build-vscode-manifest-yaml-release
|
||||
- task: publish-vscode-manifest-yaml-release
|
||||
file: sts4/concourse/tasks/vsce-publish.yml
|
||||
input_mapping:
|
||||
vsix-resource: s3-vscode-manifest-yaml-vsix
|
||||
params:
|
||||
vsce_publisher: {{vsce_publisher}}
|
||||
vsce_token: {{vsce_token}}
|
||||
extension_id: vscode-manifest-yaml
|
||||
- put: sts4
|
||||
params:
|
||||
repository: sts4-out
|
||||
only_tag: true
|
||||
on_failure:
|
||||
put: slack-notification
|
||||
params:
|
||||
channel: "@kdvolder"
|
||||
text: |
|
||||
Concourse ${BUILD_PIPELINE_NAME}/${BUILD_NAME}/${BUILD_JOB_NAME} has failed!
|
||||
- name: bump-vscode-manifest-yaml-version
|
||||
serial: true
|
||||
plan:
|
||||
- do:
|
||||
- get: sts4
|
||||
passed:
|
||||
- publish-vscode-manifest-yaml-release
|
||||
- task: bump-vscode-manifest-yaml-version
|
||||
file: sts4/concourse/tasks/bump-version.yml
|
||||
params:
|
||||
extension_id: vscode-manifest-yaml
|
||||
- put: sts4
|
||||
timeout: 5m
|
||||
params:
|
||||
repository: sts4-out
|
||||
rebase: true
|
||||
on_failure:
|
||||
put: slack-notification
|
||||
params:
|
||||
channel: "@kdvolder"
|
||||
text: |
|
||||
Concourse ${BUILD_PIPELINE_NAME}/${BUILD_NAME}/${BUILD_JOB_NAME} has failed!
|
||||
|
||||
|
||||
13
concourse/set-release-pipeline.sh
Executable file
13
concourse/set-release-pipeline.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -d "../vscode-extensions/$extension_id" ]; then
|
||||
echo "ERROR: ../vscode-extensions/$extension_id is not a directory"
|
||||
fi
|
||||
|
||||
branch=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
fly -t tools set-pipeline \
|
||||
--var "branch=${branch}" \
|
||||
--load-vars-from ${HOME}/.sts4-concourse-credentials.yml \
|
||||
-p "sts4-release-${branch}" \
|
||||
-c release-pipeline.yml
|
||||
39
concourse/tasks/build-vsix.sh
Executable file
39
concourse/tasks/build-vsix.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
workdir=`pwd`
|
||||
sources=$workdir/sts4/vscode-extensions/$extension_id
|
||||
|
||||
cd ${sources}/../commons-vscode
|
||||
npm install
|
||||
|
||||
cd "$sources"
|
||||
|
||||
npm install ../commons-vscode
|
||||
|
||||
timestamp=`date -u +%Y%m%d%H%M`
|
||||
|
||||
if [ "$dist_type" != release ]; then
|
||||
# for snapshot build, work the timestamp into package.json version qualifier
|
||||
base_version=`jq -r .version package.json`
|
||||
qualified_version=${base_version}-${timestamp}
|
||||
npm version ${qualified_version}
|
||||
fi
|
||||
|
||||
npm install
|
||||
npm run vsce-package
|
||||
|
||||
# for release build we don't don't add version-qualifier to package.json
|
||||
# So we must instead rename the file ourself to add a qualifier
|
||||
if [ "$dist_type" == release ]; then
|
||||
vsix_file=`ls *.vsix`
|
||||
release_name=`git describe --tags`
|
||||
echo "release_name=$release_name"
|
||||
if [ -z "$release_name" ]; then
|
||||
echo "Release Candidates must be tagged" >&2
|
||||
exit 1
|
||||
else
|
||||
mv $vsix_file ${release_name}.vsix
|
||||
fi
|
||||
fi
|
||||
|
||||
cp *.vsix $workdir/out
|
||||
11
concourse/tasks/build-vsix.yml
Normal file
11
concourse/tasks/build-vsix.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
inputs:
|
||||
- name: sts4
|
||||
outputs:
|
||||
- name: out
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: docker-image
|
||||
source:
|
||||
repository: kdvolder/sts4-build-env
|
||||
run:
|
||||
path: sts4/concourse/tasks/build-vsix.sh
|
||||
@@ -3,33 +3,34 @@ set -e
|
||||
workdir=`pwd`
|
||||
sources=$workdir/sts4/eclipse-distribution/common/html
|
||||
target=$workdir/website
|
||||
# consider passing this in from pipeline as a env var if we are also going to use it for 'release' builds
|
||||
dist_type=snapshot
|
||||
|
||||
#cp -r "${sources}/stylesheet.css" "$target"
|
||||
#cp -r ${sources}/*.js "$target"
|
||||
#cp s3-manifest-yaml-vsix/*.vsix "$target"
|
||||
#cp s3-boot-properties-vsix/*.vsix "$target"
|
||||
|
||||
export vscode_manifest_yaml=$(basename s3-manifest-yaml-vsix/*.vsix)
|
||||
export vscode_manifest_yaml=$(basename s3-manifest-yaml-vsix-${dist_type}/*.vsix)
|
||||
echo "vscode_manifest_yaml=$vscode_manifest_yaml"
|
||||
export vscode_boot_properties=$(basename s3-boot-properties-vsix/*.vsix)
|
||||
export vscode_boot_properties=$(basename s3-boot-properties-vsix-${dist_type}/*.vsix)
|
||||
echo "vscode_boot_properties=$vscode_boot_properties"
|
||||
export vscode_concourse=$(basename s3-concourse-vsix/*.vsix)
|
||||
export vscode_concourse=$(basename s3-concourse-vsix-${dist_type}/*.vsix)
|
||||
echo "vscode_concourse=$vscode_concourse"
|
||||
|
||||
envsubst > "$target/vscode-extensions-snippet.html" << XXXXXX
|
||||
<ul>
|
||||
<li>Spring Boot Property Language Server:
|
||||
<a href="http://s3-test.spring.io/sts4/vscode-extensions/${vscode_boot_properties}">${vscode_boot_properties}</a>
|
||||
<a href="http://s3-test.spring.io/sts4/vscode-extensions/${dist_type}/${vscode_boot_properties}">${vscode_boot_properties}</a>
|
||||
</li>
|
||||
<li>Cloud Foundry Manifest Language Server:
|
||||
<a href="http://s3-test.spring.io/sts4/vscode-extensions/${vscode_manifest_yaml}">${vscode_manifest_yaml}</a>
|
||||
<a href="http://s3-test.spring.io/sts4/vscode-extensions/${dist_type}/${vscode_manifest_yaml}">${vscode_manifest_yaml}</a>
|
||||
</li>
|
||||
<li>Concourse CI Language Server:
|
||||
<a href="http://s3-test.spring.io/sts4/vscode-extensions/${vscode_concourse}">${vscode_concourse}</a>
|
||||
<a href="http://s3-test.spring.io/sts4/vscode-extensions/${dist_type}/${vscode_concourse}">${vscode_concourse}</a>
|
||||
</li>
|
||||
</ul>
|
||||
XXXXXX
|
||||
|
||||
export vscode_snippet=`cat "$target/vscode-extensions-snippet.html"`
|
||||
|
||||
envsubst > "$target/vscode-extensions.html" << XXXXXX
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
inputs:
|
||||
- name: sts4
|
||||
- name: s3-manifest-yaml-vsix
|
||||
- name: s3-boot-properties-vsix
|
||||
- name: s3-concourse-vsix
|
||||
- name: s3-manifest-yaml-vsix-snapshot
|
||||
- name: s3-boot-properties-vsix-snapshot
|
||||
- name: s3-concourse-vsix-snapshot
|
||||
outputs:
|
||||
- name: website
|
||||
platform: linux
|
||||
|
||||
25
concourse/tasks/bump-version.sh
Executable file
25
concourse/tasks/bump-version.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
workdir=`pwd`
|
||||
|
||||
echo "extension_id=$extension_id"
|
||||
|
||||
sources=$workdir/sts4/vscode-extensions/$extension_id
|
||||
release_version=`jq -r .version ${sources}/package.json`
|
||||
|
||||
echo "release_version=$release_version"
|
||||
|
||||
cd $sources
|
||||
|
||||
echo "Bumping version of ${extension_id}"
|
||||
echo "release_version=${release_version}"
|
||||
npm version patch
|
||||
|
||||
new_version=`jq -r .version ${sources}/package.json`
|
||||
echo "new_version=${new_version}"
|
||||
|
||||
git commit \
|
||||
-m "Bump version of ${extension_id} to ${new_version}" \
|
||||
--author 'Kris De Volder <kdevolder@pivotal.io>'
|
||||
|
||||
git clone $workdir/sts4 $workdir/sts4-out
|
||||
11
concourse/tasks/bump-version.yml
Normal file
11
concourse/tasks/bump-version.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
inputs:
|
||||
- name: sts4
|
||||
outputs:
|
||||
- name: sts4-out
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: docker-image
|
||||
source:
|
||||
repository: kdvolder/sts4-build-env
|
||||
run:
|
||||
path: sts4/concourse/tasks/bump-version.sh
|
||||
30
concourse/tasks/vsce-publish.sh
Executable file
30
concourse/tasks/vsce-publish.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
workdir=`pwd`
|
||||
|
||||
vsix_file=`ls ${workdir}/vsix-resource/*.vsix`
|
||||
|
||||
echo "vsix_file=$vsix_file"
|
||||
echo "extension_id=$extension_id"
|
||||
|
||||
sources=$workdir/sts4/vscode-extensions/$extension_id
|
||||
|
||||
release_version=`jq -r .version ${sources}/package.json`
|
||||
|
||||
echo "release_version=$release_version"
|
||||
|
||||
vsce publish -p $vsce_token --packagePath "$vsix_file"
|
||||
|
||||
echo "****************************************************************"
|
||||
echo "****************************************************************"
|
||||
echo "****************************************************************"
|
||||
echo "*** $extension_id $version published to vscode marketplace *****"
|
||||
echo "****************************************************************"
|
||||
echo "****************************************************************"
|
||||
echo "****************************************************************"
|
||||
|
||||
cd $sources
|
||||
|
||||
echo "Tagging release"
|
||||
git tag ${extension_id}-${release_version}-RELEASE
|
||||
git clone $workdir/sts4 $workdir/sts4-out
|
||||
13
concourse/tasks/vsce-publish.yml
Normal file
13
concourse/tasks/vsce-publish.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
inputs:
|
||||
- name: sts4
|
||||
- name: vsix-resource
|
||||
outputs:
|
||||
- name: sts4-out
|
||||
- name: website
|
||||
platform: linux
|
||||
image_resource:
|
||||
type: docker-image
|
||||
source:
|
||||
repository: kdvolder/sts4-build-env
|
||||
run:
|
||||
path: sts4/concourse/tasks/vsce-publish.sh
|
||||
18
vscode-extensions/vscode-manifest-yaml/trigger-rc-build.sh
Executable file
18
vscode-extensions/vscode-manifest-yaml/trigger-rc-build.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: ./trigger-rc-build.sh ${RC_TAG}"
|
||||
echo "Where RC_TAG is one of RC1, RC2, etc."
|
||||
fi
|
||||
|
||||
rc_tag=$1
|
||||
workdir=`pwd`
|
||||
extension_id=$(basename "$workdir")
|
||||
version=`jq -r .version package.json`
|
||||
tag=${extension_id}-${version}-${rc_tag}
|
||||
|
||||
echo "Tagging head as tag=$tag"
|
||||
git tag $tag
|
||||
echo "Pushing tag..."
|
||||
git push origin $tag
|
||||
Reference in New Issue
Block a user