-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d456800
commit 76c0415
Showing
3 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,7 @@ public | |
.log | ||
|
||
# macOS related files | ||
.DS_Store | ||
.DS_Store | ||
|
||
# CICD | ||
/.concourse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
local GITEA_CREDENTIALS = { | ||
password: '((gitea-access-token))', | ||
username: 'concourse', | ||
}; | ||
local GITEA_HOST = 'gitea.cookie.paris'; | ||
|
||
local DOCKER_IMAGE_RESOURCE = { | ||
name: 'docker-image', | ||
source: GITEA_CREDENTIALS { | ||
repository: GITEA_HOST + '/collective/ccc-website', | ||
tag: 'latest', | ||
}, | ||
type: 'registry-image', | ||
}; | ||
|
||
local GIT_REPOSITORY_RESOURCE = { | ||
name: 'git-repository', | ||
source: { | ||
uri: 'https://github.com/CookieCollective/ccc-website.git', | ||
}, | ||
type: 'git', | ||
}; | ||
|
||
local BUILD_DOCKER_IMAGE_TASK = { | ||
caches: [ | ||
{ | ||
path: 'cache', | ||
}, | ||
], | ||
image_resource: { | ||
source: { | ||
repository: 'concourse/oci-build-task', | ||
}, | ||
type: 'registry-image', | ||
}, | ||
inputs: [ | ||
{ | ||
name: GIT_REPOSITORY_RESOURCE.name, | ||
path: '.', | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: 'image', | ||
}, | ||
], | ||
platform: 'linux', | ||
run: { | ||
path: 'build', | ||
}, | ||
}; | ||
|
||
{ | ||
'pipelines-main.json': { | ||
jobs: [ | ||
{ | ||
local JSONNET_OUTPUT = '.concourse', | ||
name: 'update-pipelines', | ||
plan: [ | ||
{ | ||
get: GIT_REPOSITORY_RESOURCE.name, | ||
params: { | ||
depth: 1, | ||
}, | ||
trigger: true, | ||
}, | ||
{ | ||
task: 'generate-concourse-files', | ||
config: { | ||
image_resource: { | ||
source: { | ||
repository: 'bitnami/jsonnet', | ||
}, | ||
type: 'registry-image', | ||
}, | ||
inputs: [ | ||
{ | ||
name: GIT_REPOSITORY_RESOURCE.name, | ||
}, | ||
], | ||
outputs: [ | ||
{ | ||
name: JSONNET_OUTPUT, | ||
}, | ||
], | ||
platform: 'linux', | ||
run: { | ||
args: [ | ||
'-m', | ||
JSONNET_OUTPUT, | ||
GIT_REPOSITORY_RESOURCE.name + '/concourse.jsonnet', | ||
], | ||
path: 'jsonnet', | ||
user: 'root', | ||
}, | ||
}, | ||
}, | ||
{ | ||
file: JSONNET_OUTPUT + '/pipelines-main.json', | ||
set_pipeline: 'ccc-website', | ||
}, | ||
], | ||
public: true, | ||
}, | ||
{ | ||
name: 'build', | ||
plan: [ | ||
{ | ||
get: GIT_REPOSITORY_RESOURCE.name, | ||
params: { | ||
depth: 1, | ||
}, | ||
passed: [ | ||
'update-pipelines', | ||
], | ||
trigger: true, | ||
}, | ||
{ | ||
config: BUILD_DOCKER_IMAGE_TASK, | ||
privileged: true, | ||
task: 'build-docker-image', | ||
}, | ||
{ | ||
put: DOCKER_IMAGE_RESOURCE.name, | ||
params: { | ||
image: 'image/image.tar', | ||
}, | ||
}, | ||
], | ||
public: true, | ||
}, | ||
], | ||
resources: [ | ||
DOCKER_IMAGE_RESOURCE, | ||
GIT_REPOSITORY_RESOURCE, | ||
], | ||
}, | ||
'tasks-build-docker-image.json': BUILD_DOCKER_IMAGE_TASK, | ||
} |