-
Notifications
You must be signed in to change notification settings - Fork 2
/
update-from-template.sh
executable file
·61 lines (52 loc) · 1.96 KB
/
update-from-template.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# run this if file is not yet present or it should be updated first:
# curl -o update-from-template.sh https://raw.githubusercontent.com/debuglevel/greeting-microservice/master/update-from-template.sh && chmod +x update-from-template.sh && git add --chmod=+x update-from-template.sh && git commit update-from-template.sh -m "Add/Update update-from-template.sh script"
echo "🐧 Adding template git remote..."
git remote add template https://github.com/debuglevel/greeting-microservice.git
echo "🐧 Fetching from git remote..."
git fetch --no-tags template
files=(
# can usually be replaced without any merges
update-from-template.sh
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
LICENSE
.gitlab-ci.yml
.dockerignore
Dockerfile
Procfile
.devcontainer/devcontainer.json
.devcontainer/Dockerfile
.github/workflows/build-checking.yml
.github/workflows/docker.yml
# might need some merges
settings.gradle
.gitignore
.gitpod.yml
.gitpod.Dockerfile
docker-compose.yml
src/main/resources/logback.xml
src/test/resources/application-test.yml
gradle.properties
# might need heavy merges
.travis.yml
build.gradle
src/main/resources/application.yml
)
echo ""
echo "🐧 The following files from the template will be processed:"
for file in "${files[@]}"; do
echo " - $file";
done
echo ""
echo "🐧 The following runs a 'git checkout --patch' command:"
echo " Press [y] to apply a patch."
echo " Press [n] to discard a patch."
echo " Press [e] to edit a patch."
echo " Press [s] to split into smaller hunks."
echo " Press [q] to quit that thing (maybe also useful if this script itself was updated to re-execute it)."
echo " Press [?] to get information about all that letters you can choose."
git checkout -p template/master ${files[*]}
echo "🐧 Now you should carefully check changes before committing."