Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
philwebb committed Feb 10, 2021
1 parent 5cef85c commit 6cda97e
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 77 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM ubuntu:bionic-20181018
FROM ubuntu:focal-20210119

ARG root=.
ARG jar=target/artifactory-resource.jar

COPY ${root}/assets/ /opt/resource/
COPY ${jar} /artifact/artifactory-resource.jar


RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install --no-install-recommends -y ca-certificates curl
RUN apt-get install --no-install-recommends -y tzdata ca-certificates curl
RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime
RUN dpkg-reconfigure --frontend noninteractive tzdata
RUN rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME /opt/openjdk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic-20181018
FROM ubuntu:focal-20210119

ADD setup.sh /setup.sh
RUN ./setup.sh
Expand Down
9 changes: 6 additions & 3 deletions ci/images/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ set -ex
# UTILS
###########################################################

export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install --no-install-recommends -y ca-certificates net-tools libxml2-utils git curl
apt-get install --no-install-recommends -y tzdata ca-certificates net-tools libxml2-utils git curl
ln -fs /usr/share/zoneinfo/UTC /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
rm -rf /var/lib/apt/lists/*

curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.2/concourse-java.sh > /opt/concourse-java.sh
curl https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh > /opt/concourse-java.sh


###########################################################
# JAVA
###########################################################
JDK_URL="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b04/OpenJDK8U-jdk_x64_linux_hotspot_8u212b04.tar.gz"
JDK_URL="https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u282-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u282b08.tar.gz"

mkdir -p /opt/openjdk
cd /opt/openjdk
Expand Down
98 changes: 59 additions & 39 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
resource_types:
- name: registry-image
type: registry-image
source:
repository: concourse/registry-image-resource
tag: 1.1.0
resources:
- name: git-repo
type: git
icon: github
source:
uri: https://github.com/spring-io/artifactory-resource
username: ((github-username))
Expand All @@ -9,90 +16,103 @@ resources:
ignore_paths: ["ci/images/*"]
- name: ci-images-git-repo
type: git
icon: github
source:
uri: https://github.com/spring-io/artifactory-resource
branch: master
paths: ["ci/images/*"]
- name: artifactory-resource-ci-image
type: docker-image
- name: ci-image
type: registry-image
icon: docker
source:
repository: springci/artifactory-resource-ci-image
repository: springci/artifactory-resource-ci
username: ((docker-hub-username))
password: ((docker-hub-password))
tag: master
- name: artifactory-resource-image
type: docker-image
type: registry-image
icon: docker
source:
repository: springio/artifactory-resource
username: ((docker-hub-username))
password: ((docker-hub-password))
- name: github-release
type: github-release
icon: briefcase-download
source:
owner: spring-io
repository: artifactory-resource
access_token: ((github-ci-release-token))
jobs:
- name: build-artifactory-resource-ci-image
- name: build-ci-image
plan:
- get: ci-images-git-repo
trigger: true
- put: artifactory-resource-ci-image
- get: git-repo
- task: build-ci-image
privileged: true
file: git-repo/ci/tasks/build-ci-image.yml
output_mapping:
image: ci-image
vars:
ci-image-name: ci-image
- put: ci-image
params:
build: ci-images-git-repo/ci/images
dockerfile: ci-images-git-repo/ci/images/artifactory-resource-ci-image/Dockerfile
image: ci-image/image.tar
- name: build
public: true
plan:
- get: artifactory-resource-ci-image
- get: ci-image
- get: git-repo
trigger: true
- task: build
image: artifactory-resource-ci-image
image: ci-image
file: git-repo/ci/tasks/build.yml
- load_var: artifact-version
file: built-artifact/version
reveal: true
- task: build-artifactory-resource-image
privileged: true
file: git-repo/ci/tasks/build-artifactory-resource-image.yml
output_mapping:
image: artifactory-resource-image
- put: artifactory-resource-image
params:
build: .
dockerfile: git-repo/Dockerfile
tag: built-artifact/version
build_args:
root: git-repo
jar: built-artifact/artifactory-resource.jar
version: ((.:artifact-version))
image: artifactory-resource-image/image.tar
- name: release
plan:
- get: artifactory-resource-ci-image
- get: ci-image
- get: git-repo
passed: [build]
trigger: false
- task: release
image: artifactory-resource-ci-image
image: ci-image
file: git-repo/ci/tasks/release.yml
- task: generate-release-notes
file: git-repo/ci/tasks/generate-release-notes.yml
params:
GITHUB_USERNAME: ((github-username))
GITHUB_TOKEN: ((github-ci-release-token))
- load_var: artifact-version
file: built-artifact/version
reveal: true
- task: build-artifactory-resource-image
privileged: true
file: git-repo/ci/tasks/build-artifactory-resource-image.yml
output_mapping:
image: artifactory-resource-image
- task: generate-changelog
file: git-repo/ci/tasks/generate-changelog.yml
- put: git-repo
params:
repository: release-git-repo
- put: artifactory-resource-image
params:
build: .
dockerfile: git-repo/Dockerfile
tag: built-artifact/version
build_args:
root: git-repo
jar: built-artifact/artifactory-resource.jar
version: ((.:artifact-version))
image: artifactory-resource-image/image.tar
- put: github-release
params:
name: generated-release-notes/tag
tag: generated-release-notes/tag
body: generated-release-notes/release-notes.md
name: generated-changelog/tag
tag: generated-changelog/tag
body: generated-changelog/changelog.md
groups:
- name: "Build"
jobs:
- build
- release
- name: "CI Images"
jobs:
- build-artifactory-resource-ci-image
- name: "builds"
jobs: ["build", "release"]
- name: "ci-image"
jobs: ["build-ci-image"]
11 changes: 11 additions & 0 deletions ci/scripts/generate-changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e

version=$( cat built-artifact/version )

java -jar /github-changelog-generator.jar \
--changelog.repository=spring-io/artifactory-resource \
${version} generated-changelog/changelog.md

echo ${version} > generated-changelog/version
echo v${version} > generated-changelog/tag
14 changes: 0 additions & 14 deletions ci/scripts/generate-release-notes.sh

This file was deleted.

29 changes: 29 additions & 0 deletions ci/tasks/build-artifactory-resource-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: vito/oci-build-task
inputs:
- name: git-repo
- name: built-artifact
outputs:
- name: image
caches:
- path: artifactory-resource-image-cache
params:
DOCKERFILE: git-repo/Dockerfile
BUILD_ARG_jar: built-artifact/artifactory-resource.jar
BUILD_ARG_root: git-repo
DOCKER_HUB_AUTH: ((docker-hub-auth))
REGISTRY_MIRRORS: ((docker-hub-mirror))
run:
path: /bin/sh
args:
- "-c"
- |
mkdir -p /root/.docker
cat > /root/.docker/config.json <<EOF
{ "auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_AUTH" }}}
EOF
build
28 changes: 28 additions & 0 deletions ci/tasks/build-ci-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: vito/oci-build-task
inputs:
- name: ci-images-git-repo
outputs:
- name: image
caches:
- path: ci-image-cache
params:
DEBUG: true
CONTEXT: ci-images-git-repo/ci/images
DOCKERFILE: ci-images-git-repo/ci/images/((ci-image-name))/Dockerfile
DOCKER_HUB_AUTH: ((docker-hub-auth))
REGISTRY_MIRRORS: ((docker-hub-mirror))
run:
path: /bin/sh
args:
- "-c"
- |
mkdir -p /root/.docker
cat > /root/.docker/config.json <<EOF
{ "auths": { "https://index.docker.io/v1/": { "auth": "$DOCKER_HUB_AUTH" }}}
EOF
build
17 changes: 17 additions & 0 deletions ci/tasks/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
platform: linux
image_resource:
type: registry-image
source:
repository: springio/github-changelog-generator
tag: '0.0.5'
inputs:
- name: git-repo
- name: built-artifact
outputs:
- name: generated-changelog
params:
GITHUB_USERNAME: ((github-username))
GITHUB_TOKEN: ((github-ci-release-token))
run:
path: git-repo/ci/scripts/generate-changelog.sh
17 changes: 0 additions & 17 deletions ci/tasks/generate-release-notes.yml

This file was deleted.

0 comments on commit 6cda97e

Please sign in to comment.