Skip to content

Commit faef044

Browse files
committed
feat(install): use mutable docker tags for installer
1 parent f6da715 commit faef044

File tree

6 files changed

+17
-22
lines changed

6 files changed

+17
-22
lines changed

.github/workflows/ci.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ jobs:
115115
password: ${{ secrets.DOCKERHUB_PASS }}
116116
repository: redpwn/rctf
117117
# TODO: handle tagging releases correctly
118-
tags: ${{ github.sha }}
118+
tags: master
119+
tag_with_sha: true
119120
# TODO: add cache_froms once we have full releases
120-
- name: Deploy installer
121-
uses: netlify/actions/build@master
122-
env:
123-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124-
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_INSTALL_SITE_ID }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ yarn-error.log*
1010
/conf.d/*
1111
!/conf.d/.keep
1212
/docs/site
13-
/install/build
1413

1514
# Upload provider dir
1615
/uploads

docker-compose.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2.2'
22
services:
33
rctf:
4-
image: redpwn/rctf:${RCTF_GIT_COMMIT}
4+
image: redpwn/rctf:${RCTF_GIT_REF}
55
restart: always
66
ports:
77
- '127.0.0.1:8080:80'
@@ -11,11 +11,6 @@ services:
1111
- .env
1212
environment:
1313
- PORT=80
14-
- RCTF_DATABASE_HOST=postgres
15-
- RCTF_DATABASE_DATABASE=rctf
16-
- RCTF_DATABASE_USERNAME=rctf
17-
- RCTF_REDIS_HOST=redis
18-
- RCTF_DATABASE_MIGRATE=before
1914
volumes:
2015
- ./conf.d:/app/conf.d
2116
depends_on:

install/_redirects

-1
This file was deleted.

install/build.sh

-5
This file was deleted.

install/install.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ do_install() {
6767

6868
info "Configuring rCTF..."
6969

70-
RCTF_GIT_COMMIT="${RCTF_GIT_COMMIT:-"{{git_commit}}"}"
70+
RCTF_GIT_REF="${RCTF_GIT_REF:-"master"}"
7171

7272
mkdir -p conf.d data/rctf-postgres data/rctf-redis
7373

7474
printf "%s\n" \
7575
"RCTF_DATABASE_PASSWORD=$(get_key)" \
7676
"RCTF_REDIS_PASSWORD=$(get_key)" \
77-
"RCTF_GIT_COMMIT=$RCTF_GIT_COMMIT" \
77+
"RCTF_GIT_REF=$RCTF_GIT_REF" \
7878
> .env
7979

8080
printf "%s\n" \
@@ -94,9 +94,20 @@ do_install() {
9494
"endTime: $(date -d +1week +%s)000" \
9595
> conf.d/02-ctf.yaml
9696

97+
printf "%s\n" \
98+
"database:" \
99+
" sql:" \
100+
" host: postgres" \
101+
" user: rctf" \
102+
" database: rctf" \
103+
" redis:" \
104+
" host: redis" \
105+
" migrate: before" \
106+
> conf.d/03-db.yaml
107+
97108
info "Downloading rCTF..."
98109

99-
curl -fsSO "https://raw.githubusercontent.com/redpwn/rctf/$RCTF_GIT_COMMIT/docker-compose.yml"
110+
curl -fsSO "https://raw.githubusercontent.com/redpwn/rctf/$RCTF_GIT_REF/docker-compose.yml"
100111
docker-compose pull
101112

102113
info "Finished installation to ${RCTF_INSTALL_PATH}."

0 commit comments

Comments
 (0)