Skip to content
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version (use hirsuite or bionic on local arm64/Apple Silicon): hirsute, focal, bionic
ARG VARIANT="hirsute"
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
Expand All @@ -10,5 +10,5 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
gettext-base=0.21-3ubuntu2 \
gettext-base=0.21-4ubuntu4 \
&& rm -rf /var/lib/apt/lists/*
17 changes: 15 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: hirsute, focal, bionic
// Use hirsute or bionic on local arm64/Apple Silicon.
"args": { "VARIANT": "hirsute" }
"args": { "VARIANT": "jammy" }
},

// Set *default* container specific settings.json values on container create.
"settings": {},

"customizations": {
// Configure properties specific to Codespaces.
"codespaces": {
"repositories": {
"github/gh-actions-importer": {
"permissions": {
"metadata": "read",
"contents": "read",
"packages": "read"
}
}
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [],
Expand Down
12 changes: 12 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@
npm install -g docsify-cli
python -m pip install --upgrade pip setuptools
python -m pip install --upgrade httpie
python -m pip install 'urllib3<2'


type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y

gh extension install github/gh-actions-importer
gh actions-importer update
20 changes: 0 additions & 20 deletions script/create-files
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,6 @@ create_issues() {
fi
}

make_repo_private() {
# Check if the repo is private
repo_is_private=$(curl -s -S -u "$TOKEN_OWNER:$TEACHER_PAT" -X GET "$repo_endpoint" | jq .private) >>log.out 2>&1

# If the repo is private
if "$repo_is_private"; then
echo "This repo is already private."
return # exit the function
fi

# Default to 'yes' if no answer is given
if ask "Are you ready to make this repo private?" Y; then
# Make the repo private
curl -s -S -i -u "$TOKEN_OWNER:$TEACHER_PAT" -d "{ \"name\": \"$collab_repo\", \"private\": true }" -X PATCH "$repo_endpoint" >>log.out 2>&1
else
echo "OK, just remember to make the repo private and add the info for booking 1:1 appointments to the README."
fi
}

get_commenters() {
# Array of commenters
Expand Down Expand Up @@ -211,5 +193,3 @@ create_files
# Create issues
create_issues

# Make it private
make_repo_private
19 changes: 2 additions & 17 deletions script/create-initial-repo
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,7 @@ update_readme() {
--message "Update _config.yml"
}

create_initial_project() {
# Create project and save the project ID so we can use it to create project columns and cards
create_repo_project --repo "$initial_repo_name" \
--name "Caption Contest" \
--body "Let's see who can create the best captions for our collection of memes."
local project_id="$REPO_PROJECT_ID"

# Create project columns and save the ID of the first colum so we can add a card to it
create_project_column --project_id "$project_id" --name "To do" && local column_one="$COLUMN_ID"
create_project_column --project_id "$project_id" --name "In progress"
create_project_column --project_id "$project_id" --name "Done"

# Add a note to column one
create_project_card --project_id "$project_id" --column_id "$column_one" \
--note "Each student will update their file in the _slides directory with an image and a caption."
}


update_branch_protections() {
# Update branch protection rules for the default branch
Expand Down Expand Up @@ -205,7 +190,7 @@ clone_initial_repo
update_readme
update_branch_protections
create_initial_issue
create_initial_project
#create_initial_project
enable_github_pages

print_done "Here's a link to the repo: $repo_url"
Expand Down
5 changes: 3 additions & 2 deletions script/create-practice-repos
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ generate_repos() {
else
# create a new practice repository
create_practice_repo "$username"
sleep 5
fi
done
}
Expand All @@ -106,7 +107,7 @@ create_practice_repo() {
create_repo \
--name "$repo_name" \
--description "$repo_description" \
--private true \
--private false \
--has_wiki false

git_push "$repo_name"
Expand All @@ -132,7 +133,7 @@ create_practice_repo() {
--name "$repo_name" \
--description "$repo_description" \
--homepage "$template_pages_url" \
--private true \
--private false \
--has_wiki false

git_push "$repo_name"
Expand Down
2 changes: 1 addition & 1 deletion script/shared_functions
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ create_issue() {
echo -n "Creating issue: $title... "

# Wait for 2 second to avoid secondary rate limiting, 1 second was nog enough
sleep 2
sleep 5

if http --check-status --ignore-stdin --quiet --auth \
"$TOKEN_OWNER:$TEACHER_PAT" "$org_repos_endpoint/$repo/issues" \
Expand Down